On date Tuesday 2011-05-24 07:35:08 +0200, Anton Khirnov encoded:
> ---
>  libavdevice/dv1394.c |   30 +++++++++++++++++++++++++-----
>  1 files changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c
> index 70f928e..6906db8 100644
> --- a/libavdevice/dv1394.c
> +++ b/libavdevice/dv1394.c
> @@ -30,6 +30,8 @@
>  #include <time.h>
>  #include <strings.h>
>  
> +#include "libavutil/log.h"
> +#include "libavutil/opt.h"
>  #include "libavformat/avformat.h"
>  
>  #undef DV1394_DEBUG
> @@ -38,6 +40,7 @@
>  #include "dv1394.h"
>  
>  struct dv1394_data {
> +    AVClass *class;
>      int fd;
>      int channel;
>      int format;
> @@ -90,10 +93,12 @@ static int dv1394_read_header(AVFormatContext * context, 
> AVFormatParameters * ap
>      if (!dv->dv_demux)
>          goto failed;
>  
> -    if (ap->standard && !strcasecmp(ap->standard, "pal"))
> -        dv->format = DV1394_PAL;
> -    else
> -        dv->format = DV1394_NTSC;
> +    if (ap->standard) {
> +       if (!strcasecmp(ap->standard, "pal"))
> +           dv->format = DV1394_PAL;
> +       else
> +           dv->format = DV1394_NTSC;
> +    }
>  
>      if (ap->channel)
>          dv->channel = ap->channel;
> @@ -227,6 +232,20 @@ static int dv1394_close(AVFormatContext * context)
>      return 0;
>  }
>  
> +static const AVOption options[] = {
> +    { "standard", "", offsetof(struct dv1394_data, format), FF_OPT_TYPE_INT, 
> {.dbl = DV1394_NTSC}, DV1394_PAL, DV1394_NTSC, AV_OPT_FLAG_DECODING_PARAM, 
> "standard" },
> +    { "PAL",      "", 0, FF_OPT_TYPE_CONST, {.dbl = DV1394_PAL},   0, 0, 
> AV_OPT_FLAG_DECODING_PARAM, "standard" },
> +    { "NTSC",     "", 0, FF_OPT_TYPE_CONST, {.dbl = DV1394_NTSC},  0, 0, 
> AV_OPT_FLAG_DECODING_PARAM, "standard" },

This is changing the case, thus possibly causing commandline
regressions with -tvstd (note: opt.c uses strcmp). Anyway I'm not
strong about this, and -tvstd should be dropped soon or later.

> +    { NULL },
> +};
> +
> +static const AVClass dv1394_class = {
> +    .class_name = "DV1394 grab interface",

.class_name nitpick.

Rest looks OK.
-- 
For your penance, say five Hail Marys and one loud BLAH!
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to