summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/AAMRAssembler.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-12-09 15:09:56 -0800
committerAndreas Huber <andih@google.com>2011-12-09 15:09:56 -0800
commit4aae77cbe1bf4369910314a55c2bc2349af10d3c (patch)
treebefe62758daa28bdef02b1e687a38f545c862eaf /media/libstagefright/rtsp/AAMRAssembler.cpp
parenteebeceec684a36222b4559e3157b0db04c0a67ed (diff)
downloadframeworks_av-4aae77cbe1bf4369910314a55c2bc2349af10d3c.zip
frameworks_av-4aae77cbe1bf4369910314a55c2bc2349af10d3c.tar.gz
frameworks_av-4aae77cbe1bf4369910314a55c2bc2349af10d3c.tar.bz2
Support for parsing of "folded" RTSP header values and some tweaks to the AMR assembler
contributed by Samsung (untested). Change-Id: I182561fe0a1a564126bdbb317e96aa52bf525726
Diffstat (limited to 'media/libstagefright/rtsp/AAMRAssembler.cpp')
-rw-r--r--media/libstagefright/rtsp/AAMRAssembler.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libstagefright/rtsp/AAMRAssembler.cpp b/media/libstagefright/rtsp/AAMRAssembler.cpp
index 547b202..9d72b1f 100644
--- a/media/libstagefright/rtsp/AAMRAssembler.cpp
+++ b/media/libstagefright/rtsp/AAMRAssembler.cpp
@@ -79,13 +79,17 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::assembleMore(
}
static size_t getFrameSize(bool isWide, unsigned FT) {
- static const size_t kFrameSizeNB[8] = {
- 95, 103, 118, 134, 148, 159, 204, 244
+ static const size_t kFrameSizeNB[9] = {
+ 95, 103, 118, 134, 148, 159, 204, 244, 39
};
- static const size_t kFrameSizeWB[9] = {
- 132, 177, 253, 285, 317, 365, 397, 461, 477
+ static const size_t kFrameSizeWB[10] = {
+ 132, 177, 253, 285, 317, 365, 397, 461, 477, 40
};
+ if (FT == 15) {
+ return 1;
+ }
+
size_t frameSize = isWide ? kFrameSizeWB[FT] : kFrameSizeNB[FT];
// Round up bits to bytes and add 1 for the header byte.
@@ -161,8 +165,8 @@ ARTPAssembler::AssemblyStatus AAMRAssembler::addPacket(
unsigned FT = (toc >> 3) & 0x0f;
if ((toc & 3) != 0
- || (mIsWide && FT > 8)
- || (!mIsWide && FT > 7)) {
+ || (mIsWide && FT > 9 && FT != 15)
+ || (!mIsWide && FT > 8 && FT != 15)) {
queue->erase(queue->begin());
++mNextExpectedSeqNo;