#include "media/base/channel_layout.h"
#include "media/base/limits.h"
#if BUILDFLAG(IS_TIZEN_TV)
+#include "build/tizen_version.h"
#include "media/audio/tizen/capi_bt_audio_input_stream.h"
#include "tizen_src/ewk/efl_integration/ewk_privilege_checker.h"
#define UNIQUE_BT_DEVICE_ID "1"
bool result = content::EwkPrivilegeChecker::GetInstance()->CheckPrivilege(
"http://developer.samsung.com/privilege/smartcontroller.microphone");
- if (!result)
+ if (!result) {
LOG(INFO) << "AudioManagerCapi::CheckSmartRCMicPrivilege = " << result;
+ }
return result;
}
#if BUILDFLAG(IS_TIZEN_TV)
sound_device_h device;
+#if !TIZEN_VERSION_AT_LEAST(9, 0, 0)
AudioDeviceNames device_names_built_in;
+#endif
while (sound_manager_get_next_device(list, &device) ==
SOUND_MANAGER_ERROR_NONE) {
int id;
LOG(INFO) << "Device - ID:" << id << ". Name:" << name
<< ". type:" << device_type;
-
+#if TIZEN_VERSION_AT_LEAST(9, 0, 0)
+ device_names->push_front(AudioDeviceName(name, std::to_string(id)));
+ }
+#else
if (device_type == SOUND_DEVICE_BUILTIN_MIC) {
device_names_built_in.push_back(
AudioDeviceName(name, std::to_string(id)));
device_names->insert(device_names->end(), device_names_built_in.begin(),
device_names_built_in.end());
+#endif
ret = sound_manager_free_device_list(list);
- if (ret != SOUND_MANAGER_ERROR_NONE)
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
LOG(INFO) << "Failed to free device list. Err:" << ret;
+ }
- if (device_names->empty())
+ if (device_names->empty()) {
device_names->push_front(AudioDeviceName::CreateDefault());
+ }
return;
#endif
std::unique_ptr<AudioDebugRecorder> AudioManagerCapi::CreateAudioDebugRecorder(
const AudioParameters& params) {
auto* debug_recording_manager = GetAudioDebugRecordingManager();
- if (!debug_recording_manager)
+ if (!debug_recording_manager) {
return {};
+ }
return debug_recording_manager->RegisterDebugRecordingSource(
AudioDebugRecordingStreamType::kInput, params);
sample_rate = media::GetAudioOutputSampleRate(
NULL, sample_rate, channel_layout, sample_format);
- if (!sample_rate)
+ if (!sample_rate) {
sample_rate = kDefaultSampleRate;
+ }
}
int capi_buffer_size = media::GetAudioOutputBufferSize(