setVideoSurfaceTexture is now synchronous and applied dynamically

while playing.

Change-Id: If9f08659a01bdc7dac0999730368e9dfa5e58d36
related-to-bug: 5666482
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 6e174e0..ca87be9 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -42,7 +42,9 @@
 
     void setDataSource(int fd, int64_t offset, int64_t length);
 
-    void setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
+    void setVideoSurfaceTextureAsync(
+            const sp<ISurfaceTexture> &surfaceTexture);
+
     void setAudioSink(const sp<MediaPlayerBase::AudioSink> &sink);
     void start();
 
@@ -75,6 +77,7 @@
     struct StreamingSource;
     struct Action;
     struct SeekAction;
+    struct SetSurfaceAction;
     struct SimpleAction;
 
     enum {
@@ -140,6 +143,8 @@
 
     int32_t mVideoScalingMode;
 
+    bool mStarted;
+
     status_t instantiateDecoder(bool audio, sp<Decoder> *decoder);
 
     status_t feedDecoderInputData(bool audio, const sp<AMessage> &msg);
@@ -165,6 +170,7 @@
     void performDecoderShutdown();
     void performReset();
     void performScanSources();
+    void performSetSurface(const sp<NativeWindowWrapper> &wrapper);
 
     DISALLOW_EVIL_CONSTRUCTORS(NuPlayer);
 };