Loading include/media/AudioTrack.h +12 −3 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ public: * pid: Process ID of the app which initially requested this AudioTrack * for power management tracking, or -1 for current process ID. * pAttributes: If not NULL, supersedes streamType for use case selection. * doNotReconnect: If set to true, AudioTrack won't automatically recreate the IAudioTrack binder to AudioFlinger. It will return an error instead. The application will recreate the track based on offloading or different channel configuration, etc. * threadCanCallJava: Not present in parameter list, and so is fixed at false. */ Loading @@ -200,7 +204,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Creates an audio track and registers it with AudioFlinger. * With this constructor, the track is configured for static buffer mode. Loading Loading @@ -228,7 +233,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Terminates the AudioTrack and unregisters it from AudioFlinger. * Also destroys all resources associated with the AudioTrack. Loading Loading @@ -272,7 +278,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Result of constructing the AudioTrack. This must be checked for successful initialization * before using any AudioTrack API (except for set()), because using Loading Loading @@ -877,6 +884,8 @@ protected: // const after set(), except for bits AUDIO_OUTPUT_FLAG_FAST and AUDIO_OUTPUT_FLAG_OFFLOAD. // mLock must be held to read or write those bits reliably. bool mDoNotReconnect; int mSessionId; int mAuxEffectId; Loading include/media/MediaPlayerInterface.h +2 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,8 @@ public: AudioCallback cb = NULL, void *cookie = NULL, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL) = 0; const audio_offload_info_t *offloadInfo = NULL, bool doNotResuscitate = false) = 0; virtual status_t start() = 0; Loading media/libmedia/AudioTrack.cpp +10 −6 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ AudioTrack::AudioTrack( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), Loading @@ -189,7 +190,7 @@ AudioTrack::AudioTrack( mStatus = set(streamType, sampleRate, format, channelMask, frameCount, flags, cbf, user, notificationFrames, 0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo, uid, pid, pAttributes); offloadInfo, uid, pid, pAttributes, doNotReconnect); } AudioTrack::AudioTrack( Loading @@ -207,7 +208,8 @@ AudioTrack::AudioTrack( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), Loading @@ -218,7 +220,7 @@ AudioTrack::AudioTrack( mStatus = set(streamType, sampleRate, format, channelMask, 0 /*frameCount*/, flags, cbf, user, notificationFrames, sharedBuffer, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo, uid, pid, pAttributes); uid, pid, pAttributes, doNotReconnect); } AudioTrack::~AudioTrack() Loading Loading @@ -266,7 +268,8 @@ status_t AudioTrack::set( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) { ALOGV("set(): streamType %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, " "flags #%x, notificationFrames %u, sessionId %d, transferType %d, uid %d, pid %d", Loading Loading @@ -308,6 +311,7 @@ status_t AudioTrack::set( } mSharedBuffer = sharedBuffer; mTransfer = transferType; mDoNotReconnect = doNotReconnect; ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(), sharedBuffer->size()); Loading Loading @@ -2006,7 +2010,7 @@ status_t AudioTrack::restoreTrack_l(const char *from) // output parameters and new IAudioFlinger in createTrack_l() AudioSystem::clearAudioConfigCache(); if (isOffloadedOrDirect_l()) { if (isOffloadedOrDirect_l() || mDoNotReconnect) { // FIXME re-creation of offloaded tracks is not yet implemented return DEAD_OBJECT; } Loading media/libmediaplayerservice/MediaPlayerService.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -1489,7 +1489,8 @@ status_t MediaPlayerService::AudioOutput::open( audio_format_t format, int bufferCount, AudioCallback cb, void *cookie, audio_output_flags_t flags, const audio_offload_info_t *offloadInfo) const audio_offload_info_t *offloadInfo, bool doNotReconnect) { mCallback = cb; mCallbackCookie = cookie; Loading Loading @@ -1605,7 +1606,8 @@ status_t MediaPlayerService::AudioOutput::open( offloadInfo, mUid, mPid, mAttributes); mAttributes, doNotReconnect); } else { t = new AudioTrack( mStreamType, Loading @@ -1622,7 +1624,8 @@ status_t MediaPlayerService::AudioOutput::open( NULL, // offload info mUid, mPid, mAttributes); mAttributes, doNotReconnect); } if ((t == 0) || (t->initCheck() != NO_ERROR)) { Loading media/libmediaplayerservice/MediaPlayerService.h +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ class MediaPlayerService : public BnMediaPlayerService audio_format_t format, int bufferCount, AudioCallback cb, void *cookie, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL); const audio_offload_info_t *offloadInfo = NULL, bool doNotReconnect = false); virtual status_t start(); virtual ssize_t write(const void* buffer, size_t size, bool blocking = true); Loading Loading
include/media/AudioTrack.h +12 −3 Original line number Diff line number Diff line Loading @@ -183,6 +183,10 @@ public: * pid: Process ID of the app which initially requested this AudioTrack * for power management tracking, or -1 for current process ID. * pAttributes: If not NULL, supersedes streamType for use case selection. * doNotReconnect: If set to true, AudioTrack won't automatically recreate the IAudioTrack binder to AudioFlinger. It will return an error instead. The application will recreate the track based on offloading or different channel configuration, etc. * threadCanCallJava: Not present in parameter list, and so is fixed at false. */ Loading @@ -200,7 +204,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Creates an audio track and registers it with AudioFlinger. * With this constructor, the track is configured for static buffer mode. Loading Loading @@ -228,7 +233,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Terminates the AudioTrack and unregisters it from AudioFlinger. * Also destroys all resources associated with the AudioTrack. Loading Loading @@ -272,7 +278,8 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, const audio_attributes_t* pAttributes = NULL); const audio_attributes_t* pAttributes = NULL, bool doNotReconnect = false); /* Result of constructing the AudioTrack. This must be checked for successful initialization * before using any AudioTrack API (except for set()), because using Loading Loading @@ -877,6 +884,8 @@ protected: // const after set(), except for bits AUDIO_OUTPUT_FLAG_FAST and AUDIO_OUTPUT_FLAG_OFFLOAD. // mLock must be held to read or write those bits reliably. bool mDoNotReconnect; int mSessionId; int mAuxEffectId; Loading
include/media/MediaPlayerInterface.h +2 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,8 @@ public: AudioCallback cb = NULL, void *cookie = NULL, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL) = 0; const audio_offload_info_t *offloadInfo = NULL, bool doNotResuscitate = false) = 0; virtual status_t start() = 0; Loading
media/libmedia/AudioTrack.cpp +10 −6 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ AudioTrack::AudioTrack( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), Loading @@ -189,7 +190,7 @@ AudioTrack::AudioTrack( mStatus = set(streamType, sampleRate, format, channelMask, frameCount, flags, cbf, user, notificationFrames, 0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo, uid, pid, pAttributes); offloadInfo, uid, pid, pAttributes, doNotReconnect); } AudioTrack::AudioTrack( Loading @@ -207,7 +208,8 @@ AudioTrack::AudioTrack( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), Loading @@ -218,7 +220,7 @@ AudioTrack::AudioTrack( mStatus = set(streamType, sampleRate, format, channelMask, 0 /*frameCount*/, flags, cbf, user, notificationFrames, sharedBuffer, false /*threadCanCallJava*/, sessionId, transferType, offloadInfo, uid, pid, pAttributes); uid, pid, pAttributes, doNotReconnect); } AudioTrack::~AudioTrack() Loading Loading @@ -266,7 +268,8 @@ status_t AudioTrack::set( const audio_offload_info_t *offloadInfo, int uid, pid_t pid, const audio_attributes_t* pAttributes) const audio_attributes_t* pAttributes, bool doNotReconnect) { ALOGV("set(): streamType %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, " "flags #%x, notificationFrames %u, sessionId %d, transferType %d, uid %d, pid %d", Loading Loading @@ -308,6 +311,7 @@ status_t AudioTrack::set( } mSharedBuffer = sharedBuffer; mTransfer = transferType; mDoNotReconnect = doNotReconnect; ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(), sharedBuffer->size()); Loading Loading @@ -2006,7 +2010,7 @@ status_t AudioTrack::restoreTrack_l(const char *from) // output parameters and new IAudioFlinger in createTrack_l() AudioSystem::clearAudioConfigCache(); if (isOffloadedOrDirect_l()) { if (isOffloadedOrDirect_l() || mDoNotReconnect) { // FIXME re-creation of offloaded tracks is not yet implemented return DEAD_OBJECT; } Loading
media/libmediaplayerservice/MediaPlayerService.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -1489,7 +1489,8 @@ status_t MediaPlayerService::AudioOutput::open( audio_format_t format, int bufferCount, AudioCallback cb, void *cookie, audio_output_flags_t flags, const audio_offload_info_t *offloadInfo) const audio_offload_info_t *offloadInfo, bool doNotReconnect) { mCallback = cb; mCallbackCookie = cookie; Loading Loading @@ -1605,7 +1606,8 @@ status_t MediaPlayerService::AudioOutput::open( offloadInfo, mUid, mPid, mAttributes); mAttributes, doNotReconnect); } else { t = new AudioTrack( mStreamType, Loading @@ -1622,7 +1624,8 @@ status_t MediaPlayerService::AudioOutput::open( NULL, // offload info mUid, mPid, mAttributes); mAttributes, doNotReconnect); } if ((t == 0) || (t->initCheck() != NO_ERROR)) { Loading
media/libmediaplayerservice/MediaPlayerService.h +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ class MediaPlayerService : public BnMediaPlayerService audio_format_t format, int bufferCount, AudioCallback cb, void *cookie, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL); const audio_offload_info_t *offloadInfo = NULL, bool doNotReconnect = false); virtual status_t start(); virtual ssize_t write(const void* buffer, size_t size, bool blocking = true); Loading