diff options
author | Chih-Yu Huang <akahuang@google.com> | 2020-09-11 14:39:00 +0900 |
---|---|---|
committer | Chih-Yu Huang <akahuang@google.com> | 2020-09-15 14:02:24 +0900 |
commit | 7b55edc6bacc315a2aa0a52cd4dcc6cf066a8356 (patch) | |
tree | 8a83542ee9422aeab2882eac4617fc24e5f493f1 /components/V4L2Decoder.cpp | |
parent | 9cf0ab57d14d9f74e834c36a2a1e0324e0482e89 (diff) | |
download | v4l2_codec2-7b55edc6bacc315a2aa0a52cd4dcc6cf066a8356.tar.gz |
V4L2Decoder: streamon V4L2 output queue in Flush()
Originally we streamoff both input and output queue when Flush() is
called. We expect the V4L2 driver will send the resolution change
event after the playback resumes. Then the output queue will be
streamon again.
However, the driver might not send the event if the resumed playback
has the same resolution. In this case, the output queue won't be
streamon and the playback is stuck. This CL streamons the output queue
immediately after the output queue is streamoff.
Bug: 168557465
Test: Pass android.media.cts.AdaptivePlaybackTest#testVP8_eosFlushSeek
with related CLs
Change-Id: I0e3f0bd6445150ed9df2a30aac8ff692ec626137
Diffstat (limited to 'components/V4L2Decoder.cpp')
-rw-r--r-- | components/V4L2Decoder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/V4L2Decoder.cpp b/components/V4L2Decoder.cpp index 26f1365..c070d64 100644 --- a/components/V4L2Decoder.cpp +++ b/components/V4L2Decoder.cpp @@ -314,14 +314,16 @@ void V4L2Decoder::flush() { std::move(mDrainCb).Run(VideoDecoder::DecodeStatus::kAborted); } - // Streamoff V4L2 queues to drop input and output buffers. + // Streamoff both V4L2 queues to drop input and output buffers. mDevice->StopPolling(); mOutputQueue->Streamoff(); mFrameAtDevice.clear(); mInputQueue->Streamoff(); - // Streamon input queue again. + // Streamon both V4L2 queues. mInputQueue->Streamon(); + mOutputQueue->Streamon(); + if (!mDevice->StartPolling(::base::BindRepeating(&V4L2Decoder::serviceDeviceTask, mWeakThis), ::base::BindRepeating(&V4L2Decoder::onError, mWeakThis))) { ALOGE("Failed to start polling V4L2 device."); |