diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/IMediaPlayer.h | 10 | ||||
-rw-r--r-- | include/media/IMediaRecorder.h | 1 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 8 | ||||
-rw-r--r-- | include/media/MediaRecorderBase.h | 1 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 5 | ||||
-rwxr-xr-x | include/media/mediarecorder.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/AudioPlayer.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/AudioSource.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/CameraSource.h | 7 | ||||
-rw-r--r-- | include/media/stagefright/CameraSourceTimeLapse.h | 3 | ||||
-rw-r--r-- | include/media/stagefright/OMXCodec.h | 4 |
11 files changed, 46 insertions, 3 deletions
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 0fd8933..5957535 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -109,6 +109,16 @@ public: virtual status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata) = 0; + + // Suspend the video player + // In other words, just release the audio decoder and the video decoder + // @return OK if the video player was suspended successfully + virtual status_t suspend() = 0; + + // Resume the video player + // Init the audio decoder and the video decoder + // @return OK if the video player was resumed successfully + virtual status_t resume() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index 77ed5d3..339bd9e 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -51,6 +51,7 @@ public: virtual status_t prepare() = 0; virtual status_t getMaxAmplitude(int* max) = 0; virtual status_t start() = 0; + virtual status_t pause() = 0; virtual status_t stop() = 0; virtual status_t reset() = 0; virtual status_t init() = 0; diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 745151b..4810b7e 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -267,6 +267,14 @@ public: return INVALID_OPERATION; } + virtual status_t suspend() { + return INVALID_OPERATION; + } + + virtual status_t resume() { + return INVALID_OPERATION; + } + private: friend class MediaPlayerService; diff --git a/include/media/MediaRecorderBase.h b/include/media/MediaRecorderBase.h index d6cc4bb..48d8b70 100644 --- a/include/media/MediaRecorderBase.h +++ b/include/media/MediaRecorderBase.h @@ -53,6 +53,7 @@ struct MediaRecorderBase { virtual status_t prepare() = 0; virtual status_t start() = 0; virtual status_t stop() = 0; + virtual status_t pause() = 0; virtual status_t close() = 0; virtual status_t reset() = 0; virtual status_t getMaxAmplitude(int *max) = 0; diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 1f6ddad..3d4a6e2 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -147,7 +147,8 @@ enum media_player_states { MEDIA_PLAYER_STARTED = 1 << 4, MEDIA_PLAYER_PAUSED = 1 << 5, MEDIA_PLAYER_STOPPED = 1 << 6, - MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7 + MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7, + MEDIA_PLAYER_SUSPENDED = 1 << 8 }; // Keep KEY_PARAMETER_* in sync with MediaPlayer.java. @@ -255,6 +256,8 @@ public: status_t getParameter(int key, Parcel* reply); status_t setRetransmitEndpoint(const char* addrString, uint16_t port); status_t setNextMediaPlayer(const sp<MediaPlayer>& player); + status_t suspend(); + status_t resume(); private: void clear_l(); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index 93b5d67..96c84bb 100755 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -134,6 +134,9 @@ enum media_recorder_states { // Recording is in progress. MEDIA_RECORDER_RECORDING = 1 << 4, + + // Recording is paused. + MEDIA_RECORDER_PAUSED = 1 << 5, }; // The "msg" code passed to the listener in notify. @@ -246,6 +249,7 @@ public: status_t getMaxAmplitude(int* max); virtual status_t start(); virtual status_t stop(); + virtual status_t pause(); status_t reset(); status_t init(); status_t close(); diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h index e0cd965..edc9f25 100644 --- a/include/media/stagefright/AudioPlayer.h +++ b/include/media/stagefright/AudioPlayer.h @@ -103,6 +103,7 @@ private: int64_t mSeekTimeUs; bool mStarted; + bool mSourcePaused; bool mIsFirstBuffer; status_t mFirstBufferResult; @@ -115,6 +116,7 @@ private: bool mPlaying; int64_t mStartPosUs; const uint32_t mCreateFlags; + bool mPauseRequired; static void AudioCallback(int event, void *user, void *info); void AudioCallback(int event, void *info); diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h index 9750bcd..e48765e 100644 --- a/include/media/stagefright/AudioSource.h +++ b/include/media/stagefright/AudioSource.h @@ -46,7 +46,7 @@ struct AudioSource : public MediaSource, public MediaBufferObserver { virtual status_t stop() { return reset(); } virtual sp<MetaData> getFormat(); - virtual status_t pause() { return ERROR_UNSUPPORTED; } + virtual status_t pause(); // Returns the maximum amplitude since last call. int16_t getMaxAmplitude(); @@ -94,6 +94,8 @@ protected: int64_t mNumFramesReceived; int64_t mNumClientOwnedBuffers; + bool mRecPaused; + List<MediaBuffer * > mBuffersReceived; void trackMaxAmplitude(int16_t *data, int nSamples); diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h index 527ee15..70149cc 100644 --- a/include/media/stagefright/CameraSource.h +++ b/include/media/stagefright/CameraSource.h @@ -92,7 +92,7 @@ public: virtual status_t read( MediaBuffer **buffer, const ReadOptions *options = NULL); - virtual status_t pause() { return ERROR_UNSUPPORTED; } + virtual status_t pause(); /** * Check whether a CameraSource object is properly initialized. @@ -208,6 +208,11 @@ protected: bool mCollectStats; bool mIsMetaDataStoredInVideoBuffers; + int64_t mPauseAdjTimeUs; + int64_t mPauseStartTimeUs; + int64_t mPauseEndTimeUs; + bool mRecPause; + void releaseQueuedFrames(); void releaseOneRecordingFrame(const sp<IMemory>& frame); diff --git a/include/media/stagefright/CameraSourceTimeLapse.h b/include/media/stagefright/CameraSourceTimeLapse.h index f264d98..eeb453f 100644 --- a/include/media/stagefright/CameraSourceTimeLapse.h +++ b/include/media/stagefright/CameraSourceTimeLapse.h @@ -67,6 +67,9 @@ protected: // Real timestamp of the last encoded time lapse frame int64_t mLastTimeLapseFrameRealTimestampUs; + // Adjusted continuous timestamp based on recording fps + // of the last encoded time lapse frame + int64_t mLastTimeLapseFrameTimeStampUs; // Variable set in dataCallbackTimestamp() to help skipCurrentFrame() // to know if current frame needs to be skipped. diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h index 7fabcb3..ea534e0 100644 --- a/include/media/stagefright/OMXCodec.h +++ b/include/media/stagefright/OMXCodec.h @@ -139,6 +139,9 @@ private: EXECUTING_TO_IDLE, IDLE_TO_LOADED, RECONFIGURING, + PAUSING, + FLUSHING, + PAUSED, ERROR }; @@ -348,6 +351,7 @@ private: status_t waitForBufferFilled_l(); + status_t resumeLocked(bool drainInputBuf); int64_t getDecodingTimeUs(); status_t parseHEVCCodecSpecificData( |