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

Commit c69a465e authored by Ankit Premrajka's avatar Ankit Premrajka Committed by Ricardo Cerqueira
Browse files

camcorder: disable audio temporarily.



- set property camcorder.debug.disableaudio 1 to disable audio encode

Patchset 1: Add QCOM_HARDWARE ifdefs.

Change-Id: I33b6ba1cfc45c83f7779ae1abe3fddb4631a309e
Signed-off-by: default avatarEvan McClain <aeroevan@gmail.com>
parent 9d14abf0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ LOCAL_C_INCLUDES := \
	$(TOP)/frameworks/base/media/libstagefright/rtsp                \
	$(TOP)/external/tremolo/Tremolo \

ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
	LOCAL_CFLAGS += -DQCOM_HARDWARE
endif

LOCAL_MODULE:= libmediaplayerservice

include $(BUILD_SHARED_LIBRARY)
+29 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@

#include "ARTPWriter.h"

#ifdef QCOM_HARDWARE
#include <cutils/properties.h>
#endif

namespace android {

// To collect the encoder usage for the battery app
@@ -69,7 +73,13 @@ StagefrightRecorder::StagefrightRecorder()
      mOutputFd(-1),
      mAudioSource(AUDIO_SOURCE_CNT),
      mVideoSource(VIDEO_SOURCE_LIST_END),
#ifdef QCOM_HARDWARE
      mStarted(false), mSurfaceMediaSource(NULL),
      mDisableAudio(false) {
#else
      mStarted(false), mSurfaceMediaSource(NULL) {
#endif


    LOGV("Constructor");
    reset();
@@ -101,6 +111,12 @@ status_t StagefrightRecorder::setAudioSource(audio_source_t as) {
        return BAD_VALUE;
    }

#ifdef QCOM_HARDWARE
    if (mDisableAudio) {
        return OK;
    }
#endif

    if (as == AUDIO_SOURCE_DEFAULT) {
        mAudioSource = AUDIO_SOURCE_MIC;
    } else {
@@ -152,6 +168,12 @@ status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) {
        return BAD_VALUE;
    }

#ifdef QCOM_HARDWARE
    if (mDisableAudio) {
        return OK;
    }
#endif

    if (ae == AUDIO_ENCODER_DEFAULT) {
        mAudioEncoder = AUDIO_ENCODER_AMR_NB;
    } else {
@@ -1664,6 +1686,13 @@ status_t StagefrightRecorder::reset() {

    mOutputFd = -1;

#ifdef QCOM_HARDWARE
    // Disable Audio Encoding
    char value[PROPERTY_VALUE_MAX];
    property_get("camcorder.debug.disableaudio", value, "0");
    if(atoi(value)) mDisableAudio = true;
#endif

    return OK;
}

+3 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ private:
    // will be sent to the client side using which the
    // frame buffers will be queued and dequeued
    sp<SurfaceMediaSource> mSurfaceMediaSource;
#ifdef QCOM_HARDWARE
    bool mDisableAudio;
#endif

    status_t setupMPEG4Recording(
        int outputFd,