Commit 7bcb6bc4 authored by Alfred Agrell's avatar Alfred Agrell Committed by Alexandre Julliard

winegstreamer: Improve and clean up some debug logs.

parent 92c91c4e
...@@ -181,17 +181,17 @@ static void wg_format_from_caps_audio_mpeg1(struct wg_format *format, const GstC ...@@ -181,17 +181,17 @@ static void wg_format_from_caps_audio_mpeg1(struct wg_format *format, const GstC
if (!gst_structure_get_int(structure, "layer", &layer)) if (!gst_structure_get_int(structure, "layer", &layer))
{ {
GST_WARNING("Missing \"layer\" value."); GST_WARNING("Missing \"layer\" value in %" GST_PTR_FORMAT ".", caps);
return; return;
} }
if (!gst_structure_get_int(structure, "channels", &channels)) if (!gst_structure_get_int(structure, "channels", &channels))
{ {
GST_WARNING("Missing \"channels\" value."); GST_WARNING("Missing \"channels\" value in %" GST_PTR_FORMAT ".", caps);
return; return;
} }
if (!gst_structure_get_int(structure, "rate", &rate)) if (!gst_structure_get_int(structure, "rate", &rate))
{ {
GST_WARNING("Missing \"rate\" value."); GST_WARNING("Missing \"rate\" value in %" GST_PTR_FORMAT ".", caps);
return; return;
} }
...@@ -318,10 +318,7 @@ void wg_format_from_caps(struct wg_format *format, const GstCaps *caps) ...@@ -318,10 +318,7 @@ void wg_format_from_caps(struct wg_format *format, const GstCaps *caps)
} }
else else
{ {
gchar *str = gst_caps_to_string(caps); GST_FIXME("Unhandled caps %" GST_PTR_FORMAT ".", caps);
GST_FIXME("Unhandled caps %s.", str);
g_free(str);
} }
} }
......
...@@ -456,7 +456,7 @@ static NTSTATUS wg_parser_stream_seek(void *args) ...@@ -456,7 +456,7 @@ static NTSTATUS wg_parser_stream_seek(void *args)
if (!push_event(stream->my_sink, gst_event_new_seek(params->rate, GST_FORMAT_TIME, if (!push_event(stream->my_sink, gst_event_new_seek(params->rate, GST_FORMAT_TIME,
flags, start_type, params->start_pos * 100, stop_type, flags, start_type, params->start_pos * 100, stop_type,
params->stop_pos == stream->duration ? -1 : params->stop_pos * 100))) params->stop_pos == stream->duration ? -1 : params->stop_pos * 100)))
GST_ERROR("Failed to seek.\n"); GST_ERROR("Failed to seek.");
return S_OK; return S_OK;
} }
...@@ -480,13 +480,12 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args) ...@@ -480,13 +480,12 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args)
/* This can happen legitimately if the sample falls outside of the /* This can happen legitimately if the sample falls outside of the
* segment bounds. GStreamer elements shouldn't present the sample in * segment bounds. GStreamer elements shouldn't present the sample in
* that case, but DirectShow doesn't care. */ * that case, but DirectShow doesn't care. */
GST_LOG("Ignoring QoS event.\n"); GST_LOG("Ignoring QoS event.");
return S_OK; return S_OK;
} }
if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW,
params->proportion, diff, stream_time))) params->proportion, diff, stream_time)))
GST_ERROR("Failed to create QOS event.\n"); GST_ERROR("Failed to create QOS event.");
push_event(stream->my_sink, event); push_event(stream->my_sink, event);
return S_OK; return S_OK;
...@@ -679,6 +678,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu ...@@ -679,6 +678,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu
if (!stream->enabled) if (!stream->enabled)
{ {
GST_LOG("Stream is disabled; discarding buffer.");
pthread_mutex_unlock(&parser->mutex); pthread_mutex_unlock(&parser->mutex);
gst_buffer_unref(buffer); gst_buffer_unref(buffer);
return GST_FLOW_OK; return GST_FLOW_OK;
...@@ -695,7 +695,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu ...@@ -695,7 +695,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu
if (!gst_buffer_map(buffer, &stream->map_info, GST_MAP_READ)) if (!gst_buffer_map(buffer, &stream->map_info, GST_MAP_READ))
{ {
pthread_mutex_unlock(&parser->mutex); pthread_mutex_unlock(&parser->mutex);
GST_ERROR("Failed to map buffer.\n"); GST_ERROR("Failed to map buffer.");
gst_buffer_unref(buffer); gst_buffer_unref(buffer);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
...@@ -725,7 +725,6 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) ...@@ -725,7 +725,6 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
case GST_QUERY_CAPS: case GST_QUERY_CAPS:
{ {
GstCaps *caps, *filter, *temp; GstCaps *caps, *filter, *temp;
gchar *str;
gsize i; gsize i;
gst_query_parse_caps(query, &filter); gst_query_parse_caps(query, &filter);
...@@ -742,9 +741,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) ...@@ -742,9 +741,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
gst_structure_remove_fields(gst_caps_get_structure(caps, i), gst_structure_remove_fields(gst_caps_get_structure(caps, i),
"framerate", "pixel-aspect-ratio", NULL); "framerate", "pixel-aspect-ratio", NULL);
str = gst_caps_to_string(caps); GST_LOG("Stream caps are \"%" GST_PTR_FORMAT "\".", caps);
GST_LOG("Stream caps are \"%s\".", str);
g_free(str);
if (filter) if (filter)
{ {
...@@ -779,12 +776,8 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) ...@@ -779,12 +776,8 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
pthread_mutex_unlock(&parser->mutex); pthread_mutex_unlock(&parser->mutex);
if (!ret && gst_debug_category_get_threshold(GST_CAT_DEFAULT) >= GST_LEVEL_WARNING) if (!ret)
{ GST_WARNING("Rejecting caps \"%" GST_PTR_FORMAT "\".", caps);
gchar *str = gst_caps_to_string(caps);
GST_WARNING("Rejecting caps \"%s\".", str);
g_free(str);
}
gst_query_set_accept_caps_result(query, ret); gst_query_set_accept_caps_result(query, ret);
return TRUE; return TRUE;
} }
...@@ -1585,7 +1578,7 @@ static NTSTATUS wg_parser_connect(void *args) ...@@ -1585,7 +1578,7 @@ static NTSTATUS wg_parser_connect(void *args)
ret = gst_element_get_state(parser->container, NULL, NULL, -1); ret = gst_element_get_state(parser->container, NULL, NULL, -1);
if (ret == GST_STATE_CHANGE_FAILURE) if (ret == GST_STATE_CHANGE_FAILURE)
{ {
GST_ERROR("Failed to play stream.\n"); GST_ERROR("Failed to play stream.");
goto out; goto out;
} }
...@@ -1648,7 +1641,7 @@ static NTSTATUS wg_parser_connect(void *args) ...@@ -1648,7 +1641,7 @@ static NTSTATUS wg_parser_connect(void *args)
if (stream->eos) if (stream->eos)
{ {
stream->duration = 0; stream->duration = 0;
GST_WARNING("Failed to query duration.\n"); GST_WARNING("Failed to query duration.");
break; break;
} }
......
...@@ -196,7 +196,6 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery ...@@ -196,7 +196,6 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery
case GST_QUERY_CAPS: case GST_QUERY_CAPS:
{ {
GstCaps *caps, *filter, *temp; GstCaps *caps, *filter, *temp;
gchar *str;
gst_query_parse_caps(query, &filter); gst_query_parse_caps(query, &filter);
if (!(caps = wg_format_to_caps(&transform->output_format))) if (!(caps = wg_format_to_caps(&transform->output_format)))
...@@ -209,9 +208,7 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery ...@@ -209,9 +208,7 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery
caps = temp; caps = temp;
} }
str = gst_caps_to_string(caps); GST_INFO("Returning caps %" GST_PTR_FORMAT, caps);
GST_INFO("Returning caps %s", str);
g_free(str);
gst_query_set_caps_result(query, caps); gst_query_set_caps_result(query, caps);
gst_caps_unref(caps); gst_caps_unref(caps);
...@@ -498,7 +495,6 @@ NTSTATUS wg_transform_set_output_format(void *args) ...@@ -498,7 +495,6 @@ NTSTATUS wg_transform_set_output_format(void *args)
const struct wg_format *format = params->format; const struct wg_format *format = params->format;
GstSample *sample; GstSample *sample;
GstCaps *caps; GstCaps *caps;
gchar *str;
if (!(caps = wg_format_to_caps(format))) if (!(caps = wg_format_to_caps(format)))
{ {
...@@ -537,9 +533,7 @@ NTSTATUS wg_transform_set_output_format(void *args) ...@@ -537,9 +533,7 @@ NTSTATUS wg_transform_set_output_format(void *args)
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
str = gst_caps_to_string(caps); GST_INFO("Configured new caps %" GST_PTR_FORMAT ".", caps);
GST_INFO("Configured new caps %s.", str);
g_free(str);
/* Ideally and to be fully compatible with native transform, the queued /* Ideally and to be fully compatible with native transform, the queued
* output buffers will need to be converted to the new output format and * output buffers will need to be converted to the new output format and
......
Markdown is supported
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