as typedef AudioTimestampSingleStateQueue and use it in MonoPipe.
Change-Id: Idaebb362bd9d0a81a7ed83792ab9369dc37c0e74
#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
LinearTransform mSamplesToLocalTime;
bool mIsShutdown; // whether shutdown(true) was called, no barriers are needed
+
+ AudioTimestampSingleStateQueue::Shared mTimestampShared;
+ AudioTimestampSingleStateQueue::Mutator mTimestampMutator;
+ AudioTimestampSingleStateQueue::Observer mTimestampObserver;
};
} // namespace android
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 \
#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
}
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)
// mWriteTs
mSetpoint((reqFrames * 11) / 16),
mWriteCanBlock(writeCanBlock),
- mIsShutdown(false)
+ mIsShutdown(false),
+ // mTimestampShared
+ mTimestampMutator(&mTimestampShared),
+ mTimestampObserver(&mTimestampShared)
{
CCHelper tmpHelper;
status_t res;