[FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
Michael Niedermayer
michael at niedermayer.cc
Sun May 8 17:33:32 CEST 2016
On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote:
> On Sun, 8 May 2016 12:10:07 +0200
> Michael Niedermayer <michael at niedermayer.cc> wrote:
>
> > Fixes Ticket5467
> >
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> > libavcodec/avcodec.h | 4 ++++
> > libavcodec/utils.c | 2 ++
> > 2 files changed, 6 insertions(+)
> >
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 3813a0a..1db2e0f 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters {
> > * Audio only. Number of samples to skip after a discontinuity.
> > */
> > int seek_preroll;
> > +
> > + /** Properties, like FF_CODEC_PROPERTY_LOSSLESS.
> > + */
> > + int properties;
> > } AVCodecParameters;
> >
> > /**
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index e6609ef..8638bc2 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -4076,6 +4076,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par,
> > par->bits_per_raw_sample = codec->bits_per_raw_sample;
> > par->profile = codec->profile;
> > par->level = codec->level;
> > + par->properties = codec->properties;
> >
> > switch (par->codec_type) {
> > case AVMEDIA_TYPE_VIDEO:
> > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
> > codec->bits_per_raw_sample = par->bits_per_raw_sample;
> > codec->profile = par->profile;
> > codec->level = par->level;
> > + codec->properties = par->properties;
> >
> > switch (par->codec_type) {
> > case AVMEDIA_TYPE_VIDEO:
>
> Can you explain what exactly this is needed for?
User apps can with this identify which streams are lossless without
them needing to open decoders for each stream and explicitly decode
some frames for each stream.
it fixes a regression where this information is incorrectly printed
by av_dump_format()
it fixes a regression where the existing lossless flag as documented by
the current documentation is set incorrectly
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160508/de5b46e5/attachment.sig>
More information about the ffmpeg-devel
mailing list