summaryrefslogtreecommitdiffstats
path: root/cmds/stagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-09-15 12:42:32 -0700
committerAndreas Huber <andih@google.com>2011-09-20 10:37:18 -0700
commitc5a9766dc3cb0cab0c30528ffdb7bce6dfde1848 (patch)
tree682830f4791285bb2190ad6f9ff11a166c4629e0 /cmds/stagefright
parent291c6d789dac8f85c50163e9a9ef24ef31183b93 (diff)
downloadframeworks_base-c5a9766dc3cb0cab0c30528ffdb7bce6dfde1848.zip
frameworks_base-c5a9766dc3cb0cab0c30528ffdb7bce6dfde1848.tar.gz
frameworks_base-c5a9766dc3cb0cab0c30528ffdb7bce6dfde1848.tar.bz2
Properly connect to surface flinger in our shell tools
Also raise the layer to INT_MAX to float in front of the toolbar. Change-Id: I045a1c83924e6655f1734d15f2504b90312eec64
Diffstat (limited to 'cmds/stagefright')
-rw-r--r--cmds/stagefright/sf2.cpp10
-rw-r--r--cmds/stagefright/stagefright.cpp10
-rw-r--r--cmds/stagefright/stream.cpp2
3 files changed, 19 insertions, 3 deletions
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 6fa66cf..263ecd1 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -569,12 +569,16 @@ int main(int argc, char **argv) {
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
surface = control->getSurface();
CHECK(surface != NULL);
+
+ CHECK_EQ((status_t)OK,
+ native_window_api_connect(
+ surface.get(), NATIVE_WINDOW_API_MEDIA));
}
sp<Controller> controller =
@@ -589,6 +593,10 @@ int main(int argc, char **argv) {
looper->unregisterHandler(controller->id());
if (!decodeAudio && useSurface) {
+ CHECK_EQ((status_t)OK,
+ native_window_api_disconnect(
+ surface.get(), NATIVE_WINDOW_API_MEDIA));
+
composerClient->dispose();
}
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 34f0a64..2e0aa9b 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -874,7 +874,7 @@ int main(int argc, char **argv) {
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();
@@ -886,6 +886,10 @@ int main(int argc, char **argv) {
sp<SurfaceTexture> texture = new SurfaceTexture(0 /* tex */);
gSurface = new SurfaceTextureClient(texture);
}
+
+ CHECK_EQ((status_t)OK,
+ native_window_api_connect(
+ gSurface.get(), NATIVE_WINDOW_API_MEDIA));
}
DataSource::RegisterDefaultSniffers();
@@ -1077,6 +1081,10 @@ int main(int argc, char **argv) {
}
if ((useSurfaceAlloc || useSurfaceTexAlloc) && !audioOnly) {
+ CHECK_EQ((status_t)OK,
+ native_window_api_disconnect(
+ gSurface.get(), NATIVE_WINDOW_API_MEDIA));
+
gSurface.clear();
if (useSurfaceAlloc) {
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index b13236a..2378345 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction();
- CHECK_EQ(control->setLayer(30000), (status_t)OK);
+ CHECK_EQ(control->setLayer(INT_MAX), (status_t)OK);
CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction();