[MPlayer-dev-eng] [PATCH] HuffYUV native support
Roberto Togni
rtogni at bresciaonline.it
Thu Mar 21 13:24:16 CET 2002
On 2002.03.21 00:05 Arpi wrote:
> Hi,
>
> > These patches add HuffYUV native support to Mplayer for YUV and RGB
> > files (RGBA not supported yet).
> >
> [...]
> the list of supported outfmts is still in codecs.conf, but you can
> implement
> the QUERY_FORMAT control() call so these will be queried, and in case
> of
> FALSE reply they will be removed from codecs.conf list by vd.c.
>
> see the vd_raw.c for example.
>
> the QUERY_FORMAT control call will be called from
> mpcodecs_config_vo().
>
> [...]
>
> yes. also implement that control() case.
> only automatic conversion missing from libmpcodecs.
>
> > I also had to disable MP_IMAGEFLAG_ACCEPT_STRIDE for BGR32/BGR24
> output
> > because it wasn't working, i'm still looking at it.
> ok
>
Attached you can find a patch that implements control() for HuffYUV
decoder.
Ciao,
Roberto
-------------- next part --------------
--- vd_huffyuv.c.orig Thu Mar 21 02:21:35 2002
+++ vd_huffyuv.c Thu Mar 21 00:13:00 2002
@@ -161,8 +161,23 @@
// to set/get/query special features/parameters
-static int control(sh_video_t *sh,int cmd,void* arg,...){
- return CONTROL_UNKNOWN;
+static int control(sh_video_t *sh,int cmd,void* arg,...)
+{
+ switch(cmd) {
+ case VDCTRL_QUERY_FORMAT:
+ if (((huffyuv_context_t *)(sh->context))->bitmaptype == BMPTYPE_YUV) {
+ if (*((int*)arg) == IMGFMT_YUY2)
+ return CONTROL_TRUE;
+ else
+ return CONTROL_FALSE;
+ } else {
+ if ((*((int*)arg) == IMGFMT_BGR32) || (*((int*)arg) == IMGFMT_BGR24))
+ return CONTROL_TRUE;
+ else
+ return CONTROL_FALSE;
+ }
+ }
+ return CONTROL_UNKNOWN;
}
More information about the MPlayer-dev-eng
mailing list