summaryrefslogtreecommitdiff
path: root/omx
diff options
context:
space:
mode:
authorBenny Wong <Benny.Wong@motorola.com>2009-09-16 23:40:46 -0500
committerJames Dong <jdong@google.com>2009-09-17 08:16:36 -0700
commit005fc7a19a00f4170cbe0a8e3c3fa8b147f45a89 (patch)
treeef4f655ab7d01eeb9819728bed93a01f23a5fcd9 /omx
parentc024b9e6872263b80017da0d169e9fbd790b2051 (diff)
downloadomap3-005fc7a19a00f4170cbe0a8e3c3fa8b147f45a89.tar.gz
Added a profile check for profile in H264 to accept baseline profile clips
Originally from: https://partner.source.android.com/g/#change,1076
Diffstat (limited to 'omx')
-rw-r--r--omx/ti_omx_config_parser/inc/ti_m4v_config_parser.h5
-rw-r--r--omx/ti_omx_config_parser/src/ti_m4v_config_parser.cpp3
-rw-r--r--omx/ti_omx_config_parser/src/ti_omx_config_parser.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/omx/ti_omx_config_parser/inc/ti_m4v_config_parser.h b/omx/ti_omx_config_parser/inc/ti_m4v_config_parser.h
index 2aac976..a8ec2b2 100644
--- a/omx/ti_omx_config_parser/inc/ti_m4v_config_parser.h
+++ b/omx/ti_omx_config_parser/inc/ti_m4v_config_parser.h
@@ -47,6 +47,11 @@
#define SHORT_VIDEO_START_MARKER 0x20
#define SHORT_VIDEO_START_MARKER_LENGTH 22
+/*Some H264 profiles*/
+#define H264_PROFILE_IDC_BASELINE 66
+#define H264_PROFILE_IDC_MAIN 77
+#define H264_PROFILE_IDC_EXTENDED 88
+
typedef struct
{
uint8 *data;
diff --git a/omx/ti_omx_config_parser/src/ti_m4v_config_parser.cpp b/omx/ti_omx_config_parser/src/ti_m4v_config_parser.cpp
index 4250003..5d6225c 100644
--- a/omx/ti_omx_config_parser/src/ti_m4v_config_parser.cpp
+++ b/omx/ti_omx_config_parser/src/ti_m4v_config_parser.cpp
@@ -928,6 +928,9 @@ int16 DecodeSPS(mp4StreamType *psBits, int32 *width, int32 *height, int32 *displ
*profile_idc = temp;
+ if(*profile_idc != H264_PROFILE_IDC_BASELINE)
+ return MP4_INVALID_VOL_PARAM;
+
ReadBits(psBits, 1, &temp);
ReadBits(psBits, 1, &temp);
ReadBits(psBits, 1, &temp);
diff --git a/omx/ti_omx_config_parser/src/ti_omx_config_parser.cpp b/omx/ti_omx_config_parser/src/ti_omx_config_parser.cpp
index 5dd5717..c044e45 100644
--- a/omx/ti_omx_config_parser/src/ti_omx_config_parser.cpp
+++ b/omx/ti_omx_config_parser/src/ti_omx_config_parser.cpp
@@ -150,7 +150,7 @@ OSCL_EXPORT_REF OMX_BOOL TIOMXConfigParser(
return OMX_FALSE;
}
- if (0 == oscl_strcmp(pInputs->cComponentRole, (OMX_STRING)"video_decoder.mpeg4"))
+ if ((aInputs.iMimeType == PVMF_MIME_M4V) || (aInputs.iMimeType == PVMF_MIME_H264_VIDEO))
{
Status = ti_video_config_parser((tiVideoConfigParserInputs *)&aInputs, (tiVideoConfigParserOutputs *)aOutputParameters);
}