summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-02-04 05:54:53 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-04 05:54:54 -0800
commitf9289a4ca88d8f72cb0d6b3ca16fbc44ef4a2aeb (patch)
tree72b693683dfd6405f6f8f70cdfde38b4b563c4c6 /include
parentf3623993b78669a624d9b3a703b361ed6c035ad9 (diff)
parentb44c9d2bdc0d5b9cb03254022a58e017b516e9e6 (diff)
downloadframeworks_av-f9289a4ca88d8f72cb0d6b3ca16fbc44ef4a2aeb.zip
frameworks_av-f9289a4ca88d8f72cb0d6b3ca16fbc44ef4a2aeb.tar.gz
frameworks_av-f9289a4ca88d8f72cb0d6b3ca16fbc44ef4a2aeb.tar.bz2
Merge "Don't call virtual functions in the destructor for audio and camera source classes"
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/AudioSource.h3
-rw-r--r--include/media/stagefright/CameraSource.h5
-rw-r--r--include/media/stagefright/CameraSourceTimeLapse.h3
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);