[FFmpeg-devel] [PATCH] AVFoundation: Add -pixel_format option

sfan5 sfan5 at live.de
Sun May 11 11:13:31 CEST 2014


On 11.05.2014 at 10:04 Lukasz Marek wrote:
>
>> @@ -285,7 +312,7 @@ static int avf_read_header(AVFormatContext *s)
>>       stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
>>       stream->codec->width      = (int)image_buffer_size.width;
>>       stream->codec->height     = (int)image_buffer_size.height;
>> -    stream->codec->pix_fmt    = AV_PIX_FMT_RGB24;
>> +    stream->codec->pix_fmt    = pxl_fmt_spec.ff_id;
>>
>>       CFRelease(ctx->current_frame);
>>       ctx->current_frame = nil;
>> @@ -352,6 +379,7 @@ static const AVOption options[] = {
>>       { "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)", offsetof(AVFContext, 
>> video_device_index), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, 
>> AV_OPT_FLAG_DECODING_PARAM },
>> +    { "pixel_format", "Set pixel format", offsetof(AVFContext, 
>> pixel_format), AV_OPT_TYPE_STRING, { .str = "24rgb" }, 0, 0, 
>> AV_OPT_FLAG_DECODING_PARAM},
>
> It should be AV_OPT_TYPE_PIXEL_FMT
> name can be removed from avf_pixel_formats and do mapping between enum 
> AVPixelFormat and AVFoundation directly.
I've implemented your suggestion, the new patch is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AVFoundation-Add-pixel_format-option.patch
Type: text/x-patch
Size: 5911 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140511/fc15b7d4/attachment.bin>


More information about the ffmpeg-devel mailing list