Added automatic format support filter.
#endif
#include <freerdp/log.h>
+#include <freerdp/codec/dsp.h>
+
#include "shadow.h"
#include "shadow_rdpsnd.h"
/* Default supported audio formats */
static const AUDIO_FORMAT default_supported_audio_formats[] =
{
+ { WAVE_FORMAT_AAC_MS, 2, 44100, 176400, 4, 16, 0, NULL },
+ { WAVE_FORMAT_MPEGLAYER3, 2, 44100, 176400, 4, 16, 0, NULL },
+ { WAVE_FORMAT_GSM610, 2, 44100, 176400, 4, 16, 0, NULL },
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL },
- { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }
+ { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL },
};
+static AUDIO_FORMAT supported_audio_formats[ARRAYSIZE(default_supported_audio_formats)] = { 0 };
static void rdpsnd_activated(RdpsndServerContext* context)
{
@@ -84,10 +90,19 @@ int shadow_client_rdpsnd_init(rdpShadowClient* client)
}
else
{
+ size_t x, y = 0;
+
+ for (x = 0; x < ARRAYSIZE(default_supported_audio_formats); x++)
+ {
+ const AUDIO_FORMAT* format = &default_supported_audio_formats[x];
+
+ if (freerdp_dsp_supports_format(format, TRUE))
+ supported_audio_formats[y++] = *format;
+ }
+
/* Set default audio formats. */
- rdpsnd->server_formats = default_supported_audio_formats;
- rdpsnd->num_server_formats =
- sizeof(default_supported_audio_formats) / sizeof(default_supported_audio_formats[0]);
+ rdpsnd->server_formats = supported_audio_formats;
+ rdpsnd->num_server_formats = y;
}
rdpsnd->src_format = rdpsnd->server_formats[0];
