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

Commit 1e863b6e authored by Hayden Gomes's avatar Hayden Gomes Committed by Automerger Merge Worker
Browse files

Merge "Updating AudioFormat to handle CHANNEL_IN_DEFAULT" into rvc-dev am: ee678751

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11854112

Change-Id: Icb2bb50619ef0a803b5c75dc238dc778c43ed1b4
parents 62e44430 ee678751
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@

#define CHANNEL_INVALID 0
#define CHANNEL_OUT_DEFAULT 1
#define CHANNEL_IN_DEFAULT 1

static inline audio_format_t audioFormatToNative(int audioFormat)
{
@@ -196,12 +197,22 @@ static inline int outChannelMaskFromNative(audio_channel_mask_t nativeMask)

static inline audio_channel_mask_t inChannelMaskToNative(int channelMask)
{
    switch (channelMask) {
        case CHANNEL_IN_DEFAULT:
            return AUDIO_CHANNEL_NONE;
        default:
            return (audio_channel_mask_t)channelMask;
    }
}

static inline int inChannelMaskFromNative(audio_channel_mask_t nativeMask)
{
    switch (nativeMask) {
        case AUDIO_CHANNEL_NONE:
            return CHANNEL_IN_DEFAULT;
        default:
            return (int)nativeMask;
    }
}

#endif // ANDROID_MEDIA_AUDIOFORMAT_H