summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun@centricular.com>2015-09-24 06:16:59 (GMT)
committerArun Raghavan <arun@centricular.com>2015-10-28 05:55:50 (GMT)
commit50fab6ab0eae1aacc22f7f273d1a58f128844187 (patch)
treed223a150ff810531ba9bce4ac82eeb8ace18be56
parent4125079b0eb86aadf2472617d220a6e9c6509d79 (diff)
downloadopenwebrtc-gst-plugins-50fab6ab0eae1aacc22f7f273d1a58f128844187.tar.gz
openwebrtc-gst-plugins-50fab6ab0eae1aacc22f7f273d1a58f128844187.tar.xz
scream: Use GStreamer logging instead of GLib
-rw-r--r--gst/scream/gstscreamcontroller.c9
-rw-r--r--gst/scream/gstscreamqueue.c12
2 files changed, 11 insertions, 10 deletions
diff --git a/gst/scream/gstscreamcontroller.c b/gst/scream/gstscreamcontroller.c
index 5e3d0cc..4491cf4 100644
--- a/gst/scream/gstscreamcontroller.c
+++ b/gst/scream/gstscreamcontroller.c
@@ -31,6 +31,7 @@
#include <math.h>
+#include <gst/gstinfo.h>
/* Timestamp sampling rate for SCReAM feedback*/
#define TIMESTAMP_RATE 1000.0f
@@ -937,8 +938,8 @@ static void update_target_stream_bitrate(GstScreamController *self, ScreamStream
increment = 0.0f;
if (stream->tx_size_bits_avg / MAX(br,stream->target_bitrate) > MAX_RTP_QUEUE_TIME &&
time_us - stream->t_last_rtp_q_clear_us > 5 * MAX_RTP_QUEUE_TIME * 1000000) {
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Target bitrate : RTP queue delay ~ %f."
- " Clear RTP queue \n", stream->tx_size_bits_avg / MAX(br,stream->target_bitrate));
+ GST_DEBUG("Target bitrate : RTP queue delay ~ %f. Clear RTP queue \n",
+ stream->tx_size_bits_avg / MAX(br,stream->target_bitrate));
stream->target_bitrate = stream->min_bitrate;
stream->next_packet_size = 0;
stream->bytes_in_queue = 0;
@@ -1031,7 +1032,7 @@ static void update_target_stream_bitrate(GstScreamController *self, ScreamStream
if (self->n_acc_bytes_in_flight_max > 0) {
in_fl = self->acc_bytes_in_flight_max/self->n_acc_bytes_in_flight_max;
}
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Target br adj : "
+ GST_DEBUG("Target br adj : "
"target(actual)=%4.0f(%4.0f,%4.0f,%4.0f)k rtpQ=%4.0fms cwnd=%5u(%5u) srtt=%3.0fms "
"owd(T)=%3.0f(%3.0f)ms fs=%u dt=%3.0f\n",
stream->target_bitrate/1000.0f,
@@ -1118,7 +1119,7 @@ void gst_scream_controller_incoming_feedback(GstScreamController *self, guint st
/*
* The loss counter has increased
*/
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Scream detected %u losses. highest seq is %u\n",
+ GST_DEBUG("Scream detected %u losses. highest seq is %u\n",
n_loss-stream->n_loss,highest_seq);
stream->n_loss = n_loss;
if (time_us - self->last_loss_event_t_us > self->srtt_us) {
diff --git a/gst/scream/gstscreamqueue.c b/gst/scream/gstscreamqueue.c
index 40b9bf3..f96fa6f 100644
--- a/gst/scream/gstscreamqueue.c
+++ b/gst/scream/gstscreamqueue.c
@@ -376,7 +376,7 @@ static GstStateChangeReturn gst_scream_queue_change_state(GstElement *element,
self, NULL);
} else {
- g_warning("Failed to change state!");
+ GST_WARNING_OBJECT(self, "Failed to change state!");
res = FALSE;
}
break;
@@ -502,7 +502,7 @@ static void gst_scream_queue_srcpad_loop(GstScreamQueue *self)
while (!gst_data_queue_is_empty(self->approved_packets)) {
if (G_UNLIKELY(!gst_data_queue_pop(self->approved_packets,
(GstDataQueueItem **)&rtp_item))) {
- g_warning("Failed to pop from approved packets queue. Flushing?");
+ GST_WARNING_OBJECT(self, "Failed to pop from approved packets queue. Flushing?");
goto end; /* flushing */
}
@@ -543,7 +543,7 @@ static void gst_scream_queue_srcpad_loop(GstScreamQueue *self)
gst_scream_controller_new_rtp_packet(self->scream_controller, stream_id, rtp_item->rtp_ts,
rtp_item->enqueued_time, stream->enqueued_payload_size, rtp_item->rtp_payload_size);
} else {
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed pusing RTP packet to the stream packet queue. flushing?");
+ GST_DEBUG_OBJECT(self, "Failed pushing RTP packet to the stream packet queue. flushing?");
((GstDataQueueItem *)rtp_item)->destroy(rtp_item);
}
}
@@ -577,7 +577,7 @@ static GstScreamStream * get_stream(GstScreamQueue *self, guint ssrc, guint pt)
} else {
g_signal_emit_by_name(self, "on-payload-adaptation-request", pt, &adapt_stream);
if (!adapt_stream) {
- g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Ignoring adaptation for payload %u for ssrc %u", pt, stream_id);
+ GST_DEBUG_OBJECT(self, "Ignoring adaptation for payload %u for ssrc %u", pt, stream_id);
g_hash_table_add(self->ignored_stream_ids, GUINT_TO_POINTER(stream_id));
} else {
if (gst_scream_controller_register_new_stream(self->scream_controller,
@@ -602,7 +602,7 @@ static GstScreamStream * get_stream(GstScreamQueue *self, guint ssrc, guint pt)
g_rw_lock_writer_unlock(&self->lock);
g_hash_table_add(self->adapted_stream_ids, GUINT_TO_POINTER(stream_id));
} else {
- g_warning("Failed to register new stream\n");
+ GST_WARNING_OBJECT(self, "Failed to register new stream\n");
}
}
}
@@ -635,7 +635,7 @@ static gboolean configure(GstScreamQueue *self) {
self->scream_controller = controller;
} else {
res = FALSE;
- g_warning("Could not create Scream Controller");
+ GST_WARNING_OBJECT(self, "Could not create Scream Controller");
}
return res;