diff options
author | James Dong <jdong@google.com> | 2012-02-02 18:04:02 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-02-02 18:11:53 -0800 |
commit | b44c9d2bdc0d5b9cb03254022a58e017b516e9e6 (patch) | |
tree | 06a30f5984b5fd11da06bbc6bc7d8294f21d1ac2 /include/media | |
parent | 2af955b7437ac5345d75a5e528ebbb749667af7e (diff) | |
download | frameworks_av-b44c9d2bdc0d5b9cb03254022a58e017b516e9e6.zip frameworks_av-b44c9d2bdc0d5b9cb03254022a58e017b516e9e6.tar.gz frameworks_av-b44c9d2bdc0d5b9cb03254022a58e017b516e9e6.tar.bz2 |
Don't call virtual functions in the destructor for audio and camera source classes
Change-Id: Ia74ffc1c0cbd7971697f5e3c476e340ec5c7727a
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/AudioSource.h | 3 | ||||
-rw-r--r-- | include/media/stagefright/CameraSource.h | 5 | ||||
-rw-r--r-- | include/media/stagefright/CameraSourceTimeLapse.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h index 2427e2f..79437bf 100644 --- a/include/media/stagefright/AudioSource.h +++ b/include/media/stagefright/AudioSource.h @@ -40,7 +40,7 @@ struct AudioSource : public MediaSource, public MediaBufferObserver { status_t initCheck() const; virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); + virtual status_t stop() { return reset(); } virtual sp<MetaData> getFormat(); // Returns the maximum amplitude since last call. @@ -97,6 +97,7 @@ private: void releaseQueuedFrames_l(); void waitOutstandingEncodingFrames_l(); + status_t reset(); AudioSource(const AudioSource &); AudioSource &operator=(const AudioSource &); diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h index 446720b..5a35358 100644 --- a/include/media/stagefright/CameraSource.h +++ b/include/media/stagefright/CameraSource.h @@ -79,7 +79,7 @@ public: virtual ~CameraSource(); virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); + virtual status_t stop() { return reset(); } virtual status_t read( MediaBuffer **buffer, const ReadOptions *options = NULL); @@ -163,7 +163,6 @@ protected: bool storeMetaDataInVideoBuffers); virtual void startCameraRecording(); - virtual void stopCameraRecording(); virtual void releaseRecordingFrame(const sp<IMemory>& frame); // Returns true if need to skip the current frame. @@ -220,7 +219,9 @@ private: status_t checkFrameRate(const CameraParameters& params, int32_t frameRate); + void stopCameraRecording(); void releaseCamera(); + status_t reset(); CameraSource(const CameraSource &); CameraSource &operator=(const CameraSource &); diff --git a/include/media/stagefright/CameraSourceTimeLapse.h b/include/media/stagefright/CameraSourceTimeLapse.h index b060691..0936da2 100644 --- a/include/media/stagefright/CameraSourceTimeLapse.h +++ b/include/media/stagefright/CameraSourceTimeLapse.h @@ -121,9 +121,6 @@ private: // Wrapper over CameraSource::read() to implement quick stop. virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL); - // For video camera case, just stops the camera's video recording. - virtual void stopCameraRecording(); - // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame. virtual bool skipCurrentFrame(int64_t timestampUs); |