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

Commit 03168ed2 authored by James Dong's avatar James Dong
Browse files

When a recording session is stopped, no outstanding input video frames exist...

When a recording session is stopped, no outstanding input video frames exist for the output buffers returned from OMX component to SF.

When this happens, default value of 0 will be used for the "decoding" time for these output buffers.
These buffers do not contain valid media data anyway.

related-to-bug: 4725803

Change-Id: I0eaf248bb2ac022ff072eaffd0ed3f21171f824e
parent b5512a1b
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -1983,7 +1983,14 @@ OMXCodec::BufferInfo* OMXCodec::dequeueBufferFromNativeWindow() {

int64_t OMXCodec::retrieveDecodingTimeUs(bool isCodecSpecific) {
    CHECK(mIsEncoder);
    CHECK(!mDecodingTimeList.empty());

    if (mDecodingTimeList.empty()) {
        CHECK(mNoMoreOutputData);
        // No corresponding input frame available.
        // This could happen when EOS is reached.
        return 0;
    }

    List<int64_t>::iterator it = mDecodingTimeList.begin();
    int64_t timeUs = *it;

@@ -2152,11 +2159,6 @@ void OMXCodec::on_message(const omx_message &msg) {
                    buffer->meta_data()->setInt32(kKeyIsUnreadable, true);
                }

                if (mIsEncoder) {
                    int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific);
                    buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs);
                }

                buffer->meta_data()->setPointer(
                        kKeyPlatformPrivate,
                        msg.u.extended_buffer_data.platform_private);
@@ -2170,6 +2172,11 @@ void OMXCodec::on_message(const omx_message &msg) {
                    mNoMoreOutputData = true;
                }

                if (mIsEncoder) {
                    int64_t decodingTimeUs = retrieveDecodingTimeUs(isCodecSpecific);
                    buffer->meta_data()->setInt64(kKeyDecodingTime, decodingTimeUs);
                }

                if (mTargetTimeUs >= 0) {
                    CHECK(msg.u.extended_buffer_data.timestamp <= mTargetTimeUs);