diff options
-rw-r--r-- | include/media/Metadata.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/MediaExtractor.h | 7 | ||||
-rw-r--r-- | media/java/android/media/Metadata.java | 3 | ||||
-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 |
7 files changed, 21 insertions, 8 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/java/android/media/Metadata.java b/media/java/android/media/Metadata.java index bd25da2..8d408c2 100644 --- a/media/java/android/media/Metadata.java +++ b/media/java/android/media/Metadata.java @@ -102,8 +102,9 @@ public class Metadata public static final int PAUSE_AVAILABLE = 29; // Boolean public static final int SEEK_BACKWARD_AVAILABLE = 30; // Boolean public static final int SEEK_FORWARD_AVAILABLE = 31; // Boolean + public static final int SEEK_AVAILABLE = 32; // Boolean - private static final int LAST_SYSTEM = 31; + private static final int LAST_SYSTEM = 32; private static final int FIRST_CUSTOM = 8192; // Shorthands to set the MediaPlayer's metadata filter. diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index 6b9bf85..b3e2da0 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -187,6 +187,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 82f14a3..cd26bd6 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -888,9 +888,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(); |