On Wed, Apr 6, 2016 at 4:40 PM, Vittorio Giovara <vittorio.giov...@gmail.com > wrote:
> On Tue, Apr 5, 2016 at 11:04 PM, Tim W. <tdskywal...@gmail.com> wrote: > > On Tue, Apr 5, 2016 at 10:19 PM, Vittorio Giovara < > > vittorio.giov...@gmail.com> wrote: > > > >> Use it in av_dump_format() instead of a huge switch case. Needed in > >> the next commit as well. > >> --- > >> libavformat/dump.c | 33 +++++---------------------------- > >> libavutil/stereo3d.c | 11 +++++++++++ > >> libavutil/stereo3d.h | 14 ++++++++++++++ > >> libavutil/version.h | 2 +- > >> 4 files changed, 31 insertions(+), 29 deletions(-) > >> > >> diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c > >> index 2dcfddf..c8346aa 100644 > >> --- a/libavutil/stereo3d.c > >> +++ b/libavutil/stereo3d.c > >> @@ -41,3 +41,14 @@ AVStereo3D *av_stereo3d_create_side_data(AVFrame > *frame) > >> > >> return (AVStereo3D *)side_data->data; > >> } > >> + > >> +static const char *stereo3d_type_names[AV_STEREO3D_NB] = { > >> + "2D", "side by side", "top and bottom", "frame alternate", > >> + "checkerboard", "interleaved lines", "interleaved columns", > >> + "side by side (quincunx subsampling)", > >> +}; > > > > > > Yuck… yuck yuck yuck. > > > > May I suggest libavutil/channel_layout.c as a much prettier (and IMO > > better) example? > > You may if you explain why it's better. > In retrospect, I must have been in a bad mood because of tiredness. Here goes: IMO, one line per name is much more readable. The names themselves are fine, AFAICT. > Also note that this is the same style of lavu/pix_desc names too. > Actually, av_pix_fmt_descriptors seems to have more than one line per pix_fmt ;) I agree with Anton that FF_ARRAY_ELEMS should work. Introducing AV_STEREO3D_NB seems outside the scope of such a patch. Tim _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel