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

Commit 3ce53590 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Audio V4: *CNT and *MAX are no longer part of the enum



audio.h used to have *_CNT and *_MAX values in its enum
mostly for enum iteration.

This was not compatible with Treble as it denied any enum
inheritance.

*_CNT and *_MAX are now implemented with macro that can
be updated and are not part of the API.

Bug: 38184704
Test: Compile
Change-Id: I3921fdf3435ba114ca77a4595ba8fc97a5e0438d
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent 7c9123d1
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -308,8 +308,6 @@ const UsageTypeConverter::Table UsageTypeConverter::mTable[] = {
    MAKE_STRING_FROM_ENUM(AUDIO_USAGE_ASSISTANCE_SONIFICATION),
    MAKE_STRING_FROM_ENUM(AUDIO_USAGE_GAME),
    MAKE_STRING_FROM_ENUM(AUDIO_USAGE_VIRTUAL_SOURCE),
    MAKE_STRING_FROM_ENUM(AUDIO_USAGE_CNT),
    MAKE_STRING_FROM_ENUM(AUDIO_USAGE_MAX),
    TERMINATOR
};

@@ -325,8 +323,6 @@ const SourceTypeConverter::Table SourceTypeConverter::mTable[] = {
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_VOICE_COMMUNICATION),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_REMOTE_SUBMIX),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_UNPROCESSED),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_CNT),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_MAX),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_FM_TUNER),
    MAKE_STRING_FROM_ENUM(AUDIO_SOURCE_HOTWORD),
    TERMINATOR
+2 −2
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ StagefrightRecorder::StagefrightRecorder(const String16 &opPackageName)
    : MediaRecorderBase(opPackageName),
      mWriter(NULL),
      mOutputFd(-1),
      mAudioSource(AUDIO_SOURCE_CNT),
      mAudioSource((audio_source_t)AUDIO_SOURCE_CNT), // initialize with invalid value
      mVideoSource(VIDEO_SOURCE_LIST_END),
      mStarted(false),
      mSelectedDeviceId(AUDIO_PORT_HANDLE_NONE),
@@ -2047,7 +2047,7 @@ status_t StagefrightRecorder::reset() {
    stop();

    // No audio or video source by default
    mAudioSource = AUDIO_SOURCE_CNT;
    mAudioSource = (audio_source_t)AUDIO_SOURCE_CNT; // reset to invalid value
    mVideoSource = VIDEO_SOURCE_LIST_END;

    // Default parameters