[FFmpeg-devel] [PATCH 1/5] avformat: Adding accessors for externally used AVStream fields which are after the public field list

Hendrik Leppkes h.leppkes at gmail.com
Wed Jun 29 22:28:50 CEST 2016


On Wed, Jun 29, 2016 at 10:27 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Wed, Jun 29, 2016 at 05:07:52PM -0300, James Almer wrote:
>> On 6/29/2016 4:36 PM, Michael Niedermayer wrote:
>> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>> > ---
>> >  libavformat/avformat.h |    4 ++++
>> >  libavformat/utils.c    |   21 +++++++++++++++++++++
>> >  2 files changed, 25 insertions(+)
>> >
>> > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>> > index 876f1e3..89f014b 100644
>> > --- a/libavformat/avformat.h
>> > +++ b/libavformat/avformat.h
>> > @@ -1224,6 +1224,10 @@ void       av_stream_set_r_frame_rate(AVStream *s, AVRational r);
>> >  struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
>> >  char* av_stream_get_recommended_encoder_configuration(const AVStream *s);
>> >  void  av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration);
>> > +int64_t av_stream_get_cur_dts(AVStream *s);
>> > +int64_t av_stream_get_first_dts(AVStream *s);
>> > +int av_stream_get_pts_wrap_bits(AVStream *s);
>> > +int64_t av_stream_get_codec_info_nb_frames(AVStream *s);
>> >
>> >  /**
>> >   * Returns the pts of the last muxed packet + its duration
>> > diff --git a/libavformat/utils.c b/libavformat/utils.c
>> > index 6f343f2..5168816 100644
>> > --- a/libavformat/utils.c
>> > +++ b/libavformat/utils.c
>> > @@ -132,6 +132,27 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
>> >      return st->parser;
>> >  }
>> >
>> > +int64_t av_stream_get_cur_dts(AVStream *s)
>> > +{
>> > +    return s->cur_dts;
>> > +}
>> > +
>> > +int64_t av_stream_get_first_dts(AVStream *s)
>> > +{
>> > +    return s->first_dts;
>> > +}
>> > +
>> > +int av_stream_get_pts_wrap_bits(AVStream *s)
>> > +{
>> > +    return s->pts_wrap_bits;
>> > +}
>> > +
>> > +int64_t av_stream_get_codec_info_nb_frames(AVStream *s)
>> > +{
>> > +    return s->codec_info_nb_frames;
>> > +}
>> > +
>> > +
>> >  void av_format_inject_global_side_data(AVFormatContext *s)
>> >  {
>> >      int i;
>>
>> No more accessors, please. If these fields truly need to be used outside of
>> libavformat then move them above the private fields mark (alongside minor
>> bump and preferably some minimal doxy).
>
> can you explain how this fixes the ABI breakage between 3.0 and 3.1?
>

There is nothing to fix, only private ABI is broken.

- Hendrik


More information about the ffmpeg-devel mailing list