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

Commit 9c3b8dd7 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7402811 from 844ef1be to sc-release

Change-Id: I8f83087d4085750bba3815c8aa7042ef1d65fe04
parents bd6dd5f0 844ef1be
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ apex {
    name: "com.android.media",
    manifest: "manifest.json",
    defaults: ["com.android.media-defaults"],
    prebuilts: ["current_sdkinfo"],
}

linker_config {
+3 −3
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@ license {
    ],
}

cc_library_shared {
cc_library {
    name: "libdownmix",

    host_supported: true,
    vendor: true,
    srcs: ["EffectDownmix.c"],
    srcs: ["EffectDownmix.cpp"],

    shared_libs: [
        "libaudioutils",
+215 −195

File changed and moved.

Preview size limit exceeded, changes collapsed.

+2 −81
Original line number Diff line number Diff line
@@ -18,88 +18,9 @@
#define ANDROID_EFFECTDOWNMIX_H_

#include <audio_effects/effect_downmix.h>
#include <audio_utils/primitives.h>
#include <system/audio.h>

/*------------------------------------
 * definitions
 *------------------------------------
*/

#define DOWNMIX_OUTPUT_CHANNELS AUDIO_CHANNEL_OUT_STEREO
#define LVM_FLOAT float

typedef enum {
    DOWNMIX_STATE_UNINITIALIZED,
    DOWNMIX_STATE_INITIALIZED,
    DOWNMIX_STATE_ACTIVE,
} downmix_state_t;

/* parameters for each downmixer */
typedef struct {
    downmix_state_t state;
    downmix_type_t type;
    bool apply_volume_correction;
    uint8_t input_channel_count;
} downmix_object_t;


typedef struct downmix_module_s {
    const struct effect_interface_s *itfe;
    effect_config_t config;
    downmix_object_t context;
} downmix_module_t;

const uint32_t kSides = AUDIO_CHANNEL_OUT_SIDE_LEFT | AUDIO_CHANNEL_OUT_SIDE_RIGHT;
const uint32_t kBacks = AUDIO_CHANNEL_OUT_BACK_LEFT | AUDIO_CHANNEL_OUT_BACK_RIGHT;
const uint32_t kUnsupported =
        AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER |
        AUDIO_CHANNEL_OUT_TOP_CENTER |
        AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT |
        AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER |
        AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT |
        AUDIO_CHANNEL_OUT_TOP_BACK_LEFT |
        AUDIO_CHANNEL_OUT_TOP_BACK_CENTER |
        AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT;

/*------------------------------------
 * Effect API
 *------------------------------------
*/
int32_t DownmixLib_Create(const effect_uuid_t *uuid,
        int32_t sessionId,
        int32_t ioId,
        effect_handle_t *pHandle);
int32_t DownmixLib_Release(effect_handle_t handle);
int32_t DownmixLib_GetDescriptor(const effect_uuid_t *uuid,
        effect_descriptor_t *pDescriptor);

static int Downmix_Process(effect_handle_t self,
        audio_buffer_t *inBuffer,
        audio_buffer_t *outBuffer);
static int Downmix_Command(effect_handle_t self,
        uint32_t cmdCode,
        uint32_t cmdSize,
        void *pCmdData,
        uint32_t *replySize,
        void *pReplyData);
static int Downmix_GetDescriptor(effect_handle_t self,
        effect_descriptor_t *pDescriptor);


/*------------------------------------
 * internal functions
 *------------------------------------
*/
int Downmix_Init(downmix_module_t *pDwmModule);
int Downmix_Configure(downmix_module_t *pDwmModule, effect_config_t *pConfig, bool init);
int Downmix_Reset(downmix_object_t *pDownmixer, bool init);
int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t size, void *pValue);
int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t *pSize, void *pValue);
void Downmix_foldFromQuad(LVM_FLOAT *pSrc, LVM_FLOAT *pDst, size_t numFrames, bool accumulate);
void Downmix_foldFrom5Point1(LVM_FLOAT *pSrc, LVM_FLOAT *pDst, size_t numFrames, bool accumulate);
void Downmix_foldFrom7Point1(LVM_FLOAT *pSrc, LVM_FLOAT *pDst, size_t numFrames, bool accumulate);
bool Downmix_foldGeneric(
        uint32_t mask, LVM_FLOAT *pSrc, LVM_FLOAT *pDst, size_t numFrames, bool accumulate);
// Use the following declaration to obtain the Downmix library information.
// extern audio_effect_library_t AUDIO_EFFECT_LIBRARY_INFO_SYM;

#endif /*ANDROID_EFFECTDOWNMIX_H_*/
+38 −0
Original line number Diff line number Diff line
// Build testbench for downmix module.
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_av_media_libeffects_downmix_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: [
        "frameworks_av_media_libeffects_downmix_license",
    ],
}

cc_benchmark {
    name: "downmix_benchmark",
    host_supported: false,
    vendor: true,
    include_dirs: [
        "frameworks/av/media/libeffects/downmix",
    ],
    header_libs: [
        "libaudioeffects",
    ],
    shared_libs: [
        "liblog",
    ],
    static_libs: [
        "libaudioutils",
        "libdownmix",
    ],
    srcs: [
        "downmix_benchmark.cpp",
    ],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wextra",
    ],
}
Loading