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

Commit af685c66 authored by Rakesh Kumar's avatar Rakesh Kumar Committed by Cherrypicker Worker
Browse files

StagefrightRecoder: Disabling B-frame support

Disabling b-frame support from stagefright recorder in case of
audio source as mic and video source is surface use case only
because screen recorder with microphone doesn't play in sync
if b-frame is enabled.
If the audio source selected is INTERNAL (i.e. device) or
MIC_AND_INTERNAL with screen recorder then b frame is supported.

Bug: 288549440
Test: manual
Merged-In: I4098655eb9687fb633085333bc140634441566e6
Change-Id: I4098655eb9687fb633085333bc140634441566e6
parent 6554bddd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2119,6 +2119,11 @@ status_t StagefrightRecorder::setupVideoEncoder(

    if (tsLayers > 1) {
        uint32_t bLayers = std::min(2u, tsLayers - 1); // use up-to 2 B-layers
        // TODO(b/341121900): Remove this once B frames are handled correctly in screen recorder
        // use case in case of mic only
        if (mAudioSource == AUDIO_SOURCE_MIC && mVideoSource == VIDEO_SOURCE_SURFACE) {
            bLayers = 0;
        }
        uint32_t pLayers = tsLayers - bLayers;
        format->setString(
                "ts-schema", AStringPrintf("android.generic.%u+%u", pLayers, bLayers));