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

Commit c2e65a4c authored by Steve Kondik's avatar Steve Kondik
Browse files

libmedia: Featurize QCOM's VOIP feature

 * Not all targets will support this.

Change-Id: I89a444c9ac8be3dfcaeedb599179e31383fdfec2
parent a206c3e9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -79,6 +79,16 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
LOCAL_SRC_FILES += \
    IDirectTrack.cpp \
    IDirectTrackClient.cpp

ifeq ($(TARGET_QCOM_AUDIO_VARIANT),caf)
ifeq ($(BOARD_USES_ALSA_AUDIO),true)
    LOCAL_CFLAGS += -DQCOM_VOIP_ENABLED
else
ifeq ($(BOARD_QCOM_VOIP_ENABLED),true)
    LOCAL_CFLAGS += -DQCOM_VOIP_ENABLED
endif
endif
endif
endif

# for <cutils/atomic-inline.h>
+2 −0
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ status_t AudioTrack::set(
    mChannelCount = channelCount;

#ifdef QCOM_HARDWARE
#ifdef QCOM_VOIP_ENABLED
    if ((streamType == AUDIO_STREAM_VOICE_CALL)
         && (channelCount == 1)
         && ((sampleRate == 8000 || sampleRate == 16000)))
@@ -300,6 +301,7 @@ status_t AudioTrack::set(
        ALOGD("Turn on Direct Output for VOIP RX");
        flags = (audio_output_flags_t)(flags | AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT);
    }
#endif

    if ((audio_stream_type_t)streamType == AUDIO_STREAM_VOICE_CALL) {
        if (audio_is_linear_pcm(format)) {