summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-08-21 10:16:08 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-21 10:16:08 -0700
commit562d654876c6134b1e879f56f72635dabc5535f2 (patch)
treea2554ee8517bc372c6715374524a2918391170d6
parent391348890849f99663dd46c475a1fc0737d6908d (diff)
parent8a825ec079da6f2b89149c53568cb9721c10d923 (diff)
downloadframeworks_av-562d654876c6134b1e879f56f72635dabc5535f2.zip
frameworks_av-562d654876c6134b1e879f56f72635dabc5535f2.tar.gz
frameworks_av-562d654876c6134b1e879f56f72635dabc5535f2.tar.bz2
am 8a825ec0: am aa411adf: Merge "h264 streaming: make profile-level-id optional"
* commit '8a825ec079da6f2b89149c53568cb9721c10d923': h264 streaming: make profile-level-id optional
-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;