diff options
author | Andreas Huber <andih@google.com> | 2010-08-19 09:09:12 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-19 09:09:12 -0700 |
commit | 34c9ad88d3d827cca0c7b5f2fb1b0d4a1a20a2d1 (patch) | |
tree | e004f5714ef2292cd3343c0e4f575d55939ad5d6 /media/libstagefright/rtsp/APacketSource.cpp | |
parent | cf351eeb8b6977e1130b808c6b57b8a7040c81c9 (diff) | |
parent | ef7af7fec702db2fde72b16dedf9064585e6db77 (diff) | |
download | frameworks_av-34c9ad88d3d827cca0c7b5f2fb1b0d4a1a20a2d1.zip frameworks_av-34c9ad88d3d827cca0c7b5f2fb1b0d4a1a20a2d1.tar.gz frameworks_av-34c9ad88d3d827cca0c7b5f2fb1b0d4a1a20a2d1.tar.bz2 |
Merge "Better support for rtsp streamed through VLC. Temporarily make the socket blocking to read all of the session description." into gingerbread
Diffstat (limited to 'media/libstagefright/rtsp/APacketSource.cpp')
-rw-r--r-- | media/libstagefright/rtsp/APacketSource.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/media/libstagefright/rtsp/APacketSource.cpp b/media/libstagefright/rtsp/APacketSource.cpp index 224b4bf..b2d697b 100644 --- a/media/libstagefright/rtsp/APacketSource.cpp +++ b/media/libstagefright/rtsp/APacketSource.cpp @@ -18,6 +18,8 @@ #include "ASessionDescription.h" +#include <ctype.h> + #include <media/stagefright/foundation/ABuffer.h> #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/AMessage.h> @@ -37,6 +39,10 @@ static bool GetAttribute(const char *s, const char *key, AString *value) { size_t keyLen = strlen(key); for (;;) { + while (isspace(*s)) { + ++s; + } + const char *colonPos = strchr(s, ';'); size_t len = @@ -253,7 +259,11 @@ APacketSource::APacketSource( mFormat->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC); int32_t width, height; - sessionDesc->getDimensions(index, PT, &width, &height); + if (!sessionDesc->getDimensions(index, PT, &width, &height)) { + // TODO: extract dimensions from sequence parameter set. + mInitCheck = ERROR_UNSUPPORTED; + return; + } mFormat->setInt32(kKeyWidth, width); mFormat->setInt32(kKeyHeight, height); @@ -271,7 +281,10 @@ APacketSource::APacketSource( mFormat->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_H263); int32_t width, height; - sessionDesc->getDimensions(index, PT, &width, &height); + if (!sessionDesc->getDimensions(index, PT, &width, &height)) { + mInitCheck = ERROR_UNSUPPORTED; + return; + } mFormat->setInt32(kKeyWidth, width); mFormat->setInt32(kKeyHeight, height); |