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

Commit 162e1273 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5567188 from e445c281 to qt-release

Change-Id: Icf55da7804d3a645d0a132d7960fdfb022e283e0
parents 2f9345bb e445c281
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -395,11 +395,16 @@ status_t ColorConverter::convertYUV420SemiPlanarUseLibYUV(
                dst.mStride, src.cropWidth(), src.cropHeight());
        break;

    case OMX_COLOR_Format32BitRGBA8888:
    case OMX_COLOR_Format32bitBGRA8888:
        libyuv::NV12ToARGB(src_y, src.mStride, src_u, src.mStride, (uint8 *)dst_ptr,
                dst.mStride, src.cropWidth(), src.cropHeight());
        break;

    case OMX_COLOR_Format32BitRGBA8888:
        libyuv::NV12ToABGR(src_y, src.mStride, src_u, src.mStride, (uint8 *)dst_ptr,
                dst.mStride, src.cropWidth(), src.cropHeight());
        break;

    default:
        return ERROR_UNSUPPORTED;
   }
+8 −0
Original line number Diff line number Diff line
@@ -62,6 +62,14 @@ sp<WebmElement> WebmFrame::SimpleBlock(uint64_t baseTimecode) const {
            mData);
}

uint64_t WebmFrame::getAbsTimecode() {
    return mAbsTimecode;
}

void WebmFrame::updateAbsTimecode(uint64_t newAbsTimecode) {
    mAbsTimecode = newAbsTimecode;
}

bool WebmFrame::operator<(const WebmFrame &other) const {
    if (this->mEos) {
        return false;
+3 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ struct WebmFrame : LightRefBase<WebmFrame> {
public:
    const int mType;
    const bool mKey;
    const uint64_t mAbsTimecode;
    uint64_t mAbsTimecode;
    const sp<ABuffer> mData;
    const bool mEos;

@@ -33,6 +33,8 @@ public:
    WebmFrame(int type, bool key, uint64_t absTimecode, MediaBufferBase *buf);
    ~WebmFrame() {}

    uint64_t getAbsTimecode();
    void updateAbsTimecode(uint64_t newAbsTimecode);
    sp<WebmElement> SimpleBlock(uint64_t baseTimecode) const;

    bool operator<(const WebmFrame &other) const;
+9 −1
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ WebmFrameSinkThread::WebmFrameSinkThread(
      mVideoFrames(videoThread->mSink),
      mAudioFrames(audioThread->mSink),
      mCues(cues),
      mStartOffsetTimecode(UINT64_MAX),
      mDone(true) {
}

@@ -92,6 +93,7 @@ WebmFrameSinkThread::WebmFrameSinkThread(
      mVideoFrames(videoSource),
      mAudioFrames(audioSource),
      mCues(cues),
      mStartOffsetTimecode(UINT64_MAX),
      mDone(true) {
}

@@ -213,6 +215,11 @@ void WebmFrameSinkThread::run() {
        const sp<WebmFrame> audioFrame = mAudioFrames.peek();
        ALOGV("a frame: %p", audioFrame.get());

        if (mStartOffsetTimecode == UINT64_MAX) {
            mStartOffsetTimecode =
                    std::min(audioFrame->getAbsTimecode(), videoFrame->getAbsTimecode());
        }

        if (videoFrame->mEos && audioFrame->mEos) {
            break;
        }
@@ -220,10 +227,12 @@ void WebmFrameSinkThread::run() {
        if (*audioFrame < *videoFrame) {
            ALOGV("take a frame");
            mAudioFrames.take();
            audioFrame->updateAbsTimecode(audioFrame->getAbsTimecode() - mStartOffsetTimecode);
            outstandingFrames.push_back(audioFrame);
        } else {
            ALOGV("take v frame");
            mVideoFrames.take();
            videoFrame->updateAbsTimecode(videoFrame->getAbsTimecode() - mStartOffsetTimecode);
            outstandingFrames.push_back(videoFrame);
            if (videoFrame->mKey)
                numVideoKeyFrames++;
@@ -350,7 +359,6 @@ void WebmFrameMediaSourceThread::run() {
        if (mStartTimeUs == kUninitialized) {
            mStartTimeUs = timestampUs;
        }
        timestampUs -= mStartTimeUs;

        if (mPaused && !mResumed) {
            lastDurationUs = timestampUs - lastTimestampUs;
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ private:
    LinkedBlockingQueue<const sp<WebmFrame> >& mVideoFrames;
    LinkedBlockingQueue<const sp<WebmFrame> >& mAudioFrames;
    List<sp<WebmElement> >& mCues;
    uint64_t mStartOffsetTimecode;

    volatile bool mDone;