[FFmpeg-cvslog] dshow: use standardized raw pixel format lookup

rogerdpack git at videolan.org
Tue Feb 5 21:18:38 CET 2013


ffmpeg | branch: master | rogerdpack <rogerpack2005 at gmail.com> | Tue Jan 15 17:07:54 2013 -0700| [a50049a197a5c2964060c447e2675c21b98d94ba] | committer: rogerdpack

dshow: use standardized raw pixel format lookup

Signed-off-by: rogerdpack <rogerpack2005 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a50049a197a5c2964060c447e2675c21b98d94ba
---

 libavdevice/dshow.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 83b5e01..342831d 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -25,6 +25,7 @@
 #include "libavformat/internal.h"
 #include "avdevice.h"
 #include "dshow_capture.h"
+#include "libavcodec/raw.h"
 
 struct dshow_ctx {
     const AVClass *class;
@@ -73,12 +74,6 @@ struct dshow_ctx {
 static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
 {
     switch(biCompression) {
-    case MKTAG('U', 'Y', 'V', 'Y'):
-        return AV_PIX_FMT_UYVY422;
-    case MKTAG('Y', 'U', 'Y', '2'):
-        return AV_PIX_FMT_YUYV422;
-    case MKTAG('I', '4', '2', '0'):
-        return AV_PIX_FMT_YUV420P;
     case BI_BITFIELDS:
     case BI_RGB:
         switch(biBitCount) { /* 1-8 are untested */
@@ -96,7 +91,7 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
                 return AV_PIX_FMT_RGB32;
         }
     }
-    return AV_PIX_FMT_NONE;
+    return avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, biCompression); // all others
 }
 
 static enum AVCodecID dshow_codecid(DWORD biCompression)



More information about the ffmpeg-cvslog mailing list