Merge "Properly connect to surface flinger in our shell tools"

This commit is contained in:
Andreas Huber
2011-09-26 11:26:59 -07:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 3 deletions

View File

@@ -569,12 +569,16 @@ int main(int argc, char **argv) {
CHECK(control->isValid()); CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction(); 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); CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction(); SurfaceComposerClient::closeGlobalTransaction();
surface = control->getSurface(); surface = control->getSurface();
CHECK(surface != NULL); CHECK(surface != NULL);
CHECK_EQ((status_t)OK,
native_window_api_connect(
surface.get(), NATIVE_WINDOW_API_MEDIA));
} }
sp<Controller> controller = sp<Controller> controller =
@@ -589,6 +593,10 @@ int main(int argc, char **argv) {
looper->unregisterHandler(controller->id()); looper->unregisterHandler(controller->id());
if (!decodeAudio && useSurface) { if (!decodeAudio && useSurface) {
CHECK_EQ((status_t)OK,
native_window_api_disconnect(
surface.get(), NATIVE_WINDOW_API_MEDIA));
composerClient->dispose(); composerClient->dispose();
} }

View File

@@ -917,7 +917,7 @@ int main(int argc, char **argv) {
CHECK(control->isValid()); CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction(); 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); CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction(); SurfaceComposerClient::closeGlobalTransaction();
@@ -929,6 +929,10 @@ int main(int argc, char **argv) {
sp<SurfaceTexture> texture = new SurfaceTexture(0 /* tex */); sp<SurfaceTexture> texture = new SurfaceTexture(0 /* tex */);
gSurface = new SurfaceTextureClient(texture); gSurface = new SurfaceTextureClient(texture);
} }
CHECK_EQ((status_t)OK,
native_window_api_connect(
gSurface.get(), NATIVE_WINDOW_API_MEDIA));
} }
DataSource::RegisterDefaultSniffers(); DataSource::RegisterDefaultSniffers();
@@ -1122,6 +1126,10 @@ int main(int argc, char **argv) {
} }
if ((useSurfaceAlloc || useSurfaceTexAlloc) && !audioOnly) { if ((useSurfaceAlloc || useSurfaceTexAlloc) && !audioOnly) {
CHECK_EQ((status_t)OK,
native_window_api_disconnect(
gSurface.get(), NATIVE_WINDOW_API_MEDIA));
gSurface.clear(); gSurface.clear();
if (useSurfaceAlloc) { if (useSurfaceAlloc) {

View File

@@ -323,7 +323,7 @@ int main(int argc, char **argv) {
CHECK(control->isValid()); CHECK(control->isValid());
SurfaceComposerClient::openGlobalTransaction(); 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); CHECK_EQ(control->show(), (status_t)OK);
SurfaceComposerClient::closeGlobalTransaction(); SurfaceComposerClient::closeGlobalTransaction();