changeset 5261:9e80ac615570

committed Roberto Togni's patch for control() function in HuffYUV decoder
author melanson
date Fri, 22 Mar 2002 14:11:13 +0000
parents 7a37ce6f3464
children 7c1425197af0
files libmpcodecs/vd_huffyuv.c
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_huffyuv.c	Fri Mar 22 07:35:48 2002 +0000
+++ b/libmpcodecs/vd_huffyuv.c	Fri Mar 22 14:11:13 2002 +0000
@@ -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;
 }