summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ARTPConnection.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-02-21 14:38:23 -0800
committerAndreas Huber <andih@google.com>2012-02-22 16:20:59 -0800
commit2d8bedd05437b6fccdbc6bf70f673ffd86744d59 (patch)
tree1a11658a7379249eb4f6bd73b356baa4a661f41e /media/libstagefright/rtsp/ARTPConnection.cpp
parent79af02c6a813b5d31fba3e7b72686a02f0ae7e0f (diff)
downloadframeworks_av-2d8bedd05437b6fccdbc6bf70f673ffd86744d59.zip
frameworks_av-2d8bedd05437b6fccdbc6bf70f673ffd86744d59.tar.gz
frameworks_av-2d8bedd05437b6fccdbc6bf70f673ffd86744d59.tar.bz2
Add new APIs AMessage::(set|find)Buffer to make it safer to pass
ABuffer objects through messages. Change-Id: I9f8b4e4c4767d0d70a0105e0c0813b754379b49d
Diffstat (limited to 'media/libstagefright/rtsp/ARTPConnection.cpp')
-rw-r--r--media/libstagefright/rtsp/ARTPConnection.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index 8c9dd8d..44988a3 100644
--- a/media/libstagefright/rtsp/ARTPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTPConnection.cpp
@@ -639,7 +639,7 @@ sp<ARTPSource> ARTPConnection::findSource(StreamInfo *info, uint32_t srcId) {
void ARTPConnection::injectPacket(int index, const sp<ABuffer> &buffer) {
sp<AMessage> msg = new AMessage(kWhatInjectPacket, id());
msg->setInt32("index", index);
- msg->setObject("buffer", buffer);
+ msg->setBuffer("buffer", buffer);
msg->post();
}
@@ -647,10 +647,8 @@ void ARTPConnection::onInjectPacket(const sp<AMessage> &msg) {
int32_t index;
CHECK(msg->findInt32("index", &index));
- sp<RefBase> obj;
- CHECK(msg->findObject("buffer", &obj));
-
- sp<ABuffer> buffer = static_cast<ABuffer *>(obj.get());
+ sp<ABuffer> buffer;
+ CHECK(msg->findBuffer("buffer", &buffer));
List<StreamInfo>::iterator it = mStreams.begin();
while (it != mStreams.end()