From 1de1e25cba872bd4c077c2e394f8ca9c70b65856 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Thu, 30 Apr 2015 18:18:34 -0700 Subject: stagefright: remove NativeWindowWrapper Now that Surface and SurfaceTextureClient are the same and Surface, it does not add value. Bug: 19489395 Change-Id: I016ecd1cf5cc51ce6244b6fa34ecd75f84e3db01 --- cmds/stagefright/SimplePlayer.cpp | 14 +++++--------- cmds/stagefright/SimplePlayer.h | 4 ++-- cmds/stagefright/sf2.cpp | 5 ++--- 3 files changed, 9 insertions(+), 14 deletions(-) (limited to 'cmds') diff --git a/cmds/stagefright/SimplePlayer.cpp b/cmds/stagefright/SimplePlayer.cpp index bd33d86..50913cd 100644 --- a/cmds/stagefright/SimplePlayer.cpp +++ b/cmds/stagefright/SimplePlayer.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include namespace android { @@ -74,8 +73,7 @@ status_t SimplePlayer::setSurface(const sp &bufferProduc surface = new Surface(bufferProducer); } - msg->setObject( - "native-window", new NativeWindowWrapper(surface)); + msg->setObject("surface", surface); sp response; return PostAndAwaitResponse(msg, &response); @@ -133,10 +131,8 @@ void SimplePlayer::onMessageReceived(const sp &msg) { err = INVALID_OPERATION; } else { sp obj; - CHECK(msg->findObject("native-window", &obj)); - - mNativeWindow = static_cast(obj.get()); - + CHECK(msg->findObject("surface", &obj)); + mSurface = static_cast(obj.get()); err = OK; } @@ -325,7 +321,7 @@ status_t SimplePlayer::onPrepare() { err = state->mCodec->configure( format, - isVideo ? mNativeWindow->getSurfaceTextureClient() : NULL, + isVideo ? mSurface : NULL, NULL /* crypto */, 0 /* flags */); @@ -412,7 +408,7 @@ status_t SimplePlayer::onReset() { mStateByTrackIndex.clear(); mCodecLooper.clear(); mExtractor.clear(); - mNativeWindow.clear(); + mSurface.clear(); mPath.clear(); return OK; diff --git a/cmds/stagefright/SimplePlayer.h b/cmds/stagefright/SimplePlayer.h index ce993e8..ae9dfd2 100644 --- a/cmds/stagefright/SimplePlayer.h +++ b/cmds/stagefright/SimplePlayer.h @@ -25,8 +25,8 @@ struct ALooper; struct AudioTrack; class IGraphicBufferProducer; struct MediaCodec; -struct NativeWindowWrapper; struct NuMediaExtractor; +class Surface; struct SimplePlayer : public AHandler { SimplePlayer(); @@ -84,7 +84,7 @@ private: State mState; AString mPath; - sp mNativeWindow; + sp mSurface; sp mExtractor; sp mCodecLooper; diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp index 891d84b..0d64d2f 100644 --- a/cmds/stagefright/sf2.cpp +++ b/cmds/stagefright/sf2.cpp @@ -38,10 +38,10 @@ #include #include #include -#include #include #include +#include #include "include/ESDS.h" @@ -154,8 +154,7 @@ protected: sp format = makeFormat(mSource->getFormat()); if (mSurface != NULL) { - format->setObject( - "native-window", new NativeWindowWrapper(mSurface)); + format->setObject("surface", mSurface); } mCodec->initiateSetup(format); -- cgit v1.1