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

Commit a4788bdd authored by Leena Winterrowd's avatar Leena Winterrowd Committed by Steve Kondik
Browse files

OMXCodec: Only set B Frames for QC components

Conditionally set B frames for Qualcomm components only instead
of for all components.

Change-Id: Ib626a6a4fb613874d17e78420ef2ca4684ac1c89
parent 083f5af8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1415,7 +1415,7 @@ status_t OMXCodec::setupMPEG4EncoderParameters(const sp<MetaData>& meta) {
    mpeg4type.eProfile = static_cast<OMX_VIDEO_MPEG4PROFILETYPE>(profileLevel.mProfile);
    mpeg4type.eLevel = static_cast<OMX_VIDEO_MPEG4LEVELTYPE>(profileLevel.mLevel);

    QCUtils::setBFrames(mpeg4type, mNumBFrames);
    QCUtils::setBFrames(mpeg4type, mNumBFrames, mComponentName);
    err = mOMX->setParameter(
            mNode, OMX_IndexParamVideoMpeg4, &mpeg4type, sizeof(mpeg4type));
    CHECK_EQ(err, (status_t)OK);
@@ -1489,7 +1489,7 @@ status_t OMXCodec::setupAVCEncoderParameters(const sp<MetaData>& meta) {
        h264type.nCabacInitIdc = 0;
    }

    QCUtils::setBFrames(h264type, mNumBFrames, iFramesInterval, frameRate);
    QCUtils::setBFrames(h264type, mNumBFrames, iFramesInterval, frameRate, mComponentName);
    if (h264type.nBFrames != 0) {
        h264type.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeB;
    }
+10 −4
Original line number Diff line number Diff line
@@ -244,7 +244,10 @@ bool QCUtils::ShellProp::isSmoothStreamingEnabled() {
}

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames) {
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames, char* componentName) {
    if (strncmp(componentName, "OMX.qcom.", 9) != 0) {
        return;
    }
    if (mpeg4type.eProfile > OMX_VIDEO_MPEG4ProfileSimple) {
        mpeg4type.nAllowedPictureTypes |= OMX_VIDEO_PictureTypeB;
        mpeg4type.nBFrames = 1;
@@ -256,7 +259,10 @@ void QCUtils::setBFrames(

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_AVCTYPE &h264type, bool &numBFrames,
        int32_t iFramesInterval, int32_t frameRate) {
        int32_t iFramesInterval, int32_t frameRate, char* componentName) {
    if (strncmp(componentName, "OMX.qcom.", 9) != 0) {
        return;
    }
    OMX_U32 val = 0;
    if (iFramesInterval < 0) {
        val =  0xFFFFFFFF;
@@ -616,12 +622,12 @@ bool QCUtils::ShellProp::isSmoothStreamingEnabled() {
}

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames) {
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames, char* componentName) {
}

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_AVCTYPE &h264type, bool &numBFrames,
        int32_t iFramesInterval, int32_t frameRate) {
        int32_t iFramesInterval, int32_t frameRate, char* componentName) {
}

bool QCUtils::UseQCHWAACEncoder(audio_encoder Encoder,int32_t Channel,
+2 −2
Original line number Diff line number Diff line
@@ -109,11 +109,11 @@ struct QCUtils {
    };

    //set B frames for MPEG4
    static void setBFrames(OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames);
    static void setBFrames(OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames, char* componentName);

    //set B frames for H264
    static void setBFrames(OMX_VIDEO_PARAM_AVCTYPE &h264type, bool &numBFrames,
            int32_t iFramesInterval, int32_t frameRate);
            int32_t iFramesInterval, int32_t frameRate, char* componentName);

    static bool UseQCHWAACEncoder(audio_encoder Encoder,int32_t Channel,int32_t BitRate, int32_t SampleRate);