Loading system/audio_bluetooth_hw/audio_bluetooth_hw.cc +3 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ static int adev_get_mic_mute(const struct audio_hw_device* dev, bool* state) { static int adev_dump(const audio_hw_device_t* device, int fd) { return 0; } static int adev_close(hw_device_t* device) { free(device); auto* bluetooth_device = reinterpret_cast<BluetoothAudioDevice*>(device); delete bluetooth_device; return 0; } Loading @@ -111,7 +112,7 @@ static int adev_open(const hw_module_t* module, const char* name, LOG(VERBOSE) << __func__ << ": name=[" << name << "]"; if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) return -EINVAL; auto bluetooth_audio_device = new BluetoothAudioDevice; auto bluetooth_audio_device = new BluetoothAudioDevice{}; struct audio_hw_device* adev = &bluetooth_audio_device->audio_device_; if (!adev) return -ENOMEM; Loading system/audio_bluetooth_hw/stream_apis.cc +1 −1 Original line number Diff line number Diff line Loading @@ -635,7 +635,7 @@ int adev_open_output_stream(struct audio_hw_device* dev, struct audio_stream_out** stream_out, const char* address __unused) { *stream_out = nullptr; auto* out = new BluetoothStreamOut; auto* out = new BluetoothStreamOut{}; if (!out->bluetooth_output_.SetUp(devices)) { delete out; return -EINVAL; Loading system/audio_bluetooth_hw/stream_apis.h +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ std::ostream& operator<<(std::ostream& os, const BluetoothStreamState& state); struct BluetoothStreamOut { // Must be the first member so it can be cast from audio_stream // or audio_stream_out pointer audio_stream_out stream_out_; audio_stream_out stream_out_{}; ::android::bluetooth::audio::BluetoothAudioPortOut bluetooth_output_; int64_t last_write_time_us_; // Audio PCM Configs Loading @@ -66,7 +66,7 @@ struct BluetoothStreamOut { struct BluetoothAudioDevice { // Important: device must be first as an audio_hw_device* may be cast to // BluetoothAudioDevice* when the type is implicitly known. audio_hw_device audio_device_; audio_hw_device audio_device_{}; // protect against device->output and stream_out from being inconsistent std::mutex mutex_; std::list<BluetoothStreamOut*> opened_stream_outs_ = Loading Loading
system/audio_bluetooth_hw/audio_bluetooth_hw.cc +3 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ static int adev_get_mic_mute(const struct audio_hw_device* dev, bool* state) { static int adev_dump(const audio_hw_device_t* device, int fd) { return 0; } static int adev_close(hw_device_t* device) { free(device); auto* bluetooth_device = reinterpret_cast<BluetoothAudioDevice*>(device); delete bluetooth_device; return 0; } Loading @@ -111,7 +112,7 @@ static int adev_open(const hw_module_t* module, const char* name, LOG(VERBOSE) << __func__ << ": name=[" << name << "]"; if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) return -EINVAL; auto bluetooth_audio_device = new BluetoothAudioDevice; auto bluetooth_audio_device = new BluetoothAudioDevice{}; struct audio_hw_device* adev = &bluetooth_audio_device->audio_device_; if (!adev) return -ENOMEM; Loading
system/audio_bluetooth_hw/stream_apis.cc +1 −1 Original line number Diff line number Diff line Loading @@ -635,7 +635,7 @@ int adev_open_output_stream(struct audio_hw_device* dev, struct audio_stream_out** stream_out, const char* address __unused) { *stream_out = nullptr; auto* out = new BluetoothStreamOut; auto* out = new BluetoothStreamOut{}; if (!out->bluetooth_output_.SetUp(devices)) { delete out; return -EINVAL; Loading
system/audio_bluetooth_hw/stream_apis.h +2 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ std::ostream& operator<<(std::ostream& os, const BluetoothStreamState& state); struct BluetoothStreamOut { // Must be the first member so it can be cast from audio_stream // or audio_stream_out pointer audio_stream_out stream_out_; audio_stream_out stream_out_{}; ::android::bluetooth::audio::BluetoothAudioPortOut bluetooth_output_; int64_t last_write_time_us_; // Audio PCM Configs Loading @@ -66,7 +66,7 @@ struct BluetoothStreamOut { struct BluetoothAudioDevice { // Important: device must be first as an audio_hw_device* may be cast to // BluetoothAudioDevice* when the type is implicitly known. audio_hw_device audio_device_; audio_hw_device audio_device_{}; // protect against device->output and stream_out from being inconsistent std::mutex mutex_; std::list<BluetoothStreamOut*> opened_stream_outs_ = Loading