[FFmpeg-cvslog] r19544 - trunk/libavdevice/vfwcap.c

ramiro subversion
Thu Jul 30 19:29:25 CEST 2009


Author: ramiro
Date: Thu Jul 30 19:29:24 2009
New Revision: 19544

Log:
vfwcap: Support compressed streams.

Modified:
   trunk/libavdevice/vfwcap.c

Modified: trunk/libavdevice/vfwcap.c
==============================================================================
--- trunk/libavdevice/vfwcap.c	Thu Jul 30 19:25:15 2009	(r19543)
+++ trunk/libavdevice/vfwcap.c	Thu Jul 30 19:29:24 2009	(r19544)
@@ -69,6 +69,15 @@ static enum PixelFormat vfw_pixfmt(DWORD
     return PIX_FMT_NONE;
 }
 
+static enum CodecID vfw_codecid(DWORD biCompression)
+{
+    switch(biCompression) {
+    case MKTAG('d', 'v', 's', 'd'):
+        return CODEC_ID_DVVIDEO;
+    }
+    return CODEC_ID_NONE;
+}
+
 #define dstruct(pctx, sname, var, type) \
     av_log(pctx, AV_LOG_DEBUG, #var":\t%"type"\n", sname->var)
 
@@ -321,14 +330,20 @@ static int vfw_read_header(AVFormatConte
     codec->height = height;
     codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);
     if(codec->pix_fmt == PIX_FMT_NONE) {
+        codec->codec_id = vfw_codecid(biCompression);
+        if(codec->codec_id == CODEC_ID_NONE) {
         av_log(s, AV_LOG_ERROR, "Unknown compression type. "
                          "Please report verbose (-v 9) debug information.\n");
         vfw_read_close(s);
         return AVERROR_PATCHWELCOME;
+        }
+        codec->bits_per_coded_sample = biBitCount;
     }
+    else {
     codec->codec_id = CODEC_ID_RAWVIDEO;
     if(biCompression == BI_RGB)
         codec->bits_per_coded_sample = biBitCount;
+    }
 
     av_set_pts_info(st, 32, 1, 1000);
 



More information about the ffmpeg-cvslog mailing list