On Fri, Aug 1, 2014 at 7:14 PM, wm4 <[email protected]> wrote:
> On Thu, 31 Jul 2014 19:56:33 -0400
> Andrew Stone <[email protected]> wrote:
>
>> The only flag, for now, is AVFMT_EVENT_FLAG_METADATA_UPDATED, which is 
>> updated after each call to
>> av_read_frame(). This comes with the caveat that, on stream start, it might 
>> not be set properly
>> as packets might be buffered in AVFormatContext.packet_buffer before being 
>> given to the user
>> in av_read_frame().
>> ---
>>  doc/APIchanges         | 4 ++++
>>  libavformat/avformat.h | 9 +++++++++
>>  libavformat/utils.c    | 2 ++
>>  libavformat/version.h  | 2 +-
>>  4 files changed, 16 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/APIchanges b/doc/APIchanges
>> index 261993b..a677e42 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -13,6 +13,10 @@ libavutil:     2013-12-xx
>>
>>  API changes, most recent first:
>>
>> +2014-xx-xx - xxxxxxx - lavf 55.21.0 - avformat.h
>> +  Add AVFormatContext.event_flags for signaling to the user when events
>> +  have happened in the stream.
>> +
>>  2014-07-xx - xxxxxxx - lavu 53.19.0 - avstring.h
>>    Make name matching function from lavf public as av_match_name().
>>
>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>> index ab2081a..356677f 100644
>> --- a/libavformat/avformat.h
>> +++ b/libavformat/avformat.h
>> @@ -1177,6 +1177,15 @@ typedef struct AVFormatContext {
>>       * @see AVCodecContext.strict_std_compliance
>>       */
>>      int strict_std_compliance;
>> +
>> +    /**
>> +     * Flags for the user to detect events happening on the stream. These
>> +     * are cleared and set anew after each call to av_read_frame().
>> +     * A combination of AVFMT_EVENT_FLAG_*.
>> +     */
>> +    int event_flags;
>> +#define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in 
>> updated metadata.
>> +
>
> There are many "metadata" fields in libavformat:
> - AVFormatContext.metadata
> - AVStream.metadata
> - AVProgram.metadata
> - AVChapter.metadata
>
> Keep in mind that the library user has to check manually what exactly
> updated. The doxygen for the event flag thus should be very clear on
> what fields might have been changed.
>
> It seems for our purposes, only the AVFormatContext and AVStream fields
> can be updated, so that should be documented.

Actually, it might be even better to have a few flags to indicate
which set of metadata changed.

>
> Also, there's a doxygen section about metadata further up in
> avformat.h. Maybe you should add some words about metadata update there.

Will do.

>
> In general, I think it's an OK API, although I'm slightly disgruntled
> about how this API is different from FFmpeg's.

FFmpeg's includes the entire dictionary of values whenever there is a
change, without specifying where the change is. Using multiple flags
has the same net effect with much less code, and, IMHO, is easier to
work with.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to