Commit ae5264b1 authored by Benjamin Berg's avatar Benjamin Berg
Browse files

audio: Add descriptor creation

parent 5be2e3a3
......@@ -116,6 +116,34 @@ wfd_audio_codec_new_from_desc (const gchar *descr)
return g_steal_pointer (&res);
}
gchar*
wfd_audio_get_descriptor (WfdAudioCodec *self)
{
const gchar *type;
if (self == NULL)
return g_strdup ("none");
switch (self->type)
{
case WFD_AUDIO_LPCM:
type = "LPCM";
break;
case WFD_AUDIO_AAC:
type = "AAC";
break;
case WFD_AUDIO_AC3:
type = "AC3";
break;
default:
g_assert_not_reached ();
return g_strdup ("none");
}
return g_strdup_printf ("%s %08X %02X", type, self->modes, 0);
}
void
wfd_audio_codec_dump (WfdAudioCodec *self)
{
......
......@@ -32,6 +32,7 @@ WfdAudioCodec *wfd_audio_codec_ref (WfdAudioCodec *self);
void wfd_audio_codec_unref (WfdAudioCodec *self);
WfdAudioCodec *wfd_audio_codec_new_from_desc (const gchar *descr);
gchar *wfd_audio_get_descriptor (WfdAudioCodec *self);
void wfd_audio_codec_dump (WfdAudioCodec *self);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment