Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f348eb1 authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Steve Kondik
Browse files

[libstagefright] : camcorder pause-resume implementation

- Added pause resume feature in camcorder app.so that
  user pause recording and resume later which results
  in a single recorded clip.
CRs-Fixed: 587051

Change-Id: Ib82a93009348d997a4b8343b8b417b433be4c9df
parent 45acc104
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public:
    virtual status_t getMaxAmplitude(int* max) = 0;
    virtual status_t start() = 0;
    virtual status_t stop() = 0;
    virtual status_t pause() = 0;
    virtual status_t reset() = 0;
    virtual status_t init() = 0;
    virtual status_t close() = 0;
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,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;
+4 −0
Original line number Diff line number Diff line
@@ -120,6 +120,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.
@@ -236,6 +239,7 @@ public:
    status_t    getMaxAmplitude(int* max);
    status_t    start();
    status_t    stop();
    status_t    pause();
    status_t    reset();
    status_t    init();
    status_t    close();
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ struct AudioSource : public MediaSource, public MediaBufferObserver {
    virtual status_t start(MetaData *params = NULL);
    virtual status_t stop() { return reset(); }
    virtual sp<MetaData> getFormat();
    status_t pause();

    // Returns the maximum amplitude since last call.
    int16_t getMaxAmplitude();
@@ -76,6 +77,7 @@ private:
    sp<AudioRecord> mRecord;
    status_t mInitCheck;
    bool mStarted;
    bool mRecPaused;
    int32_t mSampleRate;

    bool mTrackMaxAmplitude;
+5 −1
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public:
    virtual ~CameraSource();

    virtual status_t start(MetaData *params = NULL);
    virtual status_t pause();
    virtual status_t stop() { return reset(); }
    virtual status_t read(
            MediaBuffer **buffer, const ReadOptions *options = NULL);
@@ -162,7 +163,10 @@ protected:
    int64_t mLastFrameTimestampUs;
    bool mStarted;
    int32_t mNumFramesEncoded;

    bool mRecPause;
    int64_t  mPauseAdjTimeUs;
    int64_t  mPauseStartTimeUs;
    int64_t  mPauseEndTimeUs;
    // Time between capture of two frames.
    int64_t mTimeBetweenFrameCaptureUs;

Loading