| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void SendLog(const LogCallback& log_callback,
const char* func_name,
const std::string& message,
AudioObjectPropertySelector property_selector,
AudioObjectID audio_object_id,
OSStatus result = noErr);Why is it public?
std::optional<std::string> GetDeviceName(AudioObjectID device_id);Why do we need them to be public?
void SendLog(const LogCallback& log_callback,If not public - place into an unnamed namespace?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Note: we don't need to do any drive-by improvements here, even though some stuff is not as neat as it should be.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void SendLog(const LogCallback& log_callback,
const char* func_name,
const std::string& message,
AudioObjectPropertySelector property_selector,
AudioObjectID audio_object_id,
OSStatus result = noErr);Palak AgarwalWhy is it public?
You're right, this one doesn't need to be.
std::optional<std::string> GetDeviceName(AudioObjectID device_id);Why do we need them to be public?
It's in preparation for the next change where I'll have them as private members of the class so that it can use the log_callback_ member that we will introduce.
If not public - place into an unnamed namespace?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
std::optional<std::string> GetDeviceName(AudioObjectID device_id);Palak AgarwalWhy do we need them to be public?
It's in preparation for the next change where I'll have them as private members of the class so that it can use the log_callback_ member that we will introduce.
I think I need to see this in context. To be clear: we cannot call these functions for the purpose of only getting the info to log. These are system calls, expensive and failure-prone.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
std::optional<std::string> GetDeviceName(AudioObjectID device_id);Palak AgarwalWhy do we need them to be public?
Olga SharonovaIt's in preparation for the next change where I'll have them as private members of the class so that it can use the log_callback_ member that we will introduce.
I think I need to see this in context. To be clear: we cannot call these functions for the purpose of only getting the info to log. These are system calls, expensive and failure-prone.
Okay, removing them. Also added the follow-up change that adds the enumeration callback
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
std::optional<std::string> GetDeviceName(AudioObjectID device_id) {
return GetDeviceStringProperty(device_id, kAudioObjectPropertyName);
}
std::optional<std::string> GetDeviceModel(AudioObjectID device_id) {
return GetDeviceStringProperty(device_id, kAudioDevicePropertyModelUID);
}Why do you keep doing this? I think they improve readability, and it's also just matter of taste, so if the authors/owners decided to have them - why to remove them?
const char* func_name = __func__;No need, ``__func__`` is already const char[]
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
std::optional<std::string> GetDeviceName(AudioObjectID device_id) {
return GetDeviceStringProperty(device_id, kAudioObjectPropertyName);
}
std::optional<std::string> GetDeviceModel(AudioObjectID device_id) {
return GetDeviceStringProperty(device_id, kAudioDevicePropertyModelUID);
}Why do you keep doing this? I think they improve readability, and it's also just matter of taste, so if the authors/owners decided to have them - why to remove them?
My thinking is - it just has a single usage and we will have to pass a log callback to it to get logs, making it more verbose. But if you want it, then we can keep it.
No need, ``__func__`` is already const char[]
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Note: we don't need to do any drive-by improvements here, even though some stuff is not as neat as it should be.
Acknowledged
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Enhance Mac CoreAudio diagnostic logging
This change introduces a SendLog helper function to format and send log
messages (including OSStatus error descriptions) via the provided
LogCallback.
This CL will be followed up by a change that will pass the
AudioManager::LogCallback into CoreAudio utility functions to provide
better diagnostic information during audio device operations on macOS.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |