[FFmpeg-devel] [PATCH 1/2] lavu: Add JEDEC P22 color primaries

Ronald S. Bultje rsbultje at gmail.com
Wed Nov 30 23:55:33 EET 2016


Hi,

On Wed, Nov 30, 2016 at 4:51 PM, Andreas Cadhalpun <
andreas.cadhalpun at googlemail.com> wrote:

> On 30.11.2016 19:16, Vittorio Giovara wrote:
> > Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
> > ---
> > Please CC.
> > Vittorio
> >
> >  libavutil/pixdesc.c | 1 +
> >  libavutil/pixfmt.h  | 1 +
> >  2 files changed, 2 insertions(+)
> >
> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > index 3b9c45d..04eab0b 100644
> > --- a/libavutil/pixdesc.c
> > +++ b/libavutil/pixdesc.c
> > @@ -2183,6 +2183,7 @@ static const char *color_primaries_names[AVCOL_PRI_NB]
> = {
> >      [AVCOL_PRI_SMPTE428] = "smpte428",
> >      [AVCOL_PRI_SMPTE431] = "smpte431",
> >      [AVCOL_PRI_SMPTE432] = "smpte432",
> > +    [AVCOL_PRI_JEDEC_P22] = "jedec-p22",
> >  };
> >
> >  static const char *color_transfer_names[] = {
> > diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> > index dfb1b11..d6c5a57 100644
> > --- a/libavutil/pixfmt.h
> > +++ b/libavutil/pixfmt.h
> > @@ -413,6 +413,7 @@ enum AVColorPrimaries {
> >      AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428,
> >      AVCOL_PRI_SMPTE431    = 11, ///< SMPTE ST 431-2 (2011)
> >      AVCOL_PRI_SMPTE432    = 12, ///< SMPTE ST 432-1 D65 (2010)
> > +    AVCOL_PRI_JEDEC_P22   = 22, ///< JEDEC P22 phosphors
> >      AVCOL_PRI_NB                ///< Not part of ABI
> >  };
>
> You can't just add a gap like that.
> The current code assumes that the numbers are consecutive, like e.g. the
> naming of AVCOL_PRI_NB suggests.


No, we've had gaps in these before.

Whether all code works correctly with gaps is a separate thing, but gaps
are intended and have existed.

Ronald


More information about the ffmpeg-devel mailing list