Hi,

On Wed, Jan 4, 2012 at 6:07 AM, Luca Barbato <lu_z...@gentoo.org> wrote:
> Let pass the codec name to -pixel_format and have the option renamed
> to -input_format.
> ---
>  libavdevice/v4l2.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 2895a01..a5bf058 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -706,11 +706,15 @@ static int v4l2_read_header(AVFormatContext *s1, 
> AVFormatParameters *ap)
>     }
>
>     if (s->pixel_format) {
> +        AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
> +
> +        if (codec)
> +            s1->video_codec_id = codec->id;

Maybe we need a new function enum CodecID av_find_codec_by_name(const
char *name)?

Ronald
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to