Support for a "preparation" state that can take care of lengthy
operations in NuPlayer and its sources. Sources also can publish their
flags now and the mediaplayer UI will be able to pick up on these.
Change-Id: I4f2b7e5d105dcb4b6c9132cd0e8799efa0c6a14b
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 0ff6089..50d0462 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -35,12 +35,14 @@
void setDriver(const wp<NuPlayerDriver> &driver);
- void setDataSource(const sp<IStreamSource> &source);
+ void setDataSourceAsync(const sp<IStreamSource> &source);
- void setDataSource(
+ void setDataSourceAsync(
const char *url, const KeyedVector<String8, String8> *headers);
- void setDataSource(int fd, int64_t offset, int64_t length);
+ void setDataSourceAsync(int fd, int64_t offset, int64_t length);
+
+ void prepareAsync();
void setVideoSurfaceTextureAsync(
const sp<IGraphicBufferProducer> &bufferProducer);
@@ -82,6 +84,7 @@
enum {
kWhatSetDataSource = '=DaS',
+ kWhatPrepare = 'prep',
kWhatSetVideoNativeWindow = '=NaW',
kWhatSetAudioSink = '=AuS',
kWhatMoreDataQueued = 'more',
@@ -102,6 +105,7 @@
bool mUIDValid;
uid_t mUID;
sp<Source> mSource;
+ uint32_t mSourceFlags;
sp<NativeWindowWrapper> mNativeWindow;
sp<MediaPlayerBase::AudioSink> mAudioSink;
sp<Decoder> mVideoDecoder;
@@ -173,6 +177,8 @@
void performScanSources();
void performSetSurface(const sp<NativeWindowWrapper> &wrapper);
+ void onSourceNotify(const sp<AMessage> &msg);
+
DISALLOW_EVIL_CONSTRUCTORS(NuPlayer);
};