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

Commit 43b869d6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ACodec: enable B frame support for AVC"

parents e5183201 1f2f5058
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -569,7 +569,6 @@ ACodec::ACodec()
      mFps(-1.0),
      mCaptureFps(-1.0),
      mCreateInputBuffersSuspended(false),
      mLatency(0),
      mTunneled(false),
      mDescribeColorAspectsIndex((OMX_INDEXTYPE)0),
      mDescribeHDRStaticInfoIndex((OMX_INDEXTYPE)0),
@@ -4425,12 +4424,13 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
            h264type.eProfile == OMX_VIDEO_AVCProfileHigh) {
        h264type.nSliceHeaderSpacing = 0;
        h264type.bUseHadamard = OMX_TRUE;
        h264type.nRefFrames = 2;
        h264type.nBFrames = mLatency == 0 ? 1 : std::min(1U, mLatency - 1);

        // disable B-frames until we have explicit settings for enabling the feature.
        h264type.nRefFrames = 1;
        h264type.nBFrames = 0;
        int32_t maxBframes = 0;
        (void)msg->findInt32(KEY_MAX_B_FRAMES, &maxBframes);
        h264type.nBFrames = uint32_t(maxBframes);
        if (mLatency && h264type.nBFrames > *mLatency) {
            h264type.nBFrames = *mLatency;
        }
        h264type.nRefFrames = h264type.nBFrames == 0 ? 1 : 2;

        h264type.nPFrames = setPFramesSpacing(iFrameInterval, frameRate, h264type.nBFrames);
        h264type.nAllowedPictureTypes =
+1 −1
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ private:
    double mFps;
    double mCaptureFps;
    bool mCreateInputBuffersSuspended;
    uint32_t mLatency;
    std::optional<uint32_t> mLatency;

    bool mTunneled;

+1 −0
Original line number Diff line number Diff line
@@ -772,6 +772,7 @@ constexpr char KEY_IS_TIMED_TEXT[] = "is-timed-text";
constexpr char KEY_LANGUAGE[] = "language";
constexpr char KEY_LATENCY[] = "latency";
constexpr char KEY_LEVEL[] = "level";
constexpr char KEY_MAX_B_FRAMES[] = "max-bframes";
constexpr char KEY_MAX_BIT_RATE[] = "max-bitrate";
constexpr char KEY_MAX_FPS_TO_ENCODER[] = "max-fps-to-encoder";
constexpr char KEY_MAX_HEIGHT[] = "max-height";