summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-02-05 10:14:26 -0800
committerAndreas Huber <andih@google.com>2013-02-05 10:14:26 -0800
commitb5f25f005bc1d3ae35f45b58c88345e183dc336d (patch)
tree4c8557d59ae426eb7dc7467d8bf799f059a4f30d /media/libmediaplayerservice/nuplayer/NuPlayerSource.h
parent20ea4b429237f6845a833994bcee8f86791e8973 (diff)
downloadframeworks_av-b5f25f005bc1d3ae35f45b58c88345e183dc336d.zip
frameworks_av-b5f25f005bc1d3ae35f45b58c88345e183dc336d.tar.gz
frameworks_av-b5f25f005bc1d3ae35f45b58c88345e183dc336d.tar.bz2
Groundwork to support bidirectional, asynchronous communication
between NuPlayer and its sources. Change-Id: I1989022d806206b926555add3aa5c1fcf37aa78d
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerSource.h')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerSource.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
index a635340..a3201cf 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
@@ -20,17 +20,23 @@
#include "NuPlayer.h"
+#include <media/stagefright/foundation/AMessage.h>
+
namespace android {
struct ABuffer;
-struct NuPlayer::Source : public RefBase {
+struct NuPlayer::Source : public AHandler {
enum Flags {
FLAG_SEEKABLE = 1,
FLAG_DYNAMIC_DURATION = 2,
};
- Source() {}
+ // The provides message is used to notify the player about various
+ // events.
+ Source(const sp<AMessage> &notify)
+ : mNotify(notify) {
+ }
virtual void start() = 0;
virtual void stop() {}
@@ -57,9 +63,15 @@ struct NuPlayer::Source : public RefBase {
protected:
virtual ~Source() {}
+ virtual void onMessageReceived(const sp<AMessage> &msg);
+
virtual sp<MetaData> getFormatMeta(bool audio) { return NULL; }
+ sp<AMessage> dupNotify() const { return mNotify->dup(); }
+
private:
+ sp<AMessage> mNotify;
+
DISALLOW_EVIL_CONSTRUCTORS(Source);
};