20 #include <freerdp/config.h>
26 #include "tsmf_audio.h"
28 static ITSMFAudioDevice* tsmf_load_audio_device_by_name(
const char* name,
const char* device)
30 ITSMFAudioDevice* audio = NULL;
33 PVIRTUALCHANNELENTRY pvce;
34 TSMF_AUDIO_DEVICE_ENTRY entry;
36 cnv.pvce = freerdp_load_channel_addin_entry(
"tsmf", name,
"audio", 0);
41 const UINT rc = cnv.entry(&audio);
43 if ((rc != CHANNEL_RC_OK) || !audio)
45 WLog_ERR(TAG,
"failed to call export function in %s", name);
49 if (!audio->Open(audio, device))
53 WLog_ERR(TAG,
"failed to open, name: %s, device: %s", name, device);
57 WLog_DBG(TAG,
"name: %s, device: %s", name, device);
63 ITSMFAudioDevice* tsmf_load_audio_device(
const char* name,
const char* device)
65 ITSMFAudioDevice* audio = NULL;
69 audio = tsmf_load_audio_device_by_name(name, device);
73 #if defined(WITH_PULSE)
75 audio = tsmf_load_audio_device_by_name(
"pulse", device);
80 audio = tsmf_load_audio_device_by_name(
"oss", device);
83 #if defined(WITH_ALSA)
85 audio = tsmf_load_audio_device_by_name(
"alsa", device);
91 WLog_ERR(TAG,
"no sound device.");
95 WLog_DBG(TAG,
"name: %s, device: %s", name, device);