diff options
author | Andreas Huber <andih@google.com> | 2010-10-08 11:16:07 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-08 11:16:07 -0700 |
commit | 6f3cba53efdd985ab13734c7ad90eb373ae9b9f7 (patch) | |
tree | 7cc426c49690a424cb2aa9dcbe9bfbe50e0c93a3 | |
parent | e6d26450e5a01be5b7f1343578e7237e68db7737 (diff) | |
parent | 70f521de2675ce6eedf4b22beed94ea1289b0f38 (diff) | |
download | frameworks_av-6f3cba53efdd985ab13734c7ad90eb373ae9b9f7.zip frameworks_av-6f3cba53efdd985ab13734c7ad90eb373ae9b9f7.tar.gz frameworks_av-6f3cba53efdd985ab13734c7ad90eb373ae9b9f7.tar.bz2 |
Merge "Disable 10secs forward/backward seeking for rtsp as seek is a very expensive operation there. Decouple the 10sec forward/backward button functionality from seekbar functionality." into gingerbread
-rw-r--r-- | include/media/Metadata.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/MediaExtractor.h | 7 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightPlayer.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/MediaExtractor.cpp | 2 | ||||
-rw-r--r-- | media/libstagefright/include/ARTSPController.h | 8 |
6 files changed, 19 insertions, 7 deletions
diff --git a/include/media/Metadata.h b/include/media/Metadata.h index 241868a..9c915ce 100644 --- a/include/media/Metadata.h +++ b/include/media/Metadata.h @@ -91,6 +91,7 @@ class Metadata { static const Type kPauseAvailable = 29; // Boolean static const Type kSeekBackwardAvailable = 30; // Boolean static const Type kSeekForwardAvailable = 31; // Boolean + static const Type kSeekAvailable = 32; // Boolean // @param p[inout] The parcel to append the metadata records // to. The global metadata header should have been set already. diff --git a/include/media/stagefright/MediaExtractor.h b/include/media/stagefright/MediaExtractor.h index 21338ca..16b0a4c 100644 --- a/include/media/stagefright/MediaExtractor.h +++ b/include/media/stagefright/MediaExtractor.h @@ -45,13 +45,14 @@ public: virtual sp<MetaData> getMetaData(); enum Flags { - CAN_SEEK_BACKWARD = 1, - CAN_SEEK_FORWARD = 2, + CAN_SEEK_BACKWARD = 1, // the "seek 10secs back button" + CAN_SEEK_FORWARD = 2, // the "seek 10secs forward button" CAN_PAUSE = 4, + CAN_SEEK = 8, // the "seek bar" }; // If subclasses do _not_ override this, the default is - // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_PAUSE + // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE virtual uint32_t flags() const; protected: diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index 2c96d6d..6bded09 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -180,6 +180,10 @@ status_t StagefrightPlayer::getMetadata( Metadata::kSeekForwardAvailable, flags & MediaExtractor::CAN_SEEK_FORWARD); + metadata.appendBool( + Metadata::kSeekAvailable, + flags & MediaExtractor::CAN_SEEK); + return OK; } diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 8c17aab..53543b3 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -868,9 +868,7 @@ status_t AwesomePlayer::getPosition(int64_t *positionUs) { } status_t AwesomePlayer::seekTo(int64_t timeUs) { - if (mExtractorFlags - & (MediaExtractor::CAN_SEEK_FORWARD - | MediaExtractor::CAN_SEEK_BACKWARD)) { + if (mExtractorFlags & MediaExtractor::CAN_SEEK) { Mutex::Autolock autoLock(mLock); return seekTo_l(timeUs); } diff --git a/media/libstagefright/MediaExtractor.cpp b/media/libstagefright/MediaExtractor.cpp index 9bc94de..8a5fb11 100644 --- a/media/libstagefright/MediaExtractor.cpp +++ b/media/libstagefright/MediaExtractor.cpp @@ -41,7 +41,7 @@ sp<MetaData> MediaExtractor::getMetaData() { } uint32_t MediaExtractor::flags() const { - return CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_PAUSE; + return CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_PAUSE | CAN_SEEK; } // static diff --git a/media/libstagefright/include/ARTSPController.h b/media/libstagefright/include/ARTSPController.h index 300d8f7..c2f3090 100644 --- a/media/libstagefright/include/ARTSPController.h +++ b/media/libstagefright/include/ARTSPController.h @@ -46,6 +46,14 @@ struct ARTSPController : public MediaExtractor { void onMessageReceived(const sp<AMessage> &msg); + virtual uint32_t flags() const { + // Seeking 10secs forward or backward is a very expensive operation + // for rtsp, so let's not enable that. + // The user can always use the seek bar. + + return CAN_PAUSE | CAN_SEEK; + } + protected: virtual ~ARTSPController(); |