diff options
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/stagefright/SimplePlayer.cpp | 14 | ||||
| -rw-r--r-- | cmds/stagefright/SimplePlayer.h | 4 | ||||
| -rw-r--r-- | cmds/stagefright/sf2.cpp | 5 | 
3 files changed, 9 insertions, 14 deletions
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 <media/stagefright/foundation/AMessage.h>  #include <media/stagefright/MediaCodec.h>  #include <media/stagefright/MediaErrors.h> -#include <media/stagefright/NativeWindowWrapper.h>  #include <media/stagefright/NuMediaExtractor.h>  namespace android { @@ -74,8 +73,7 @@ status_t SimplePlayer::setSurface(const sp<IGraphicBufferProducer> &bufferProduc          surface = new Surface(bufferProducer);      } -    msg->setObject( -            "native-window", new NativeWindowWrapper(surface)); +    msg->setObject("surface", surface);      sp<AMessage> response;      return PostAndAwaitResponse(msg, &response); @@ -133,10 +131,8 @@ void SimplePlayer::onMessageReceived(const sp<AMessage> &msg) {                  err = INVALID_OPERATION;              } else {                  sp<RefBase> obj; -                CHECK(msg->findObject("native-window", &obj)); - -                mNativeWindow = static_cast<NativeWindowWrapper *>(obj.get()); - +                CHECK(msg->findObject("surface", &obj)); +                mSurface = static_cast<Surface *>(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<NativeWindowWrapper> mNativeWindow; +    sp<Surface> mSurface;      sp<NuMediaExtractor> mExtractor;      sp<ALooper> 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 <media/stagefright/MediaExtractor.h>  #include <media/stagefright/MediaSource.h>  #include <media/stagefright/MetaData.h> -#include <media/stagefright/NativeWindowWrapper.h>  #include <media/stagefright/Utils.h>  #include <gui/SurfaceComposerClient.h> +#include <gui/Surface.h>  #include "include/ESDS.h" @@ -154,8 +154,7 @@ protected:                  sp<AMessage> format = makeFormat(mSource->getFormat());                  if (mSurface != NULL) { -                    format->setObject( -                            "native-window", new NativeWindowWrapper(mSurface)); +                    format->setObject("surface", mSurface);                  }                  mCodec->initiateSetup(format);  | 
