changeset 6527:1baa35e06053

yvu9 and if09 support. fixed i420,iyuv handling
author alex
date Sun, 23 Jun 2002 16:03:08 +0000
parents 561de0125a61
children 135186c04f5a
files loader/dshow/DS_VideoDecoder.c loader/dshow/guids.c loader/dshow/guids.h loader/dshow/libwin32.h
diffstat 4 files changed, 34 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/loader/dshow/DS_VideoDecoder.c	Sun Jun 23 16:01:35 2002 +0000
+++ b/loader/dshow/DS_VideoDecoder.c	Sun Jun 23 16:03:08 2002 +0000
@@ -74,9 +74,10 @@
 		{12, fccIYUV, &MEDIASUBTYPE_IYUV, CAP_IYUV},
 		{16, fccUYVY, &MEDIASUBTYPE_UYVY, CAP_UYVY},
 		{12, fccYV12, &MEDIASUBTYPE_YV12, CAP_YV12},
-		{16, fccYV12, &MEDIASUBTYPE_YV12, CAP_YV12},
+		//{16, fccYV12, &MEDIASUBTYPE_YV12, CAP_YV12},
 		{16, fccYVYU, &MEDIASUBTYPE_YVYU, CAP_YVYU},
-		//{12, fccI420, &MEDIASUBTYPE_I420, CAP_I420},
+		{12, fccI420, &MEDIASUBTYPE_I420, CAP_I420},
+		{9,  fccYVU9, &MEDIASUBTYPE_YVU9, CAP_YVU9},
 		{0},
 	    };
 
@@ -192,6 +193,7 @@
 
 	switch (this->iv.m_bh->biCompression)
 	{
+#if 0
 	case fccDIV3:
 	case fccDIV4:
 	case fccDIV5:
@@ -206,10 +208,12 @@
 	    //m_Caps = CAP_I420;
 	    this->m_Caps = (CAP_YUY2 | CAP_UYVY);
 	    break;
+#endif
 	default:
               
 	    this->m_Caps = CAP_NONE;
 
+	    printf("Decoder supports the following YUV formats: ");
 	    for (c = check; c->bits; c++)
 	    {
 		this->m_sVhdr2->bmiHeader.biBitCount = c->bits;
@@ -217,12 +221,16 @@
 		this->m_sDestType.subtype = *c->subtype;
 		result = this->m_pDS_Filter->m_pOutputPin->vt->QueryAccept(this->m_pDS_Filter->m_pOutputPin, &this->m_sDestType);
 		if (!result)
+		{
 		    this->m_Caps = (this->m_Caps | c->cap);
+		    printf("%.4s ", &c->fcc);
+		}
 	    }
+	    printf("\n");
 	}
 
 	if (this->m_Caps != CAP_NONE)
-	    printf("Decoder is capable of YUV output ( flags 0x%x)\n", (int)this->m_Caps);
+	    printf("Decoder is capable of YUV output (flags 0x%x)\n", (int)this->m_Caps);
 
 	this->m_sVhdr2->bmiHeader.biBitCount = 24;
 	this->m_sVhdr2->bmiHeader.biCompression = 0;
@@ -480,12 +488,17 @@
 	case fccIYUV:
 	    this->m_sDestType.subtype = MEDIASUBTYPE_IYUV;
 	    break;
+	case fccI420:
+	    this->m_sDestType.subtype = MEDIASUBTYPE_I420;
+	    break;
 	case fccUYVY:
 	    this->m_sDestType.subtype = MEDIASUBTYPE_UYVY;
 	    break;
 	case fccYVYU:
 	    this->m_sDestType.subtype = MEDIASUBTYPE_YVYU;
 	    break;
+	case fccYVU9:
+	    this->m_sDestType.subtype = MEDIASUBTYPE_YVU9;
 	default:
 	    ok = false;
             break;
@@ -524,6 +537,10 @@
 	if(!(this->m_Caps & CAP_IYUV))
 	    should_test=false;
 	break;
+    case fccI420:
+	if(!(this->m_Caps & CAP_I420))
+	    should_test=false;
+	break;
     case fccUYVY:
 	if(!(this->m_Caps & CAP_UYVY))
 	    should_test=false;
@@ -532,6 +549,10 @@
 	if(!(this->m_Caps & CAP_YVYU))
 	    should_test=false;
 	break;
+    case fccYVU9:
+	if(!(this->m_Caps & CAP_YVU9))
+	    should_test=false;
+	break;
     }
     if(should_test)
 	result = this->m_pDS_Filter->m_pOutputPin->vt->QueryAccept(this->m_pDS_Filter->m_pOutputPin, &this->m_sDestType);
--- a/loader/dshow/guids.c	Sun Jun 23 16:01:35 2002 +0000
+++ b/loader/dshow/guids.c	Sun Jun 23 16:03:08 2002 +0000
@@ -55,6 +55,10 @@
     {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 GUID MEDIASUBTYPE_YV12={0x32315659, 0x0000, 0x0010,
     {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
+GUID MEDIASUBTYPE_I420={0x30323449, 0x0000, 0x0010,
+    {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
+GUID MEDIASUBTYPE_IF09={0x39304649, 0x0000, 0x0010,
+    {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 GUID CLSID_MemoryAllocator={0x1e651cc0, 0xb199, 0x11d0,
     {0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45}};
 GUID IID_DivxHidden={0x598eba01, 0xb49a, 0x11d2,
--- a/loader/dshow/guids.h	Sun Jun 23 16:01:35 2002 +0000
+++ b/loader/dshow/guids.h	Sun Jun 23 16:03:08 2002 +0000
@@ -92,5 +92,6 @@
 extern GUID MEDIASUBTYPE_UYVY;
 extern GUID MEDIASUBTYPE_Y211;
 extern GUID MEDIASUBTYPE_YV12;
+extern GUID MEDIASUBTYPE_I420;
 
 #endif
--- a/loader/dshow/libwin32.h	Sun Jun 23 16:01:35 2002 +0000
+++ b/loader/dshow/libwin32.h	Sun Jun 23 16:03:08 2002 +0000
@@ -88,6 +88,8 @@
 	CAP_UYVY = 8,
 	CAP_YVYU = 16,
 	CAP_I420 = 32,
+	CAP_YVU9 = 64,
+	CAP_IF09 = 128,
     };
     enum DecodingMode
     {
@@ -230,7 +232,7 @@
 #define fccVCR2 mmioFOURCC('V', 'C', 'R', '2')
 #define fccVCR1 mmioFOURCC('V', 'C', 'R', '1')
 #define fccVYUY mmioFOURCC('V', 'Y', 'U', 'Y')
-#define fccYVU9 mmioFOURCC('I', 'Y', 'U', '9')
+#define fccIYU9 mmioFOURCC('I', 'Y', 'U', '9') // it was defined as fccYVU9
 
 /* Asus codecs */
 #define fccASV1 mmioFOURCC('A', 'S', 'V', '1')
@@ -255,5 +257,7 @@
 #define fccIYUV mmioFOURCC('I', 'Y', 'U', 'V')/* Planar mode: Y + U + V  (3 planes) */
 #define fccUYVY mmioFOURCC('U', 'Y', 'V', 'Y')/* Packed mode: U0+Y0+V0+Y1 (1 plane) */
 #define fccYVYU mmioFOURCC('Y', 'V', 'Y', 'U')/* Packed mode: Y0+V0+Y1+U0 (1 plane) */
+#define fccYVU9 mmioFOURCC('Y', 'V', 'U', '9')/* Planar 4:1:0 */
+#define fccIF09 mmioFOURCC('I', 'F', '0', '9')/* Planar 4:1:0 + delta */
 
 #endif