Commit 40813f02 authored by Benjamin Berg's avatar Benjamin Berg
Browse files

wfd: Fix some parameter handling

parent 3e1b347d
......@@ -225,10 +225,12 @@ wfd_client_configure_client_media (GstRTSPClient * client,
GstRTSPContext * ctx)
{
WfdClient *self = WFD_CLIENT (client);
g_autoptr(GstElement) element;
gboolean res;
g_return_val_if_fail (self->params->selected_codec, FALSE);
g_return_val_if_fail (self->params->selected_resolution, FALSE);
self->media = WFD_MEDIA (media);
element = gst_rtsp_media_get_element (media);
......
......@@ -41,6 +41,7 @@ wfd_params_new (void)
{
WfdParams *self;
WfdVideoCodec *basic_codec;
g_autoptr(GList) resolutions = NULL;
self = g_slice_new0 (WfdParams);
......@@ -53,6 +54,10 @@ wfd_params_new (void)
basic_codec = wfd_video_codec_new_from_desc (0, "01 01 00000081 00000000 00000000 00 0000 0000 00 none none");
g_ptr_array_add (self->video_codecs, basic_codec);
/* Set a default resolution (for testing purposes) */
self->selected_codec = wfd_video_codec_ref (basic_codec);
self->selected_resolution = wfd_resolution_copy (basic_codec->native);
return self;
}
......@@ -145,10 +150,14 @@ wfd_params_m3_query_params (WfdParams *self)
void
wfd_params_from_sink (WfdParams *self, const guint8 *body, gsize body_size)
{
g_auto(GStrv) lines;
g_auto(GStrv) lines = NULL;
gchar **line;
g_autofree gchar *body_str = NULL;
/* Empty body is probably testing, just keep the current values. */
if (body == NULL)
return;
body_str = g_strndup ((gchar *) body, body_size);
lines = g_strsplit (body_str, "\n", 0);
......
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