diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/codec.cpp | 5 | ||||
-rw-r--r-- | cmds/stagefright/sf2.cpp | 14 |
2 files changed, 8 insertions, 11 deletions
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp index ad246d2..1b01bd6 100644 --- a/cmds/stagefright/codec.cpp +++ b/cmds/stagefright/codec.cpp @@ -107,9 +107,8 @@ static int decode( CHECK_EQ(err, (status_t)OK); size_t j = 0; - sp<RefBase> obj; - while (format->findObject(StringPrintf("csd-%d", j).c_str(), &obj)) { - sp<ABuffer> buffer = static_cast<ABuffer *>(obj.get()); + sp<ABuffer> buffer; + while (format->findBuffer(StringPrintf("csd-%d", j).c_str(), &buffer)) { state->mCSD.push_back(buffer); ++j; diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp index 18e2532..6f0fb54 100644 --- a/cmds/stagefright/sf2.cpp +++ b/cmds/stagefright/sf2.cpp @@ -358,7 +358,7 @@ private: buffer->meta()->setInt32("csd", true); mCSD.push(buffer); - msg->setObject("csd", buffer); + msg->setBuffer("csd", buffer); } else if (meta->findData(kKeyESDS, &type, &data, &size)) { ESDS esds((const char *)data, size); CHECK_EQ(esds.InitCheck(), (status_t)OK); @@ -408,9 +408,8 @@ private: return; } - sp<RefBase> obj; - CHECK(msg->findObject("buffer", &obj)); - sp<ABuffer> outBuffer = static_cast<ABuffer *>(obj.get()); + sp<ABuffer> outBuffer; + CHECK(msg->findBuffer("buffer", &outBuffer)); if (mCSDIndex < mCSD.size()) { outBuffer = mCSD.editItemAt(mCSDIndex++); @@ -509,15 +508,14 @@ private: } } - reply->setObject("buffer", outBuffer); + reply->setBuffer("buffer", outBuffer); reply->post(); } void onDrainThisBuffer(const sp<AMessage> &msg) { - sp<RefBase> obj; - CHECK(msg->findObject("buffer", &obj)); + sp<ABuffer> buffer; + CHECK(msg->findBuffer("buffer", &buffer)); - sp<ABuffer> buffer = static_cast<ABuffer *>(obj.get()); mTotalBytesReceived += buffer->size(); sp<AMessage> reply; |