summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPatrik2 Carlsson <patrik2.carlsson@sonymobile.com>2012-08-20 09:53:09 +0200
committerZoran Jovanovic <zoran.jovanovic@sonymobile.com>2012-08-20 09:54:18 +0200
commit8033393a74a6872ad8d702b10da34d98dde0bf41 (patch)
tree3e41afb0ac096efa134f8a59911d2960a916d916 /media
parentffb829430ff20ccd6c13e6ed894f2373b2d93939 (diff)
downloadframeworks_av-8033393a74a6872ad8d702b10da34d98dde0bf41.zip
frameworks_av-8033393a74a6872ad8d702b10da34d98dde0bf41.tar.gz
frameworks_av-8033393a74a6872ad8d702b10da34d98dde0bf41.tar.bz2
h264 streaming: make profile-level-id optional
profile-level-id is made optional according to rfc3984: "If no profile-level-id is present, the Baseline Profile without additional constraints at Level 1 MUST be implied." Change-Id: If868468a48917ceccb963b8ac15767583da29723
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/rtsp/APacketSource.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/media/libstagefright/rtsp/APacketSource.cpp b/media/libstagefright/rtsp/APacketSource.cpp
index fc177d2..ddd2f06 100644
--- a/media/libstagefright/rtsp/APacketSource.cpp
+++ b/media/libstagefright/rtsp/APacketSource.cpp
@@ -110,14 +110,12 @@ static sp<ABuffer> MakeAVCCodecSpecificData(
*height = 0;
AString val;
- if (!GetAttribute(params, "profile-level-id", &val)) {
- return NULL;
+ sp<ABuffer> profileLevelID = NULL;
+ if (GetAttribute(params, "profile-level-id", &val)) {
+ profileLevelID = decodeHex(val);
+ CHECK_EQ(profileLevelID->size(), 3u);
}
- sp<ABuffer> profileLevelID = decodeHex(val);
- CHECK(profileLevelID != NULL);
- CHECK_EQ(profileLevelID->size(), 3u);
-
Vector<sp<ABuffer> > paramSets;
size_t numSeqParameterSets = 0;
@@ -176,8 +174,15 @@ static sp<ABuffer> MakeAVCCodecSpecificData(
uint8_t *out = csd->data();
*out++ = 0x01; // configurationVersion
- memcpy(out, profileLevelID->data(), 3);
- out += 3;
+ if (profileLevelID != NULL) {
+ memcpy(out, profileLevelID->data(), 3);
+ out += 3;
+ } else {
+ *out++ = 0x42; // Baseline profile
+ *out++ = 0xE0; // Common subset for all profiles
+ *out++ = 0x0A; // Level 1
+ }
+
*out++ = (0x3f << 2) | 1; // lengthSize == 2 bytes
*out++ = 0xe0 | numSeqParameterSets;