Loading media/libaaudio/src/legacy/AudioStreamRecord.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -98,12 +98,15 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) ALOGD("open(), request notificationFrames = %u, frameCount = %u", notificationFrames, (uint)frameCount); // Don't call mAudioRecord->setInputDevice() because it will be overwritten by set()! audio_port_handle_t selectedDeviceId = (getDeviceId() == AAUDIO_UNSPECIFIED) ? AUDIO_PORT_HANDLE_NONE : getDeviceId(); mAudioRecord = new AudioRecord( mOpPackageName // const String16& opPackageName TODO does not compile ); if (getDeviceId() != AAUDIO_UNSPECIFIED) { mAudioRecord->setInputDevice(getDeviceId()); } mAudioRecord->set( AUDIO_SOURCE_VOICE_RECOGNITION, getSampleRate(), Loading @@ -116,10 +119,11 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) false /*threadCanCallJava*/, AUDIO_SESSION_ALLOCATE, streamTransferType, flags // int uid = -1, // pid_t pid = -1, // const audio_attributes_t* pAttributes = nullptr flags, AUDIO_UID_INVALID, // DEFAULT uid -1, // DEFAULT pid NULL, // DEFAULT audio_attributes_t selectedDeviceId ); // Did we get a valid track? Loading media/libaaudio/src/legacy/AudioStreamTrack.cpp +20 −8 Original line number Diff line number Diff line Loading @@ -115,10 +115,13 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) ALOGD("open(), request notificationFrames = %d, frameCount = %u", notificationFrames, (uint)frameCount); mAudioTrack = new AudioTrack(); // TODO review if (getDeviceId() != AAUDIO_UNSPECIFIED) { mAudioTrack->setOutputDevice(getDeviceId()); } // Don't call mAudioTrack->setDeviceId() because it will be overwritten by set()! audio_port_handle_t selectedDeviceId = (getDeviceId() == AAUDIO_UNSPECIFIED) ? AUDIO_PORT_HANDLE_NONE : getDeviceId(); mAudioTrack = new AudioTrack(); mAudioTrack->set( (audio_stream_type_t) AUDIO_STREAM_MUSIC, getSampleRate(), Loading @@ -129,10 +132,19 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) callback, callbackData, notificationFrames, 0 /*sharedBuffer*/, false /*threadCanCallJava*/, 0, // DEFAULT sharedBuffer*/, false, // DEFAULT threadCanCallJava AUDIO_SESSION_ALLOCATE, streamTransferType streamTransferType, NULL, // DEFAULT audio_offload_info_t AUDIO_UID_INVALID, // DEFAULT uid -1, // DEFAULT pid NULL, // DEFAULT audio_attributes_t // WARNING - If doNotReconnect set true then audio stops after plugging and unplugging // headphones a few times. false, // DEFAULT doNotReconnect, 1.0f, // DEFAULT maxRequiredSpeed selectedDeviceId ); // Did we get a valid track? Loading Loading
media/libaaudio/src/legacy/AudioStreamRecord.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -98,12 +98,15 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) ALOGD("open(), request notificationFrames = %u, frameCount = %u", notificationFrames, (uint)frameCount); // Don't call mAudioRecord->setInputDevice() because it will be overwritten by set()! audio_port_handle_t selectedDeviceId = (getDeviceId() == AAUDIO_UNSPECIFIED) ? AUDIO_PORT_HANDLE_NONE : getDeviceId(); mAudioRecord = new AudioRecord( mOpPackageName // const String16& opPackageName TODO does not compile ); if (getDeviceId() != AAUDIO_UNSPECIFIED) { mAudioRecord->setInputDevice(getDeviceId()); } mAudioRecord->set( AUDIO_SOURCE_VOICE_RECOGNITION, getSampleRate(), Loading @@ -116,10 +119,11 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder) false /*threadCanCallJava*/, AUDIO_SESSION_ALLOCATE, streamTransferType, flags // int uid = -1, // pid_t pid = -1, // const audio_attributes_t* pAttributes = nullptr flags, AUDIO_UID_INVALID, // DEFAULT uid -1, // DEFAULT pid NULL, // DEFAULT audio_attributes_t selectedDeviceId ); // Did we get a valid track? Loading
media/libaaudio/src/legacy/AudioStreamTrack.cpp +20 −8 Original line number Diff line number Diff line Loading @@ -115,10 +115,13 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) ALOGD("open(), request notificationFrames = %d, frameCount = %u", notificationFrames, (uint)frameCount); mAudioTrack = new AudioTrack(); // TODO review if (getDeviceId() != AAUDIO_UNSPECIFIED) { mAudioTrack->setOutputDevice(getDeviceId()); } // Don't call mAudioTrack->setDeviceId() because it will be overwritten by set()! audio_port_handle_t selectedDeviceId = (getDeviceId() == AAUDIO_UNSPECIFIED) ? AUDIO_PORT_HANDLE_NONE : getDeviceId(); mAudioTrack = new AudioTrack(); mAudioTrack->set( (audio_stream_type_t) AUDIO_STREAM_MUSIC, getSampleRate(), Loading @@ -129,10 +132,19 @@ aaudio_result_t AudioStreamTrack::open(const AudioStreamBuilder& builder) callback, callbackData, notificationFrames, 0 /*sharedBuffer*/, false /*threadCanCallJava*/, 0, // DEFAULT sharedBuffer*/, false, // DEFAULT threadCanCallJava AUDIO_SESSION_ALLOCATE, streamTransferType streamTransferType, NULL, // DEFAULT audio_offload_info_t AUDIO_UID_INVALID, // DEFAULT uid -1, // DEFAULT pid NULL, // DEFAULT audio_attributes_t // WARNING - If doNotReconnect set true then audio stops after plugging and unplugging // headphones a few times. false, // DEFAULT doNotReconnect, 1.0f, // DEFAULT maxRequiredSpeed selectedDeviceId ); // Did we get a valid track? Loading