summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-03-01 11:41:29 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-01 11:41:29 -0800
commit59e7879a8482284a434268d51b4b438f0625d1be (patch)
tree8538fc40ac0fbea7a45b8db3e90c005adc8f077c /media
parente13e24b6e8a7c2d0244ba575e309fb1254119a82 (diff)
parent3c14b9745c4afc88cec247d9dd0b003e087cbb52 (diff)
downloadframeworks_av-59e7879a8482284a434268d51b4b438f0625d1be.zip
frameworks_av-59e7879a8482284a434268d51b4b438f0625d1be.tar.gz
frameworks_av-59e7879a8482284a434268d51b4b438f0625d1be.tar.bz2
Merge "Stagefright: Query buffer usage from the component."
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/ACodec.cpp11
-rw-r--r--media/libstagefright/OMXCodec.cpp11
2 files changed, 18 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 2bbb320..e43cdaa 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -440,10 +440,17 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
}
// Set up the native window.
- // XXX TODO: Get the gralloc usage flags from the OMX plugin!
+ OMX_U32 usage = 0;
+ err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
+ if (err != 0) {
+ LOGW("querying usage flags from OMX IL component failed: %d", err);
+ // XXX: Currently this error is logged, but not fatal.
+ usage = 0;
+ }
+
err = native_window_set_usage(
mNativeWindow.get(),
- GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+ usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
if (err != 0) {
LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 00b1310..5f40893 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1753,9 +1753,16 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
}
// Set up the native window.
- // XXX TODO: Get the gralloc usage flags from the OMX plugin!
+ OMX_U32 usage = 0;
+ err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
+ if (err != 0) {
+ LOGW("querying usage flags from OMX IL component failed: %d", err);
+ // XXX: Currently this error is logged, but not fatal.
+ usage = 0;
+ }
+
err = native_window_set_usage(
- mNativeWindow.get(), GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+ mNativeWindow.get(), usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
if (err != 0) {
LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
return err;