summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MediaPlayerFactory.cpp
diff options
context:
space:
mode:
authorChris Watkins <watk@google.com>2015-03-20 13:06:33 -0700
committerChris Watkins <watk@google.com>2015-04-15 17:12:22 -0700
commit99f31604136d66ae10e20669fb6b5716f342bde0 (patch)
tree20e64f4f26533b37b087ce8656b1040b8189e24f /media/libmediaplayerservice/MediaPlayerFactory.cpp
parent2f33dbc6ca08d45efea2df775c158e2a11e07ab6 (diff)
downloadframeworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.zip
frameworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.tar.gz
frameworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.tar.bz2
Unhide the android.media.[Media]DataSource interface.
This allows apps to implement MediaDataSource, which is modeled on stagefright's DataSource, to supply media data to the framework. This was already implemented for MediaExtractor, but it was renamed from DataSource. MediaExtractor, MediaPlayer and MediaMetadataRetriever each have a new overload: #setDataSource(android.media.MediaDataSource) Only NuPlayer supports this new data source. The change introduces: * IDataSource: The binder interface for DataSource. * JMediaDataSource: The native counterpart to the java interface. It implements IDataSource. * CallbackDataSource: A stagefright DataSource that wraps an IDataSource. Change-Id: Ib3c944b49cc8a792c8eb9c85e5015c07f298ebc1
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerFactory.cpp')
-rw-r--r--media/libmediaplayerservice/MediaPlayerFactory.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerFactory.cpp b/media/libmediaplayerservice/MediaPlayerFactory.cpp
index 48884b9..ca33aed 100644
--- a/media/libmediaplayerservice/MediaPlayerFactory.cpp
+++ b/media/libmediaplayerservice/MediaPlayerFactory.cpp
@@ -131,6 +131,11 @@ player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client,
GET_PLAYER_TYPE_IMPL(client, source);
}
+player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client,
+ const sp<DataSource> &source) {
+ GET_PLAYER_TYPE_IMPL(client, source);
+}
+
#undef GET_PLAYER_TYPE_IMPL
sp<MediaPlayerBase> MediaPlayerFactory::createPlayer(
@@ -273,6 +278,13 @@ class NuPlayerFactory : public MediaPlayerFactory::IFactory {
return 1.0;
}
+ virtual float scoreFactory(const sp<IMediaPlayer>& /*client*/,
+ const sp<DataSource>& /*source*/,
+ float /*curScore*/) {
+ // Only NuPlayer supports setting a DataSource source directly.
+ return 1.0;
+ }
+
virtual sp<MediaPlayerBase> createPlayer() {
ALOGV(" create NuPlayer");
return new NuPlayerDriver;