diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-10-20 00:19:30 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-10-20 00:19:30 +0000 |
commit | 9c9b81906d7b2569f61a59b4719c783ef522c39d (patch) | |
tree | 602cc73d22c17abcd4f9e2ee21a45ab7c750fc8d | |
parent | 6361908fb4f5207bccad9cecba8d3b45326dda5d (diff) | |
parent | 91eb0025069dc0cd0a182b34d43fdba1697b10f9 (diff) | |
download | av-pie-qpr1-s3-release.tar.gz |
Merge cherrypicks of [5317808, 5317809, 5318498, 5317873, 5318338, 5318195, 5318499, 5317874, 5317875, 5317876, 5318243, 5318244, 5318537, 5318538, 5318539, 5318540, 5318541, 5318542, 5318543, 5318544, 5318545, 5318546, 5315210, 5317756, 5318557, 5318558, 5318559, 5318560, 5318561, 5318339, 5318547, 5318548, 5318549, 5318562, 5318563, 5318564, 5318565, 5318566, 5318172, 5318173, 5318174, 5318550, 5318401, 5318196, 5317889, 5318175, 5318176, 5318577, 5318578, 5318579, 5318580, 5318581, 5318503, 5318390, 5318505, 5318341, 5318551] into pi-qpr1-releaseandroid-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19pie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-release
Change-Id: I28af114ff25b444e3925200554067f709ded5daa
-rw-r--r-- | media/sfplugin/CCodecBufferChannel.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/media/sfplugin/CCodecBufferChannel.cpp b/media/sfplugin/CCodecBufferChannel.cpp index 8796128..6e8bd90 100644 --- a/media/sfplugin/CCodecBufferChannel.cpp +++ b/media/sfplugin/CCodecBufferChannel.cpp @@ -2122,7 +2122,8 @@ status_t CCodecBufferChannel::start( outputGeneration); } - if (oStreamFormat.value == C2BufferData::LINEAR) { + if (oStreamFormat.value == C2BufferData::LINEAR + && mComponentName.find("c2.qti.") == std::string::npos) { // WORKAROUND: if we're using early CSD workaround we convert to // array mode, to appease apps assuming the output // buffers to be of the same size. @@ -2158,6 +2159,12 @@ status_t CCodecBufferChannel::requestInitialInputBuffers() { if (mInputSurface) { return OK; } + + C2StreamFormatConfig::output oStreamFormat(0u); + c2_status_t err = mComponent->query({ &oStreamFormat }, {}, C2_DONT_BLOCK, nullptr); + if (err != C2_OK) { + return UNKNOWN_ERROR; + } std::vector<sp<MediaCodecBuffer>> toBeQueued; // TODO: use proper buffer depth instead of this random value for (size_t i = 0; i < kMinInputBufferArraySize; ++i) { @@ -2193,6 +2200,14 @@ status_t CCodecBufferChannel::requestInitialInputBuffers() { ALOGD("[%s] buffer capacity too small for the config (%zu < %zu)", mName, buffer->capacity(), config->size()); } + } else if (oStreamFormat.value == C2BufferData::LINEAR && i == 0 + && mComponentName.find("c2.qti.") == std::string::npos) { + // WORKAROUND: Some apps expect CSD available without queueing + // any input. Queue an empty buffer to get the CSD. + buffer->setRange(0, 0); + buffer->meta()->clear(); + buffer->meta()->setInt64("timeUs", 0); + post = false; } if (mAvailablePipelineCapacity.allocate("requestInitialInputBuffers")) { if (post) { |