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

Commit 497419fc authored by Mingming Yin's avatar Mingming Yin
Browse files

hal: compilation fix for extended feature flags

- Fix compilation error for offload, Dolby,
  HDMI pass through, FLAC decoder, and hardware
  accelerated effects when extended feature
  flags are disabled.

Change-Id: I5b36d7668f63a396ed930d62c0337c2c3f311c95
parent 18175cc5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ namespace android {
        struct dirent* in_file;
        int fd;
        String8 path;
        String8 d_name;

        if ((dp = opendir(events_dir)) == NULL) {
            ALOGE("Cannot open switch directory to get list of audio events %s", events_dir);
@@ -148,8 +149,9 @@ namespace android {
            if (fd == -1) {
                ALOGE("Open %s failed : %s", path.string(), strerror(errno));
            } else {
                mAudioEvents.push_back(std::make_pair(in_file->d_name, fd));
                mAudioEventsStatus.push_back(std::make_pair(in_file->d_name, 0));
                d_name = in_file->d_name;
                mAudioEvents.push_back(std::make_pair(d_name, fd));
                mAudioEventsStatus.push_back(std::make_pair(d_name, 0));
                ALOGD("event status mAudioEventsStatus= %s",
                          mAudioEventsStatus[0].first.string());
            }
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_EDID)),true)
    LOCAL_CFLAGS += -DHDMI_EDID
    LOCAL_SRC_FILES += edid.c
endif

+6 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@
#define AUDIO_FORMAT_PCM_24_BIT_OFFLOAD (AUDIO_FORMAT_PCM_OFFLOAD | AUDIO_FORMAT_PCM_SUB_8_24_BIT)
#define AUDIO_OFFLOAD_CODEC_FORMAT  "music_offload_codec_format"
#define audio_is_offload_pcm(format) (0)
#define OFFLOAD_USE_SMALL_BUFFER false
#else
#define OFFLOAD_USE_SMALL_BUFFER (info->use_small_bufs)
#endif

#ifndef AFE_PROXY_ENABLED
@@ -316,6 +319,9 @@ void audio_extn_check_and_set_dts_hpx_state(const struct audio_device *adev);
void audio_extn_dolby_set_dmid(struct audio_device *adev);
#else
#define audio_extn_dolby_set_dmid(adev)                 (0)
#define AUDIO_CHANNEL_OUT_PENTA (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER)
#define AUDIO_CHANNEL_OUT_SURROUND (AUDIO_CHANNEL_OUT_FRONT_LEFT | AUDIO_CHANNEL_OUT_FRONT_RIGHT | \
                                    AUDIO_CHANNEL_OUT_FRONT_CENTER | AUDIO_CHANNEL_OUT_BACK_CENTER)
#endif


+7 −2
Original line number Diff line number Diff line
@@ -71,7 +71,9 @@ const struct string_to_enum s_flag_name_to_enum_table[] = {
#ifdef COMPRESS_VOIP_ENABLED
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_VOIP_RX),
#endif
#ifdef HDMI_PASSTHROUGH_ENABLED
    STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH),
#endif
};

const struct string_to_enum s_format_name_to_enum_table[] = {
@@ -566,8 +568,11 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase)
    app_type_cfg[len++] = out->app_type_cfg.app_type;
    app_type_cfg[len++] = acdb_dev_id;
    if (((out->format == AUDIO_FORMAT_E_AC3) ||
        (out->format == AUDIO_FORMAT_E_AC3_JOC)) &&
        (out->flags  & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH))
        (out->format == AUDIO_FORMAT_E_AC3_JOC))
#ifdef HDMI_PASSTHROUGH_ENABLED
        && (out->flags  & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)
#endif
        )
        app_type_cfg[len++] = sample_rate * 4;
    else
        app_type_cfg[len++] = sample_rate;
+1 −1
Original line number Diff line number Diff line
@@ -2921,7 +2921,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        if (flags & AUDIO_OUTPUT_FLAG_NON_BLOCKING)
            out->non_blocking = 1;

        if (config->offload_info.use_small_bufs) {
        if (platform_use_small_buffer(&config->offload_info)) {
            //this flag is set from framework only if its for PCM formats
            //no need to check for PCM format again
            out->non_blocking = 0;
Loading