FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
avfoundation.m File Reference

AVFoundation input device. More...

#import <AVFoundation/AVFoundation.h>
#include <pthread.h>
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "libavformat/internal.h"
#include "libavutil/internal.h"
#include "libavutil/time.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  AVFPixelFormatSpec
 
struct  AVFContext
 
class  AVFFrameReceiver
 FrameReciever class - delegate for AVCaptureSession. More...
 

Functions

static void lock_frames (AVFContext *ctx)
 
static void unlock_frames (AVFContext *ctx)
 
static void destroy_context (AVFContext *ctx)
 
static int avf_read_header (AVFormatContext *s)
 
static int avf_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int avf_close (AVFormatContext *s)
 

Variables

static const int avf_time_base = 100
 
static const AVRational avf_time_base_q
 
static struct AVFPixelFormatSpec avf_pixel_formats []
 
static const AVOption options []
 
static const AVClass avf_class
 
AVInputFormat ff_avfoundation_demuxer
 

Detailed Description

AVFoundation input device.

Author
Thilo Borgmann thilo.nosp@m..bor.nosp@m.gmann.nosp@m.@mai.nosp@m.l.de

Definition in file avfoundation.m.

Function Documentation

static void lock_frames ( AVFContext ctx)
static
static void unlock_frames ( AVFContext ctx)
static
static void destroy_context ( AVFContext ctx)
static

Definition at line 155 of file avfoundation.m.

Referenced by avf_close(), and avf_read_header().

static int avf_read_header ( AVFormatContext s)
static

Definition at line 175 of file avfoundation.m.

static int avf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 393 of file avfoundation.m.

static int avf_close ( AVFormatContext s)
static

Definition at line 432 of file avfoundation.m.

Variable Documentation

const int avf_time_base = 100
static

Definition at line 38 of file avfoundation.m.

Referenced by avf_read_header().

const AVRational avf_time_base_q
static
Initial value:
= {
.num = 1,
}

Definition at line 40 of file avfoundation.m.

struct AVFPixelFormatSpec avf_pixel_formats[]
static
Initial value:
= {
{ AV_PIX_FMT_MONOBLACK, kCVPixelFormatType_1Monochrome },
{ AV_PIX_FMT_RGB555BE, kCVPixelFormatType_16BE555 },
{ AV_PIX_FMT_RGB555LE, kCVPixelFormatType_16LE555 },
{ AV_PIX_FMT_RGB565BE, kCVPixelFormatType_16BE565 },
{ AV_PIX_FMT_RGB565LE, kCVPixelFormatType_16LE565 },
{ AV_PIX_FMT_RGB24, kCVPixelFormatType_24RGB },
{ AV_PIX_FMT_BGR24, kCVPixelFormatType_24BGR },
{ AV_PIX_FMT_0RGB, kCVPixelFormatType_32ARGB },
{ AV_PIX_FMT_BGR0, kCVPixelFormatType_32BGRA },
{ AV_PIX_FMT_0BGR, kCVPixelFormatType_32ABGR },
{ AV_PIX_FMT_RGB0, kCVPixelFormatType_32RGBA },
{ AV_PIX_FMT_BGR48BE, kCVPixelFormatType_48RGB },
{ AV_PIX_FMT_UYVY422, kCVPixelFormatType_422YpCbCr8 },
{ AV_PIX_FMT_YUVA444P, kCVPixelFormatType_4444YpCbCrA8R },
{ AV_PIX_FMT_YUVA444P16LE, kCVPixelFormatType_4444AYpCbCr16 },
{ AV_PIX_FMT_YUV444P, kCVPixelFormatType_444YpCbCr8 },
{ AV_PIX_FMT_YUV422P16, kCVPixelFormatType_422YpCbCr16 },
{ AV_PIX_FMT_YUV422P10, kCVPixelFormatType_422YpCbCr10 },
{ AV_PIX_FMT_YUV444P10, kCVPixelFormatType_444YpCbCr10 },
{ AV_PIX_FMT_YUV420P, kCVPixelFormatType_420YpCbCr8Planar },
{ AV_PIX_FMT_NV12, kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange },
{ AV_PIX_FMT_YUYV422, kCVPixelFormatType_422YpCbCr8_yuvs },
}

Definition at line 50 of file avfoundation.m.

const AVOption options[]
static
Initial value:
= {
{ "frame_rate", "set frame rate", 0x42, AV_OPT_TYPE_FLOAT, { .dbl = 30.0 }, 0.1, 30.0, AV_OPT_TYPE_VIDEO_RATE, NULL },
{ "list_devices", "list available devices", 0x42, AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
{ "true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
{ "false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "list_devices" },
{ "video_device_index", "select video device by index for devices with same name (starts at 0)", 0x42, AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "pixel_format", "set pixel format", 0x42, AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
{ NULL },
}

Definition at line 439 of file avfoundation.m.

const AVClass avf_class
static
Initial value:
= {
.class_name = "AVFoundation input device",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 449 of file avfoundation.m.

AVInputFormat ff_avfoundation_demuxer
Initial value:
= {
.name = "avfoundation",
.long_name = NULL_IF_CONFIG_SMALL("AVFoundation input device"),
.priv_data_size = sizeof(AVFContext),
.priv_class = &avf_class,
}

Definition at line 456 of file avfoundation.m.