[vlc-commits] omxil: Set the WMV type

Martin Storsjö git at videolan.org
Wed Sep 19 14:49:00 CEST 2012


vlc | branch: master | Martin Storsjö <martin at martin.st> | Wed Sep 19 12:54:44 2012 +0300| [c73e88ce9a79f1b76e7e6a9ec1cf5781555994a5] | committer: Jean-Baptiste Kempf

omxil: Set the WMV type

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 at videolan.org>

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

 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;
 }



More information about the vlc-commits mailing list