#include "base/logging.h"
#include "media/audio/tizen/audio_manager_capi.h"
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "wrt/src/common/privilege.h"
+#endif
+
#include <sound_manager_internal.h>
namespace media {
+#if BUILDFLAG(IS_TIZEN_TV)
+constexpr char kMediaCapturePrivilege[] =
+ "http://tizen.org/privilege/mediacapture";
+#endif
+
CapiUsbAudioInputStream::CapiUsbAudioInputStream(
AudioManagerCapi* audio_manager,
const std::string& device_name,
return false;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ // Check privilege for audio forwarding device used to capture system
+ // output audio.
+ if (device_type == SOUND_DEVICE_FORWARDING) {
+ auto has_privilege =
+ wrt::privilege::FindPrivilegeFromCynara(kMediaCapturePrivilege);
+ if (!has_privilege) {
+ LOG(ERROR) << "No system audio capture privilege.";
+ return false;
+ }
+ }
+#endif
+
stream_info_ = nullptr;
ret = sound_manager_create_stream_information(stream_type, nullptr, nullptr,