mmal: Add better codec long names

Message ID 1462210277-15400-1-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun May 2, 2016, 5:31 p.m.
---
 libavcodec/mmaldec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Vittorio Giovara May 4, 2016, 4:02 p.m. | #1
On Mon, May 2, 2016 at 1:31 PM, Diego Biurrun <diego@biurrun.de> wrote:
> ---
>  libavcodec/mmaldec.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
> index 193df7e..4bbb32c 100644
> --- a/libavcodec/mmaldec.c
> +++ b/libavcodec/mmaldec.c
> @@ -815,11 +815,11 @@ static const AVOption options[]={
>          .version    = LIBAVUTIL_VERSION_INT, \
>      };
>
> -#define FFMMAL_DEC(NAME, ID) \
> +#define FFMMAL_DEC(NAME, ID, LONG_NAME) \
>      FFMMAL_DEC_CLASS(NAME) \
>      AVCodec ff_##NAME##_mmal_decoder = { \
>          .name           = #NAME "_mmal", \
> -        .long_name      = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \
> +        .long_name      = NULL_IF_CONFIG_SMALL(#LONG_NAME " (MMAL)"),   \
>          .type           = AVMEDIA_TYPE_VIDEO, \
>          .id             = ID, \
>          .priv_data_size = sizeof(MMALDecodeContext), \
> @@ -835,6 +835,6 @@ static const AVOption options[]={
>                                                           AV_PIX_FMT_NONE}, \
>      };
>
> -FFMMAL_DEC(h264, AV_CODEC_ID_H264)
> -FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
> -FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)
> +FFMMAL_DEC(h264,  AV_CODEC_ID_H264,       H.264)
> +FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO, MPEG-2)
> +FFMMAL_DEC(vc1,   AV_CODEC_ID_VC1,        VC-1)

ok if tested
wm4 May 4, 2016, 6:03 p.m. | #2
On Mon,  2 May 2016 19:31:17 +0200
Diego Biurrun <diego@biurrun.de> wrote:

> ---
>  libavcodec/mmaldec.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
> index 193df7e..4bbb32c 100644
> --- a/libavcodec/mmaldec.c
> +++ b/libavcodec/mmaldec.c
> @@ -815,11 +815,11 @@ static const AVOption options[]={
>          .version    = LIBAVUTIL_VERSION_INT, \
>      };
>  
> -#define FFMMAL_DEC(NAME, ID) \
> +#define FFMMAL_DEC(NAME, ID, LONG_NAME) \
>      FFMMAL_DEC_CLASS(NAME) \
>      AVCodec ff_##NAME##_mmal_decoder = { \
>          .name           = #NAME "_mmal", \
> -        .long_name      = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \
> +        .long_name      = NULL_IF_CONFIG_SMALL(#LONG_NAME " (MMAL)"),   \
>          .type           = AVMEDIA_TYPE_VIDEO, \
>          .id             = ID, \
>          .priv_data_size = sizeof(MMALDecodeContext), \
> @@ -835,6 +835,6 @@ static const AVOption options[]={
>                                                           AV_PIX_FMT_NONE}, \
>      };
>  
> -FFMMAL_DEC(h264, AV_CODEC_ID_H264)
> -FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
> -FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)
> +FFMMAL_DEC(h264,  AV_CODEC_ID_H264,       H.264)
> +FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO, MPEG-2)
> +FFMMAL_DEC(vc1,   AV_CODEC_ID_VC1,        VC-1)

I don't know. It's not a tragedy, but on the other hand I think adding
1 macro argument (and causing conflicts in the yet unapplied mpeg4
patch) is not worth the trouble just for a _slightly_ better name for a
rather obscure decoder wrapper.
Diego Biurrun May 4, 2016, 9:01 p.m. | #3
On Wed, May 04, 2016 at 08:03:13PM +0200, wm4 wrote:
> On Mon,  2 May 2016 19:31:17 +0200
> Diego Biurrun <diego@biurrun.de> wrote:
> > --- a/libavcodec/mmaldec.c
> > +++ b/libavcodec/mmaldec.c
> > @@ -815,11 +815,11 @@ static const AVOption options[]={
> >          .version    = LIBAVUTIL_VERSION_INT, \
> >      };
> >  
> > -#define FFMMAL_DEC(NAME, ID) \
> > +#define FFMMAL_DEC(NAME, ID, LONG_NAME) \
> >      FFMMAL_DEC_CLASS(NAME) \
> >      AVCodec ff_##NAME##_mmal_decoder = { \
> >          .name           = #NAME "_mmal", \
> > -        .long_name      = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \
> > +        .long_name      = NULL_IF_CONFIG_SMALL(#LONG_NAME " (MMAL)"),   \
> >          .type           = AVMEDIA_TYPE_VIDEO, \
> >          .id             = ID, \
> >          .priv_data_size = sizeof(MMALDecodeContext), \
> > @@ -835,6 +835,6 @@ static const AVOption options[]={
> >                                                           AV_PIX_FMT_NONE}, \
> >      };
> >  
> > -FFMMAL_DEC(h264, AV_CODEC_ID_H264)
> > -FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
> > -FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)
> > +FFMMAL_DEC(h264,  AV_CODEC_ID_H264,       H.264)
> > +FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO, MPEG-2)
> > +FFMMAL_DEC(vc1,   AV_CODEC_ID_VC1,        VC-1)
> 
> I don't know. It's not a tragedy, but on the other hand I think adding
> 1 macro argument (and causing conflicts in the yet unapplied mpeg4
> patch) is not worth the trouble just for a _slightly_ better name for a
> rather obscure decoder wrapper.

It certainly does not have to cause conflicts.  I will just wait until
that patch is applied and rebase it on top afterwards.

Diego

Patch

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 193df7e..4bbb32c 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -815,11 +815,11 @@  static const AVOption options[]={
         .version    = LIBAVUTIL_VERSION_INT, \
     };
 
-#define FFMMAL_DEC(NAME, ID) \
+#define FFMMAL_DEC(NAME, ID, LONG_NAME) \
     FFMMAL_DEC_CLASS(NAME) \
     AVCodec ff_##NAME##_mmal_decoder = { \
         .name           = #NAME "_mmal", \
-        .long_name      = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \
+        .long_name      = NULL_IF_CONFIG_SMALL(#LONG_NAME " (MMAL)"),   \
         .type           = AVMEDIA_TYPE_VIDEO, \
         .id             = ID, \
         .priv_data_size = sizeof(MMALDecodeContext), \
@@ -835,6 +835,6 @@  static const AVOption options[]={
                                                          AV_PIX_FMT_NONE}, \
     };
 
-FFMMAL_DEC(h264, AV_CODEC_ID_H264)
-FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
-FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)
+FFMMAL_DEC(h264,  AV_CODEC_ID_H264,       H.264)
+FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO, MPEG-2)
+FFMMAL_DEC(vc1,   AV_CODEC_ID_VC1,        VC-1)