Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Derek Buitenhuis
On 9/20/2017 7:30 PM, wm4 wrote: > To be honest, ENOSYS is even more confusing than -1. Think about what > happens if someone converts the error to a string and displays that to > a user. AVERROR(EINVAL)? - Derek ___ ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Michael Niedermayer
On Wed, Sep 20, 2017 at 02:03:02PM +0200, Nicolas George wrote: > Le jour de la Raison, an CCXXV, Vittorio Giovara a écrit : > > It's to be consistent with the other APIs that map a string to an enum, > > like in spherical.c and stereo3d.c. > > I think they should be fixed. Returning -1 as an

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread wm4
On Wed, 20 Sep 2017 14:23:32 +0200 Vittorio Giovara wrote: > Signed-off-by: Vittorio Giovara > --- > Updated following review. > Vittorio > > libavutil/pixdesc.c | 65 > + >

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Moritz Barsnick
On Wed, Sep 20, 2017 at 14:23:32 +0200, Vittorio Giovara wrote: > +/** > + * @return the AVChromaLocation value for name or -1 if not found. > + */ You missed modifying the "-1" here. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org

[FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Vittorio Giovara
Signed-off-by: Vittorio Giovara --- Updated following review. Vittorio libavutil/pixdesc.c | 65 + libavutil/pixdesc.h | 25 + 2 files changed, 90 insertions(+) diff --git a/libavutil/pixdesc.c

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Carl Eugen Hoyos
2017-09-20 14:13 GMT+02:00 Vittorio Giovara : > If this helps, I could modify documentation saying that these functions > will return a "negative value" ... on error. That is what the documentation should say anyway, the functions can still return an error code.

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Vittorio Giovara
Le jour de la Raison, an CCXXV, Vittorio Giovara a écrit : >* It's to be consistent with the other APIs that map a string to an enum, *>* like in spherical.c and stereo3d.c. * I think they should be fixed. Returning -1 as an error code is a path we definitely do not want to go again. Regards, --

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Nicolas George
Le jour de la Raison, an CCXXV, Vittorio Giovara a écrit : > It's to be consistent with the other APIs that map a string to an enum, > like in spherical.c and stereo3d.c. I think they should be fixed. Returning -1 as an error code is a path we definitely do not want to go again. Regards, --

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Vittorio Giovara
+2017-09-20 13:32 GMT+02:00 Vittorio Giovara http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>>: + +>* +int av_color_range_from_name(const char *name) *+>* +{ *+>* +int i; *+>* + *+>* +for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) { *+>* +size_t len =

Re: [FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Carl Eugen Hoyos
2017-09-20 13:32 GMT+02:00 Vittorio Giovara : > +int av_color_range_from_name(const char *name) > +{ > +int i; > + > +for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) { > +size_t len = strlen(color_range_names[i]); > +if

[FFmpeg-devel] [PATCH] pixdesc: Add API to map color property name to enum value

2017-09-20 Thread Vittorio Giovara
Signed-off-by: Vittorio Giovara --- TODO: version bump, APIdoc entry. Vittorio libavutil/pixdesc.c | 65 + libavutil/pixdesc.h | 25 + 2 files changed, 90 insertions(+) diff --git