summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-02-05 13:59:56 -0800
committerAndreas Huber <andih@google.com>2013-02-05 14:09:08 -0800
commit9575c96b6e418914e2ffc6741ecc8d71e3968dbe (patch)
tree1fafdf4d3150799cf9a4266919bf069b7f007c91 /media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
parent84ca0414fedea2dfe51607b422f6227e1c4f0d7f (diff)
downloadframeworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.zip
frameworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.tar.gz
frameworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.tar.bz2
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
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDriver.h')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDriver.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
index 553c406..49b8ed2 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h
@@ -61,6 +61,8 @@ struct NuPlayerDriver : public MediaPlayerInterface {
virtual status_t dump(int fd, const Vector<String16> &args) const;
+ void notifySetDataSourceCompleted(status_t err);
+ void notifyPrepareCompleted(status_t err);
void notifyResetComplete();
void notifySetSurfaceComplete();
void notifyDuration(int64_t durationUs);
@@ -68,17 +70,32 @@ struct NuPlayerDriver : public MediaPlayerInterface {
void notifySeekComplete();
void notifyFrameStats(int64_t numFramesTotal, int64_t numFramesDropped);
void notifyListener(int msg, int ext1 = 0, int ext2 = 0);
+ void notifyFlagsChanged(uint32_t flags);
protected:
virtual ~NuPlayerDriver();
private:
+ enum State {
+ STATE_IDLE,
+ STATE_SET_DATASOURCE_PENDING,
+ STATE_UNPREPARED,
+ STATE_PREPARING,
+ STATE_PREPARED,
+ STATE_RUNNING,
+ STATE_PAUSED,
+ STATE_RESET_IN_PROGRESS,
+ };
+
mutable Mutex mLock;
Condition mCondition;
+ State mState;
+
+ status_t mAsyncResult;
+
// The following are protected through "mLock"
// >>>
- bool mResetInProgress;
bool mSetSurfaceInProgress;
int64_t mDurationUs;
int64_t mPositionUs;
@@ -88,19 +105,14 @@ private:
sp<ALooper> mLooper;
sp<NuPlayer> mPlayer;
+ uint32_t mPlayerFlags;
- enum State {
- UNINITIALIZED,
- STOPPED,
- PLAYING,
- PAUSED
- };
-
- State mState;
bool mAtEOS;
int64_t mStartupSeekTimeUs;
+ status_t prepare_l();
+
DISALLOW_EVIL_CONSTRUCTORS(NuPlayerDriver);
};