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))\
|
2016-09-25 03:07:04 +02:00
|
|
|
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__
|
2016-09-25 03:07:04 +02:00
|
|
|
@interface OSXVideo :
|
2016-10-05 11:55:45 +02:00
|
|
|
NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
|
2016-09-25 03:07:04 +02:00
|
|
|
- (instancetype)initWithDeviceNames:
|
2016-10-05 11:55:45 +02:00
|
|
|
(char **)device_names AmtDevices:
|
|
|
|
(int *)size;
|
2015-08-20 13:39:47 +02:00
|
|
|
@end
|
|
|
|
#endif /* __OBJC__ */
|
|
|
|
|
|
|
|
int osx_video_init(char **device_names, int *size);
|
2018-09-14 01:47:47 +02:00
|
|
|
void osx_video_release(void);
|
2015-08-20 13:39:47 +02:00
|
|
|
/* 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
|
|
|
|
|
|
|
|
2018-09-14 01:47:47 +02:00
|
|
|
#endif /* OSX_VIDEO_H */
|