MediaPlayer2: use ANativeWindow to replace Surface and IGraphicBufferProducer

Test: MediaPlayer2 plays video files
Bug: 63934228
Change-Id: Id655aa19125cfc5554dbf36c223d0a27318ebb24
diff --git a/media/libmedia/nuplayer2/NuPlayer2.h b/media/libmedia/nuplayer2/NuPlayer2.h
index 6dc6442..638b259 100644
--- a/media/libmedia/nuplayer2/NuPlayer2.h
+++ b/media/libmedia/nuplayer2/NuPlayer2.h
@@ -27,6 +27,7 @@
 struct ABuffer;
 struct AMediaCryptoWrapper;
 struct AMessage;
+struct ANativeWindowWrapper;
 struct AudioPlaybackRate;
 struct AVSyncSettings;
 class IDataSource;
@@ -58,8 +59,7 @@
 
     void prepareAsync();
 
-    void setVideoSurfaceTextureAsync(
-            const sp<IGraphicBufferProducer> &bufferProducer);
+    void setVideoSurfaceTextureAsync(const sp<ANativeWindowWrapper> &nww);
 
     void setAudioSink(const sp<MediaPlayer2Base::AudioSink> &sink);
     status_t setPlaybackSettings(const AudioPlaybackRate &rate);
@@ -167,7 +167,7 @@
     Mutex mSourceLock;  // guard |mSource|.
     sp<Source> mSource;
     uint32_t mSourceFlags;
-    sp<Surface> mSurface;
+    sp<ANativeWindowWrapper> mNativeWindow;
     sp<MediaPlayer2Base::AudioSink> mAudioSink;
     sp<DecoderBase> mVideoDecoder;
     bool mOffloadAudio;
@@ -320,7 +320,7 @@
     void performDecoderFlush(FlushCommand audio, FlushCommand video);
     void performReset();
     void performScanSources();
-    void performSetSurface(const sp<Surface> &wrapper);
+    void performSetSurface(const sp<ANativeWindowWrapper> &nw);
     void performResumeDecoders(bool needNotify);
 
     void onSourceNotify(const sp<AMessage> &msg);