Media Recorder 录像流程中时间戳/系统时间的处理2 Pause/Resume的时间戳处理

本文探讨了在使用Media Recorder进行录像时,如何处理Pause和Resume操作中的时间戳和系统时间问题,包括在Camera API 2.0和1.0下对视频的Resume操作以及可能涉及的Audio Resume。
摘要由CSDN通过智能技术生成

Media Recorder 录像流程中时间戳/系统时间的处理2 

Pause/Resume的时间处理

[Pause]

1897status_t StagefrightRecorder::pause() {
1898    ALOGV("pause");
1899    if (!mStarted) {
1900        return INVALID_OPERATION;
1901    }
1902
1903    // Already paused --- no-op.
1904    if (mPauseStartTimeUs != 0) {
1905        return OK;
1906    }
1907
1908    mPauseStartTimeUs = systemTime() / 1000;
1909    sp<MetaData> meta = new MetaData;
1910    meta->setInt64(kKeyTime, mPauseStartTimeUs);
1911
1912    if (mAudioEncoderSource != NULL) {
1913        mAudioEncoderSource->pause();
1914    }
1915    if (mVideoEncoderSource != NULL) {
1916        mVideoEncoderSource->pause(meta.get());
1917    }
1918
1919    return OK;
1920}

[Resume]

1922status_t StagefrightRecorder::resume() {
1923    ALOGV("resume");
1924    if (!mStarted) {
1925        return INVALID_OPERATION;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值