[vlc-commits] OMX: Don't use hardcoded profile numbers

Jean-Baptiste Kempf git at videolan.org
Wed Feb 4 11:12:09 CET 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb  4 11:05:44 2015 +0100| [07461467f965bf926c14f2d4a4096b84db7fe44e] | committer: Jean-Baptiste Kempf

OMX: Don't use hardcoded profile numbers

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

 modules/codec/omxil/omxil.c |    2 +-
 modules/codec/omxil/utils.c |   15 ++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 9bdedc5..06244bc 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -190,7 +190,7 @@ static OMX_ERRORTYPE ImplementationSpecificWorkarounds(decoder_t *p_dec,
     {
         if(p_fmt->i_cat == VIDEO_ES && def->eDir == OMX_DirInput &&
            p_fmt->i_codec == VLC_CODEC_H264 &&
-           (i_profile != 66 || i_level > 30))
+           (i_profile != PROFILE_H264_BASELINE || i_level > 30))
         {
             msg_Dbg(p_dec, "h264 profile/level not supported (0x%x, 0x%x)",
                     i_profile, i_level);
diff --git a/modules/codec/omxil/utils.c b/modules/codec/omxil/utils.c
index 7f20c58..3f9501d 100644
--- a/modules/codec/omxil/utils.c
+++ b/modules/codec/omxil/utils.c
@@ -37,6 +37,7 @@
 #include "omxil.h"
 #include "qcom.h"
 #include "../../video_chroma/copy.h"
+#include "../h264_nal.h"
 
 /*****************************************************************************
  * Events utility functions
@@ -1053,13 +1054,13 @@ static const struct
     size_t                   profile_idc;
 } omx_to_profile_idc[] =
 {
-    { OMX_VIDEO_AVCProfileBaseline,  66 },
-    { OMX_VIDEO_AVCProfileMain,      77 },
-    { OMX_VIDEO_AVCProfileExtended,  88 },
-    { OMX_VIDEO_AVCProfileHigh,     100 },
-    { OMX_VIDEO_AVCProfileHigh10,   110 },
-    { OMX_VIDEO_AVCProfileHigh422,  122 },
-    { OMX_VIDEO_AVCProfileHigh444,  244 },
+    { OMX_VIDEO_AVCProfileBaseline,  PROFILE_H264_BASELINE },
+    { OMX_VIDEO_AVCProfileMain,      PROFILE_H264_MAIN },
+    { OMX_VIDEO_AVCProfileExtended,  PROFILE_H264_EXTENDED },
+    { OMX_VIDEO_AVCProfileHigh,      PROFILE_H264_HIGH },
+    { OMX_VIDEO_AVCProfileHigh10,    PROFILE_H264_HIGH_10 },
+    { OMX_VIDEO_AVCProfileHigh422,   PROFILE_H264_HIGH_422 },
+    { OMX_VIDEO_AVCProfileHigh444,   PROFILE_H264_HIGH_444 },
 };
 
 size_t convert_omx_to_profile_idc(OMX_VIDEO_AVCPROFILETYPE profile_type)



More information about the vlc-commits mailing list