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/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
index a3201cf..53c7c12 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
@@ -25,11 +25,21 @@
namespace android {
struct ABuffer;
+struct MetaData;
struct NuPlayer::Source : public AHandler {
enum Flags {
- FLAG_SEEKABLE = 1,
- FLAG_DYNAMIC_DURATION = 2,
+ FLAG_CAN_PAUSE = 1,
+ FLAG_CAN_SEEK_BACKWARD = 2, // the "10 sec back button"
+ FLAG_CAN_SEEK_FORWARD = 4, // the "10 sec forward button"
+ FLAG_CAN_SEEK = 8, // the "seek bar"
+ FLAG_DYNAMIC_DURATION = 16,
+ };
+
+ enum {
+ kWhatPrepared,
+ kWhatFlagsChanged,
+ kWhatVideoSizeChanged,
};
// The provides message is used to notify the player about various
@@ -38,6 +48,8 @@
: mNotify(notify) {
}
+ virtual void prepareAsync() = 0;
+
virtual void start() = 0;
virtual void stop() {}
@@ -58,8 +70,6 @@
return INVALID_OPERATION;
}
- virtual uint32_t flags() const = 0;
-
protected:
virtual ~Source() {}
@@ -69,6 +79,10 @@
sp<AMessage> dupNotify() const { return mNotify->dup(); }
+ void notifyFlagsChanged(uint32_t flags);
+ void notifyVideoSizeChanged(int32_t width, int32_t height);
+ void notifyPrepared();
+
private:
sp<AMessage> mNotify;