[FFmpeg-devel] [PATCH] exporting mpeg user_data

Måns Rullgård mans
Wed Mar 19 03:12:42 CET 2008


Michael Niedermayer <michaelni at gmx.at> writes:

> On Tue, Mar 18, 2008 at 02:25:40PM -0700, Eric Hennigan wrote:
>> 
>> diff -ur ffmpeg/libavcodec/avcodec.h 
>> ffmpeg-userdata-modified/libavcodec/avcodec.h
>> --- ffmpeg/libavcodec/avcodec.h       2007-06-16 02:01:28.000000000 -0700
>> +++ ffmpeg-userdata-modified/libavcodec/avcodec.h     2008-03-17 
>> 14:37:05.000000000 -0700
>> @@ -2119,6 +2119,13 @@
>>       * - decoding: unused
>>       */
>>      int64_t timecode_frame_start;
>> +
>> +    /** User Data section
>> +     * - decoding: Set/allocated/freed by libavcodec.
>> +     */
>> +    uint8_t *userdata;
>> +    size_t userdata_size;
>> +
>>  } AVCodecContext;
>> 
>> Sorry, about the signed-ness earlier, I was simply following the types used 
>> for extradata.
>
> size_t is incompatible with FF_OPT_TYPE_BINARY
>
>> 
>> 
>> diff -ur ffmpeg/libavcodec/utils.c ffmpeg-userdata-modified/libavcodec/utils.c
>> --- ffmpeg/libavcodec/utils.c   2007-06-16 02:01:28.000000000 -0700
>> +++ ffmpeg-userdata-modified/libavcodec/utils.c 2008-03-17 
>> 14:42:38.000000000 -0700
>> @@ -729,6 +729,7 @@
>>  {"timecode_frame_start", "GOP timecode frame start number, in non drop frame 
>> format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E},
>>  {"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, 
>> CODEC_FLAG2_DROP_FRAME_TIMECODE, INT_MIN, INT_MAX, V|E, "flags2"},
>>  {"non_linear_q", "use non linear quantizer", 0, FF_OPT_TYPE_CONST, 
>> CODEC_FLAG2_NON_LINEAR_QUANT, INT_MIN, INT_MAX, V|E, "flags2"},
>> +{"userdata_size", NULL, OFFSET(userdata_size), FF_OPT_TYPE_INT, DEFAULT, 
>> INT_MIN, INT_MAX},
>>  {NULL},
>>  };
>> 
>> > Michael says: see FF_OPT_TYPE_BINARY
>> > M?ns Rullg?rd says: This makes no sense at all.
>> 
>> Honestly, I have to plead ignorance on this one. I don't fully know
>> what the hell I'm doing, I'm not intimately familiar with the
>> design of ffmpeg. So, being a complete noob, I simply copied what
>> was done for the extradata field.
>
> look at AVFormatContext.key/keylen and the cryptokey entry as references
> also dont hesitate to read the code in opt.c related to FF_OPT_TYPE_BINARY

This is a decoder output field.  Setting it doesn't make sense.  Even
if the encoder supported user_data injection, this would be the wrong
place to set it.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list