]> git.sesse.net Git - vlc/commitdiff
omxil: Set the WMV type
authorMartin Storsjö <martin@martin.st>
Wed, 19 Sep 2012 09:54:44 +0000 (12:54 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 19 Sep 2012 12:47:48 +0000 (14:47 +0200)
This isn't necessary on Galaxy S3 for VC1 (since WMV3/VC1 is the
default type), but might be necessary for WMV1/2 (untested yet).

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/omxil.c

index a0f423d6cc9f59889687141e021c8f64c7b41afb..002adc212e6c28c7c811880cf6b3fe321a4ff429 100644 (file)
@@ -431,6 +431,27 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
         def->nBufferSize *= 2;
     }
 
+    if (def->format.video.eCompressionFormat == OMX_VIDEO_CodingWMV) {
+        OMX_VIDEO_PARAM_WMVTYPE wmvtype = { 0 };
+        OMX_INIT_STRUCTURE(wmvtype);
+        wmvtype.nPortIndex = def->nPortIndex;
+        switch (p_dec->fmt_in.i_codec) {
+        case VLC_CODEC_WMV1:
+            wmvtype.eFormat = OMX_VIDEO_WMVFormat7;
+            break;
+        case VLC_CODEC_WMV2:
+            wmvtype.eFormat = OMX_VIDEO_WMVFormat8;
+            break;
+        case VLC_CODEC_WMV3:
+        case VLC_CODEC_VC1:
+            wmvtype.eFormat = OMX_VIDEO_WMVFormat9;
+            break;
+        }
+        omx_error = OMX_SetParameter(p_port->omx_handle, OMX_IndexParamVideoWmv, &wmvtype);
+        CHECK_ERROR(omx_error, "OMX_SetParameter OMX_IndexParamVideoWmv failed (%x : %s)",
+                    omx_error, ErrorToString(omx_error));
+    }
+
  error:
     return omx_error;
 }