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

Commit 5f15ff9b authored by Dhananjay Kumar's avatar Dhananjay Kumar
Browse files

post_proc: add PBE effect for speaker

Enable PBE for speaker device.

Change-Id: I1a48dff038baf63376f1d4b355888159cf69ba81
parent 16b2dd39
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ endif
LOCAL_SHARED_LIBRARIES := \
	libcutils \
	liblog \
	libtinyalsa
	libtinyalsa \
	libdl

LOCAL_MODULE_TAGS := optional

+443 −56

File changed.

Preview size limit exceeded, changes collapsed.

+67 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -22,6 +22,13 @@

#include "bundle.h"

enum {
    BASS_INVALID = -1,
    BASS_BOOST = 0,      // index of bassboost
    BASS_PBE,        // index of PBE
    BASS_COUNT       // totol number of bass type
};

extern const effect_descriptor_t bassboost_descriptor;

typedef struct bassboost_context_s {
@@ -37,12 +44,51 @@ typedef struct bassboost_context_s {
    struct bass_boost_params offload_bass;
} bassboost_context_t;

int bassboost_get_parameter(effect_context_t *context, effect_param_t *p,
typedef struct pbe_context_s {
    effect_context_t common;

    // Offload vars
    struct mixer_ctl *ctl;
    int hw_acc_fd;
    bool temp_disabled;
    uint32_t device;
    struct pbe_params offload_pbe;
} pbe_context_t;

typedef struct bass_context_s {
    effect_context_t    common;
    bassboost_context_t bassboost_ctxt;
    pbe_context_t       pbe_ctxt;
    int                 active_index;
} bass_context_t;

int bass_get_parameter(effect_context_t *context, effect_param_t *p,
                       uint32_t *size);

int bassboost_set_parameter(effect_context_t *context, effect_param_t *p,
int bass_set_parameter(effect_context_t *context, effect_param_t *p,
                       uint32_t size);

int bass_set_device(effect_context_t *context,  uint32_t device);

int bass_set_mode(effect_context_t *context,  int32_t hw_acc_fd);

int bass_reset(effect_context_t *context);

int bass_init(effect_context_t *context);

int bass_enable(effect_context_t *context);

int bass_disable(effect_context_t *context);

int bass_start(effect_context_t *context, output_context_t *output);

int bass_stop(effect_context_t *context, output_context_t *output);


int bassboost_get_strength(bassboost_context_t *context);

int bassboost_set_strength(bassboost_context_t *context, uint32_t strength);

int bassboost_set_device(effect_context_t *context,  uint32_t device);

int bassboost_set_mode(effect_context_t *context,  int32_t hw_acc_fd);
@@ -59,4 +105,20 @@ int bassboost_start(effect_context_t *context, output_context_t *output);

int bassboost_stop(effect_context_t *context, output_context_t *output);

int pbe_set_device(effect_context_t *context,  uint32_t device);

int pbe_set_mode(effect_context_t *context,  int32_t hw_acc_fd);

int pbe_reset(effect_context_t *context);

int pbe_init(effect_context_t *context);

int pbe_enable(effect_context_t *context);

int pbe_disable(effect_context_t *context);

int pbe_start(effect_context_t *context, output_context_t *output);

int pbe_stop(effect_context_t *context, output_context_t *output);

#endif /* OFFLOAD_EFFECT_BASS_BOOST_H_ */
+14 −13

File changed.

Preview size limit exceeded, changes collapsed.

+78 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading