diff options
author | Andreas Huber <andih@google.com> | 2010-08-04 14:04:31 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-08-04 14:04:31 -0700 |
commit | 33a8457868eb00b94b37b53321a80d9307202a9d (patch) | |
tree | 14b61a611704672d721ad6da2834a9006862a679 /media/libstagefright/rtsp | |
parent | 39ddf8e0f18766f7ba1e3246b774aa6ebd93eea8 (diff) | |
download | frameworks_av-33a8457868eb00b94b37b53321a80d9307202a9d.zip frameworks_av-33a8457868eb00b94b37b53321a80d9307202a9d.tar.gz frameworks_av-33a8457868eb00b94b37b53321a80d9307202a9d.tar.bz2 |
Specification of codec specific data as part of the session description is now optional.
Change-Id: Ie1953909e1d241381add3cc82a7a1f7d7d1540f2
Diffstat (limited to 'media/libstagefright/rtsp')
-rw-r--r-- | media/libstagefright/rtsp/APacketSource.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/media/libstagefright/rtsp/APacketSource.cpp b/media/libstagefright/rtsp/APacketSource.cpp index 88336ba..a577704 100644 --- a/media/libstagefright/rtsp/APacketSource.cpp +++ b/media/libstagefright/rtsp/APacketSource.cpp @@ -92,7 +92,9 @@ static sp<ABuffer> decodeHex(const AString &s) { static sp<ABuffer> MakeAVCCodecSpecificData(const char *params) { AString val; - CHECK(GetAttribute(params, "profile-level-id", &val)); + if (!GetAttribute(params, "profile-level-id", &val)) { + return NULL; + } sp<ABuffer> profileLevelID = decodeHex(val); CHECK(profileLevelID != NULL); @@ -105,7 +107,10 @@ static sp<ABuffer> MakeAVCCodecSpecificData(const char *params) { size_t numPicParameterSets = 0; size_t totalPicParameterSetSize = 0; - CHECK(GetAttribute(params, "sprop-parameter-sets", &val)); + if (!GetAttribute(params, "sprop-parameter-sets", &val)) { + return NULL; + } + size_t start = 0; for (;;) { ssize_t commaPos = val.find(",", start); @@ -256,9 +261,11 @@ APacketSource::APacketSource( sp<ABuffer> codecSpecificData = MakeAVCCodecSpecificData(params.c_str()); - mFormat->setData( - kKeyAVCC, 0, - codecSpecificData->data(), codecSpecificData->size()); + if (codecSpecificData != NULL) { + mFormat->setData( + kKeyAVCC, 0, + codecSpecificData->data(), codecSpecificData->size()); + } } else if (!strncmp(desc.c_str(), "H263-2000/", 10) || !strncmp(desc.c_str(), "H263-1998/", 10)) { mFormat->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_H263); |