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

Commit 0f243bba authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Use system/audio to/from string converters in TypeConverter

Use of system functions eliminates the need for listing all enum
values in TypeConverter tables.

Slight changes in the converting functions:

1. 'channelMaskFromString' function now also accepts indexed
   masks.
2. Fixed UB in 'formatFromString' function.
3. Removed 'deviceFromString' function, use
   'DeviceConverter::fromString' instead.

Replaced direct includes of 'system/audio-base.h' with
includes of 'system/audio.h'.

Bug: 142480271
Test: m
Change-Id: I4f64a8b6164bb5ad94cbf1da1709cb379f4a75fa
parent e3bca196
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include "core/AudioGlobal.h"
#include <aaudio/AAudioTesting.h>
#include <math.h>
#include <system/audio-base.h>
#include <system/audio.h>
#include <assert.h>

#include "utility/AAudioUtilities.h"
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ bool stringToStreamType(const char *streamName, Type* type)

template <>
bool stringToStreamType(const char *streamName, audio_devices_t* type) {
    return deviceFromString(streamName, *type);
    return DeviceConverter::fromString(streamName, *type);
}

/** Parse a library xml note and push the result in libraries or return false on failure. */
+9 −376

File changed.

Preview size limit exceeded, changes collapsed.

+267 −56

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#include <MediaPlayerService.h>
#include <media/NdkMediaExtractor.h>
#include <media/stagefright/MediaCodec.h>
#include <system/audio-base.h>
#include <system/audio.h>

#include "StagefrightRecorder.h"

Loading