[Ffmpeg-devel] [PATCH] let ffplay can play more pixel format

Benoit Fouet benoit.fouet
Wed Feb 14 12:29:45 CET 2007


Limin Wang wrote:
> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 7961)
> +++ ffplay.c	(working copy)
> @@ -186,6 +186,7 @@
>  static int fs_screen_height;
>  static int screen_width = 0;
>  static int screen_height = 0;
> +static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
>  static int audio_disable;
>  static int video_disable;
>  static int wanted_audio_stream= 0;
> @@ -1869,7 +1870,8 @@
>      ap->width = screen_width;
>      ap->height= screen_height;
>      ap->time_base= (AVRational){1, 25};
> -
> +    ap->pix_fmt = frame_pix_fmt;
> +	
>   
AFAIK, ,no trailing space is allowed in ffmpeg svn

>      err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
>      if (err < 0) {
>          print_error(is->filename, err);
> @@ -2362,6 +2364,11 @@
>      }
>  }
>  
> +static void opt_frame_pix_fmt(const char *arg)
> +{
> +    frame_pix_fmt = avcodec_get_pix_fmt(arg);
> +}
> +
>  #ifdef CONFIG_NETWORK
>  void opt_rtp_tcp(void)
>  {
> @@ -2418,6 +2425,7 @@
>      { "bytes", OPT_BOOL, {(void*)&seek_by_bytes}, "seek by bytes" },
>      { "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },
>      { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
> +    { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" },
>      { "stats", OPT_BOOL | OPT_EXPERT, {(void*)&show_status}, "show status", "" },
>      { "debug", HAS_ARG | OPT_EXPERT, {(void*)opt_debug}, "print specific debug info", "" },
>      { "bug", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&workaround_bugs}, "workaround bugs", "" },
>   
Ben





More information about the ffmpeg-devel mailing list