2015-08-20 13:39:47 +02:00
|
|
|
/* osx_video.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Toxic All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file is part of Toxic.
|
|
|
|
*
|
|
|
|
* Toxic is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Toxic is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Toxic. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OSX_VIDEO_H
|
|
|
|
#define OSX_VIDEO_H
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
#ifdef __OBJC__
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <AVFoundation/AVFoundation.h>
|
2015-08-20 21:23:01 +02:00
|
|
|
#endif /* __OBJC__ */
|
|
|
|
|
|
|
|
#define RELEASE_CHK(func, obj) if ((obj))\
|
|
|
|
func((obj));
|
2015-08-20 13:39:47 +02:00
|
|
|
|
2015-08-20 21:23:01 +02:00
|
|
|
void bgrtoyuv420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v, uint8_t *rgb, uint16_t width, uint16_t height);
|
|
|
|
|
|
|
|
#ifdef __OBJC__
|
2015-08-20 13:39:47 +02:00
|
|
|
@interface OSXVideo : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
|
|
|
|
- (instancetype)initWithDeviceNames:(char **)device_names AmtDevices:(int *)size;
|
|
|
|
@end
|
|
|
|
#endif /* __OBJC__ */
|
|
|
|
|
|
|
|
int osx_video_init(char **device_names, int *size);
|
|
|
|
void osx_video_release();
|
|
|
|
/* Start device */
|
2015-08-20 21:23:01 +02:00
|
|
|
int osx_video_open_device(uint32_t selection, uint16_t *width, uint16_t *height);
|
2015-08-20 13:39:47 +02:00
|
|
|
/* Stop device */
|
|
|
|
void osx_video_close_device(uint32_t device_idx);
|
|
|
|
/* Read data from device */
|
2015-08-20 21:23:01 +02:00
|
|
|
int osx_video_read_device(uint8_t *y, uint8_t *u, uint8_t *v, uint16_t *width, uint16_t *height);
|
2015-08-20 13:39:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* OSX_VIDEO_H */
|