summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/omx')
-rw-r--r--media/libstagefright/omx/OMX.cpp8
-rw-r--r--media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp12
-rw-r--r--media/libstagefright/omx/tests/OMXHarness.cpp23
3 files changed, 10 insertions, 33 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 6d46eee..f8d38ff 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -245,8 +245,8 @@ status_t OMX::allocateNode(
instance->setHandle(*node, handle);
- mLiveNodes.add(observer->asBinder(), instance);
- observer->asBinder()->linkToDeath(this);
+ mLiveNodes.add(IInterface::asBinder(observer), instance);
+ IInterface::asBinder(observer)->linkToDeath(this);
return OK;
}
@@ -256,7 +256,7 @@ status_t OMX::freeNode(node_id node) {
{
Mutex::Autolock autoLock(mLock);
- ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder());
+ ssize_t index = mLiveNodes.indexOfKey(IInterface::asBinder(instance->observer()));
if (index < 0) {
// This could conceivably happen if the observer dies at roughly the
// same time that a client attempts to free the node explicitly.
@@ -265,7 +265,7 @@ status_t OMX::freeNode(node_id node) {
mLiveNodes.removeItemsAt(index);
}
- instance->observer()->asBinder()->unlinkToDeath(this);
+ IInterface::asBinder(instance->observer())->unlinkToDeath(this);
status_t err = instance->freeNode(mMaster);
diff --git a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
index 8bff142..70ec6e4 100644
--- a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
+++ b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
@@ -195,12 +195,12 @@ const uint8_t *SoftVideoEncoderOMXComponent::extractGraphicBuffer(
size_t srcStride;
size_t srcVStride;
if (usingGraphicBuffer) {
- if (srcSize < 4 + sizeof(GraphicBuffer *)) {
- ALOGE("Metadata is too small (%zu vs %zu)", srcSize, 4 + sizeof(GraphicBuffer *));
+ if (srcSize < sizeof(OMX_U32) + sizeof(GraphicBuffer *)) {
+ ALOGE("Metadata is too small (%zu vs %zu)", srcSize, sizeof(OMX_U32) + sizeof(GraphicBuffer *));
return NULL;
}
- GraphicBuffer *buffer = *(GraphicBuffer **)(src + 4);
+ GraphicBuffer *buffer = *(GraphicBuffer **)(src + sizeof(OMX_U32));
handle = buffer->handle;
format = buffer->format;
srcStride = buffer->stride;
@@ -214,12 +214,12 @@ const uint8_t *SoftVideoEncoderOMXComponent::extractGraphicBuffer(
} else {
// TODO: remove this part. Check if anyone uses this.
- if (srcSize < 4 + sizeof(buffer_handle_t)) {
- ALOGE("Metadata is too small (%zu vs %zu)", srcSize, 4 + sizeof(buffer_handle_t));
+ if (srcSize < sizeof(OMX_U32) + sizeof(buffer_handle_t)) {
+ ALOGE("Metadata is too small (%zu vs %zu)", srcSize, sizeof(OMX_U32) + sizeof(buffer_handle_t));
return NULL;
}
- handle = *(buffer_handle_t *)(src + 4);
+ handle = *(buffer_handle_t *)(src + sizeof(OMX_U32));
// assume HAL_PIXEL_FORMAT_RGBA_8888
// there is no way to get the src stride without the graphic buffer
format = HAL_PIXEL_FORMAT_RGBA_8888;
diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp
index f4dfd6b..67ff145 100644
--- a/media/libstagefright/omx/tests/OMXHarness.cpp
+++ b/media/libstagefright/omx/tests/OMXHarness.cpp
@@ -253,29 +253,6 @@ static sp<MediaExtractor> CreateExtractorFromURI(const char *uri) {
return MediaExtractor::Create(source);
}
-static sp<MediaSource> MakeSource(
- const char *uri,
- const char *mimeType) {
- sp<MediaExtractor> extractor = CreateExtractorFromURI(uri);
-
- if (extractor == NULL) {
- return NULL;
- }
-
- for (size_t i = 0; i < extractor->countTracks(); ++i) {
- sp<MetaData> meta = extractor->getTrackMetaData(i);
-
- const char *trackMIME;
- CHECK(meta->findCString(kKeyMIMEType, &trackMIME));
-
- if (!strcasecmp(trackMIME, mimeType)) {
- return extractor->getTrack(i);
- }
- }
-
- return NULL;
-}
-
status_t Harness::testStateTransitions(
const char *componentName, const char *componentRole) {
if (strncmp(componentName, "OMX.", 4)) {