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

Commit a07a1c2c authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Instantiate SingleStateQueue<AudioTimestamp>

as typedef AudioTimestampSingleStateQueue and use it in MonoPipe.

Change-Id: Idaebb362bd9d0a81a7ed83792ab9369dc37c0e74
parent 943ba3cc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,9 +20,12 @@
#include <time.h>
#include <utils/LinearTransform.h>
#include "NBAIO.h"
#include <media/SingleStateQueue.h>

namespace android {

typedef SingleStateQueue<AudioTimestamp> AudioTimestampSingleStateQueue;

// MonoPipe is similar to Pipe except:
//  - supports only a single reader, called MonoPipeReader
//  - write() cannot overrun; instead it will return a short actual count if insufficient space
@@ -130,6 +133,10 @@ private:
    LinearTransform mSamplesToLocalTime;

    bool            mIsShutdown;    // whether shutdown(true) was called, no barriers are needed

    AudioTimestampSingleStateQueue::Shared      mTimestampShared;
    AudioTimestampSingleStateQueue::Mutator     mTimestampMutator;
    AudioTimestampSingleStateQueue::Observer    mTimestampObserver;
};

}   // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ LOCAL_SRC_FILES += ../libnbaio/roundup.c
LOCAL_CFLAGS += -DANDROID_SMP=$(if $(findstring true,$(TARGET_CPU_SMP)),1,0)
LOCAL_SRC_FILES += SingleStateQueue.cpp
LOCAL_CFLAGS += -DSINGLE_STATE_QUEUE_INSTANTIATIONS='"SingleStateQueueInstantiations.cpp"'
# Consider a separate a library for SingleStateQueueInstantiations.

LOCAL_SHARED_LIBRARIES := \
	libui liblog libcutils libutils libbinder libsonivox libicuuc libexpat \
+2 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

#include <media/SingleStateQueue.h>
#include <private/media/StaticAudioTrackState.h>
#include <media/AudioTimestamp.h>

// FIXME hack for gcc

namespace android {

template class SingleStateQueue<StaticAudioTrackState>; // typedef StaticAudioTrackSingleStateQueue
template class SingleStateQueue<AudioTimestamp>;        // typedef AudioTimestampSingleStateQueue

}
+4 −1
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ LOCAL_SHARED_LIBRARIES := \
    libcommon_time_client \
    libcutils \
    libutils \
    liblog
    liblog \
    libmedia
# This dependency on libmedia is for SingleStateQueueInstantiations.
# Consider a separate a library for SingleStateQueueInstantiations.

include $(BUILD_SHARED_LIBRARY)
+4 −1
Original line number Diff line number Diff line
@@ -42,7 +42,10 @@ MonoPipe::MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock) :
        // mWriteTs
        mSetpoint((reqFrames * 11) / 16),
        mWriteCanBlock(writeCanBlock),
        mIsShutdown(false)
        mIsShutdown(false),
        // mTimestampShared
        mTimestampMutator(&mTimestampShared),
        mTimestampObserver(&mTimestampShared)
{
    CCHelper tmpHelper;
    status_t res;