[vlc-devel] [PATCH 3/4] omxil: Set the WMV type

Martin Storsjö martin at martin.st
Wed Sep 19 11:54:44 CEST 2012


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).
---
 modules/codec/omxil/omxil.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index a0f423d..002adc2 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -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;
 }
-- 
1.7.10




More information about the vlc-devel mailing list