Loading media/codec2/components/avc/C2SoftAvcEnc.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -334,7 +334,10 @@ public: // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. For Level 1b, we want to update the level anyway, // the requirements. For Level 1b, we want to update the level anyway, // so we set it to true in that case. // so we set it to true in that case. bool needsUpdate = (me.v.level == LEVEL_AVC_1B); bool needsUpdate = false; if (me.v.level == LEVEL_AVC_1B || !me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (mbs <= limit.mbs && mbsPerSec <= limit.mbsPerSec && if (mbs <= limit.mbs && mbsPerSec <= limit.mbsPerSec && bitrate.v.value <= limit.bitrate) { bitrate.v.value <= limit.bitrate) { Loading media/codec2/components/hevc/C2SoftHevcEnc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -341,6 +341,9 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. // the requirements. bool needsUpdate = false; bool needsUpdate = false; if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && bitrate.v.value <= limit.bitrate) { bitrate.v.value <= limit.bitrate) { Loading media/codec2/components/mpeg4_h263/C2SoftMpeg4Enc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -243,6 +243,9 @@ class C2SoftMpeg4Enc::IntfImpl : public SimpleInterface<void>::BaseParams { needsUpdate = true; needsUpdate = true; } } #endif #endif if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (sampleRate <= limit.sampleRate && size.v.width <= limit.width && if (sampleRate <= limit.sampleRate && size.v.width <= limit.width && vbvSize <= limit.vbvSize && size.v.height <= limit.height && vbvSize <= limit.vbvSize && size.v.height <= limit.height && Loading media/codec2/components/vpx/C2SoftVpxEnc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -263,6 +263,9 @@ C2R C2SoftVpxEnc::IntfImpl::ProfileLevelSetter(bool mayBlock, // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. // the requirements. bool needsUpdate = false; bool needsUpdate = false; if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits& limit : kLimits) { for (const LevelLimits& limit : kLimits) { if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && bitrate.v.value <= limit.bitrate && dimension <= limit.dimension) { bitrate.v.value <= limit.bitrate && dimension <= limit.dimension) { Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -2096,7 +2096,10 @@ bool CCodecBufferChannel::handleWork( // csd cannot be re-ordered and will always arrive first. // csd cannot be re-ordered and will always arrive first. if (initData != nullptr) { if (initData != nullptr) { Mutexed<Output>::Locked output(mOutput); Mutexed<Output>::Locked output(mOutput); if (output->buffers && outputFormat) { if (!output->buffers) { return false; } if (outputFormat) { output->buffers->updateSkipCutBuffer(outputFormat); output->buffers->updateSkipCutBuffer(outputFormat); output->buffers->setFormat(outputFormat); output->buffers->setFormat(outputFormat); } } Loading @@ -2105,7 +2108,7 @@ bool CCodecBufferChannel::handleWork( } } size_t index; size_t index; sp<MediaCodecBuffer> outBuffer; sp<MediaCodecBuffer> outBuffer; if (output->buffers && output->buffers->registerCsd(initData, &index, &outBuffer) == OK) { if (output->buffers->registerCsd(initData, &index, &outBuffer) == OK) { outBuffer->meta()->setInt64("timeUs", timestamp.peek()); outBuffer->meta()->setInt64("timeUs", timestamp.peek()); outBuffer->meta()->setInt32("flags", BUFFER_FLAG_CODEC_CONFIG); outBuffer->meta()->setInt32("flags", BUFFER_FLAG_CODEC_CONFIG); ALOGV("[%s] onWorkDone: csd index = %zu [%p]", mName, index, outBuffer.get()); ALOGV("[%s] onWorkDone: csd index = %zu [%p]", mName, index, outBuffer.get()); Loading Loading
media/codec2/components/avc/C2SoftAvcEnc.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -334,7 +334,10 @@ public: // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. For Level 1b, we want to update the level anyway, // the requirements. For Level 1b, we want to update the level anyway, // so we set it to true in that case. // so we set it to true in that case. bool needsUpdate = (me.v.level == LEVEL_AVC_1B); bool needsUpdate = false; if (me.v.level == LEVEL_AVC_1B || !me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (mbs <= limit.mbs && mbsPerSec <= limit.mbsPerSec && if (mbs <= limit.mbs && mbsPerSec <= limit.mbsPerSec && bitrate.v.value <= limit.bitrate) { bitrate.v.value <= limit.bitrate) { Loading
media/codec2/components/hevc/C2SoftHevcEnc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -341,6 +341,9 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams { // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. // the requirements. bool needsUpdate = false; bool needsUpdate = false; if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && bitrate.v.value <= limit.bitrate) { bitrate.v.value <= limit.bitrate) { Loading
media/codec2/components/mpeg4_h263/C2SoftMpeg4Enc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -243,6 +243,9 @@ class C2SoftMpeg4Enc::IntfImpl : public SimpleInterface<void>::BaseParams { needsUpdate = true; needsUpdate = true; } } #endif #endif if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits &limit : kLimits) { for (const LevelLimits &limit : kLimits) { if (sampleRate <= limit.sampleRate && size.v.width <= limit.width && if (sampleRate <= limit.sampleRate && size.v.width <= limit.width && vbvSize <= limit.vbvSize && size.v.height <= limit.height && vbvSize <= limit.vbvSize && size.v.height <= limit.height && Loading
media/codec2/components/vpx/C2SoftVpxEnc.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -263,6 +263,9 @@ C2R C2SoftVpxEnc::IntfImpl::ProfileLevelSetter(bool mayBlock, // By default needsUpdate = false in case the supplied level does meet // By default needsUpdate = false in case the supplied level does meet // the requirements. // the requirements. bool needsUpdate = false; bool needsUpdate = false; if (!me.F(me.v.level).supportsAtAll(me.v.level)) { needsUpdate = true; } for (const LevelLimits& limit : kLimits) { for (const LevelLimits& limit : kLimits) { if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && if (samples <= limit.samples && samplesPerSec <= limit.samplesPerSec && bitrate.v.value <= limit.bitrate && dimension <= limit.dimension) { bitrate.v.value <= limit.bitrate && dimension <= limit.dimension) { Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -2096,7 +2096,10 @@ bool CCodecBufferChannel::handleWork( // csd cannot be re-ordered and will always arrive first. // csd cannot be re-ordered and will always arrive first. if (initData != nullptr) { if (initData != nullptr) { Mutexed<Output>::Locked output(mOutput); Mutexed<Output>::Locked output(mOutput); if (output->buffers && outputFormat) { if (!output->buffers) { return false; } if (outputFormat) { output->buffers->updateSkipCutBuffer(outputFormat); output->buffers->updateSkipCutBuffer(outputFormat); output->buffers->setFormat(outputFormat); output->buffers->setFormat(outputFormat); } } Loading @@ -2105,7 +2108,7 @@ bool CCodecBufferChannel::handleWork( } } size_t index; size_t index; sp<MediaCodecBuffer> outBuffer; sp<MediaCodecBuffer> outBuffer; if (output->buffers && output->buffers->registerCsd(initData, &index, &outBuffer) == OK) { if (output->buffers->registerCsd(initData, &index, &outBuffer) == OK) { outBuffer->meta()->setInt64("timeUs", timestamp.peek()); outBuffer->meta()->setInt64("timeUs", timestamp.peek()); outBuffer->meta()->setInt32("flags", BUFFER_FLAG_CODEC_CONFIG); outBuffer->meta()->setInt32("flags", BUFFER_FLAG_CODEC_CONFIG); ALOGV("[%s] onWorkDone: csd index = %zu [%p]", mName, index, outBuffer.get()); ALOGV("[%s] onWorkDone: csd index = %zu [%p]", mName, index, outBuffer.get()); Loading