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

Commit 7e512c42 authored by Praveen Chavan's avatar Praveen Chavan Committed by Steve Kondik
Browse files

libstagefright: enable smooth-streaming based on shell property

Enable smoothstreaming in Acodec/OMXCodec if shell property
mm.enable.smoothstreaming is set to true.

Change-Id: Ic5d64623c3001144f36562c8abf4b5f7be42f1e0
parent 62c1cf88
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -187,9 +187,6 @@ ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS),true)
        LOCAL_C_INCLUDES += \
            $(TOP)/hardware/qcom/media/mm-core/inc
    endif
    ifeq ($(TARGET_ENABLE_DEFAULT_SMOOTHSTREAMING),true)
            LOCAL_CFLAGS += -DENABLE_DEFAULT_SMOOTHSTREAMING
    endif #TARGET_ENABLE_DEAFULT_SMOOTHSTREAMING
endif #TARGET_ENABLE_QC_AV_ENHANCEMENTS

include $(BUILD_SHARED_LIBRARY)
+6 −3
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include <OMX_QCOMExtns.h>
#include <OMX_Component.h>
#include <QOMX_AudioExtensions.h>
#include "include/QCUtils.h"

namespace android {

@@ -351,9 +352,11 @@ void ExtendedCodec::enableSmoothStreaming(
        const sp<IOMX> &omx, IOMX::node_id nodeID, bool* isEnabled,
        const char* componentName) {
    *isEnabled = false;
#ifndef ENABLE_DEFAULT_SMOOTHSTREAMING

    if (!QCUtils::ShellProp::isSmoothStreamingEnabled()) {
        return;
#endif
    }

    //ignore non QC components
    if (strncmp(componentName, "OMX.qcom.", 9)) {
        return;
+13 −0
Original line number Diff line number Diff line
@@ -202,6 +202,15 @@ void QCUtils::ShellProp::setEncoderprofile(
    }
}

bool QCUtils::ShellProp::isSmoothStreamingEnabled() {
    char prop[PROPERTY_VALUE_MAX] = {0};
    property_get("mm.enable.smoothstreaming", prop, "0");
    if (!strncmp(prop, "true", 4) || atoi(prop)) {
        return true;
    }
    return false;
}

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames) {
    if (mpeg4type.eProfile > OMX_VIDEO_MPEG4ProfileSimple) {
@@ -446,6 +455,10 @@ void QCUtils::ShellProp::setEncoderprofile(
        video_encoder &videoEncoder, int32_t &videoEncoderProfile) {
}

bool QCUtils::ShellProp::isSmoothStreamingEnabled() {
    return false;
}

void QCUtils::setBFrames(
        OMX_VIDEO_PARAM_MPEG4TYPE &mpeg4type, bool &numBFrames) {
}
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ struct QCUtils {
        //helper function to set encoding profiles
        static void setEncoderprofile(video_encoder &videoEncoder,
                int32_t &videoEncoderProfile);

        static bool isSmoothStreamingEnabled();
    };

    //set B frames for MPEG4