From d71386a0337c1c1aba1a88ba5108f28d54f62768 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 26 Apr 2009 21:26:00 +0100 Subject: resindvd: Convert some g_print to GST_LOG_OBJECT and friends, remove some others Trim down the g_print verbosity. --- ext/resindvd/gstmpegdemux.c | 28 ++++++++++++---------------- ext/resindvd/resindvdsrc.c | 23 ++++++++++++----------- ext/resindvd/rsnaudiodec.c | 2 -- ext/resindvd/rsnaudiomunge.c | 15 ++++++++------- 4 files changed, 32 insertions(+), 36 deletions(-) (limited to 'ext/resindvd') diff --git a/ext/resindvd/gstmpegdemux.c b/ext/resindvd/gstmpegdemux.c index 91ffad14..d41ded0b 100644 --- a/ext/resindvd/gstmpegdemux.c +++ b/ext/resindvd/gstmpegdemux.c @@ -411,8 +411,7 @@ gst_flups_demux_send_data (GstFluPSDemux * demux, GstFluPSStream * stream, /* Set the buffer discont flag, and clear discont state on the stream */ if (stream->discont) { GST_DEBUG_OBJECT (demux, "discont buffer to pad %" GST_PTR_FORMAT - " with TS %" GST_TIME_FORMAT "\n", stream->pad, - GST_TIME_ARGS (timestamp)); + " with TS %" GST_TIME_FORMAT, stream->pad, GST_TIME_ARGS (timestamp)); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); stream->discont = FALSE; @@ -722,7 +721,8 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event) gst_event_ref (event); ret = gst_pad_push_event (temp->pad, event); - g_print ("Subpicture physical ID change to %d, forced %d\n", stream_id, + GST_INFO_OBJECT (demux, + "Subpicture physical ID change to %d, forced %d", stream_id, forced_only); } } @@ -776,7 +776,6 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event) GstEvent *sel_event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s); gst_pad_push_event (temp->pad, sel_event); - g_print ("Audio physical ID change to %d\n", stream_id); gst_event_ref (event); ret = gst_pad_push_event (temp->pad, event); @@ -841,9 +840,9 @@ gst_flups_demux_sink_event (GstPad * pad, GstEvent * event) gst_segment_set_newsegment_full (&demux->sink_segment, update, rate, arate, format, start, stop, time); - g_print ("demux: got segment update %d start %" G_GINT64_FORMAT - " stop %" G_GINT64_FORMAT " time %" G_GINT64_FORMAT "\n", - update, start, stop, time); + GST_DEBUG_OBJECT (demux, + "demux: got segment update %d start %" G_GINT64_FORMAT " stop %" + G_GINT64_FORMAT " time %" G_GINT64_FORMAT, update, start, stop, time); accum = demux->sink_segment.accum; start = demux->sink_segment.start; @@ -860,15 +859,11 @@ gst_flups_demux_sink_event (GstPad * pad, GstEvent * event) if (stop != -1) stop = start + dur; - GST_INFO_OBJECT (demux, "sending new segment: rate %g " - "format %d, start: %" G_GINT64_FORMAT ", stop: %" G_GINT64_FORMAT - ", time: %" G_GINT64_FORMAT, rate, format, start, stop, time); - - g_print ("sending new segment: update %d rate %g format %d, start: %" + GST_DEBUG_OBJECT (demux, + "sending new segment: update %d rate %g format %d, start: %" G_GINT64_FORMAT ", stop: %" G_GINT64_FORMAT ", time: %" - G_GINT64_FORMAT " scr_adjust: %" G_GINT64_FORMAT - "(%" GST_TIME_FORMAT ")\n", - update, rate, format, start, stop, time, demux->scr_adjust, + G_GINT64_FORMAT " scr_adjust: %" G_GINT64_FORMAT "(%" GST_TIME_FORMAT + ")", update, rate, format, start, stop, time, demux->scr_adjust, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->scr_adjust))); gst_segment_set_newsegment_full (&demux->src_segment, update, @@ -1336,7 +1331,8 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux) ", adjust %" G_GINT64_FORMAT, diff, demux->scr_adjust); scr_adjusted = demux->next_scr; #else - g_print ("Unexpected SCR diff of %" G_GINT64_FORMAT "\n", diff); + GST_WARNING_OBJECT (demux, "Unexpected SCR diff of %" G_GINT64_FORMAT, + diff); #endif } else { demux->next_scr = scr_adjusted; diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index e058c692..a2f31610 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -556,7 +556,8 @@ rsn_dvdsrc_do_still (resinDvdSrc * src, int duration) GstSegment *segment = &(GST_BASE_SRC (src)->segment); if (src->in_still_state == FALSE) { - g_print ("**** STILL FRAME. Duration %d ****\n", duration); + GST_DEBUG_OBJECT (src, "**** Start STILL FRAME. Duration %d ****", + duration); /* Send a close-segment event, and a dvd-still start * event, then sleep */ s = gst_structure_new ("application/x-gst-dvd", @@ -580,7 +581,7 @@ rsn_dvdsrc_do_still (resinDvdSrc * src, int duration) gst_pad_push_event (GST_BASE_SRC_PAD (src), still_event); gst_pad_push_event (GST_BASE_SRC_PAD (src), seg_event); if (hl_event) { - g_print ("Sending highlight event before still\n"); + GST_LOG_OBJECT (src, "Sending highlight event before still"); gst_pad_push_event (GST_BASE_SRC_PAD (src), hl_event); } g_mutex_lock (src->dvd_lock); @@ -770,8 +771,8 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock) if (src->cur_end_ts == GST_CLOCK_TIME_NONE || diff > 2 * GST_SECOND || diff < 0) { discont = TRUE; - g_print ("Discont NAV packet start TS %" GST_TIME_FORMAT - " != end TS %" GST_TIME_FORMAT "\n", + GST_DEBUG_OBJECT (src, "Discont NAV packet start TS %" GST_TIME_FORMAT + " != end TS %" GST_TIME_FORMAT, GST_TIME_ARGS (new_start_ptm), GST_TIME_ARGS (src->cur_end_ts)); } } @@ -850,8 +851,8 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock) /* Drain out the queues so that the info on the screen matches * the VM state */ if (have_dvd_lock) { - /* FIXME: Drain out the queues */ - g_print ("****** FIXME: WAIT *****\n"); + /* FIXME: Drain out the queues, by sleeping on the clock or something */ + GST_LOG_OBJECT (src, "****** FIXME: WAIT for queues to drain *****"); } if (dvdnav_wait_skip (src->dvdnav) != DVDNAV_STATUS_OK) goto internal_error; @@ -929,7 +930,7 @@ rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock) break; } case DVDNAV_HOP_CHANNEL: - g_print ("Channel hop - User action\n"); + GST_DEBUG_OBJECT (src, "Channel hop - User action"); src->need_segment = TRUE; break; case DVDNAV_NOP: @@ -1214,7 +1215,7 @@ rsn_dvdsrc_do_command (resinDvdSrc * src, GstNavigationCommand command) if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK && cur > 0 && dvdnav_angle_change (src->dvdnav, cur - 1) == DVDNAV_STATUS_OK) - g_print ("Switched to angle %d\n", cur - 1); + GST_INFO_OBJECT (src, "Switched to angle %d", cur - 1); /* Angle switches are seamless and involve no branching */ break; } @@ -1222,7 +1223,7 @@ rsn_dvdsrc_do_command (resinDvdSrc * src, GstNavigationCommand command) gint32 cur, agls; if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK && dvdnav_angle_change (src->dvdnav, cur + 1) == DVDNAV_STATUS_OK) - g_print ("Switched to angle %d\n", cur + 1); + GST_INFO_OBJECT (src, "Switched to angle %d", cur + 1); /* Angle switches are seamless and involve no branching */ break; } @@ -2229,7 +2230,7 @@ rsn_dvdsrc_get_sector_from_time_tmap (resinDvdSrc * src, GstClockTime ts) sector = title_tmap->map_ent[entry - 1] & 0x7fffffff; - GST_LOG_OBJECT (src, "Got sector %u for time seek (entry %d of %d)\n", + GST_LOG_OBJECT (src, "Got sector %u for time seek (entry %d of %d)", sector, entry, title_tmap->nr_of_entries); /* Sector is now an absolute sector within the current VTS, but @@ -2257,7 +2258,7 @@ rsn_dvdsrc_get_sector_from_time_tmap (resinDvdSrc * src, GstClockTime ts) logical_sector += (cell->last_sector - cell->first_sector + 1); } - GST_DEBUG_OBJECT (src, "Mapped sector %u onto PGC relative sector %u\n", + GST_DEBUG_OBJECT (src, "Mapped sector %u onto PGC relative sector %u", sector, logical_sector); return logical_sector; diff --git a/ext/resindvd/rsnaudiodec.c b/ext/resindvd/rsnaudiodec.c index d571410e..0118ef20 100644 --- a/ext/resindvd/rsnaudiodec.c +++ b/ext/resindvd/rsnaudiodec.c @@ -267,7 +267,6 @@ rsn_audiodec_proxy_src_chain (GstPad * pad, GstBuffer * buf) gst_object_unref (srcpad); - g_print ("srcpad %p\n", self->srcpad); if (self == NULL) return GST_FLOW_ERROR; @@ -395,7 +394,6 @@ rsn_audiodec_change_state (GstElement * element, GstStateChange transition) GstStateChangeReturn ret; RsnAudioDec *self = RSN_AUDIODEC (element); - g_print ("State change in element %p trans %d\n", element, transition); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY:{ GstElement *new_child; diff --git a/ext/resindvd/rsnaudiomunge.c b/ext/resindvd/rsnaudiomunge.c index d3a1d274..fc7e552f 100644 --- a/ext/resindvd/rsnaudiomunge.c +++ b/ext/resindvd/rsnaudiomunge.c @@ -178,7 +178,8 @@ rsn_audiomunge_chain (GstPad * pad, GstBuffer * buf) RsnAudioMunge *munge = RSN_AUDIOMUNGE (GST_OBJECT_PARENT (pad)); if (!munge->have_audio) { - g_print ("First audio after flush has TS %" GST_TIME_FORMAT "\n", + GST_INFO_OBJECT (munge, + "First audio after flush has TS %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); } @@ -221,8 +222,8 @@ rsn_audiomunge_make_audio (RsnAudioMunge * munge, memset (GST_BUFFER_DATA (audio_buf), 0, buf_size); - g_print ("Sending %u bytes (%" GST_TIME_FORMAT ") of audio data " - "with TS %" GST_TIME_FORMAT "\n", + GST_LOG_OBJECT (munge, "Sending %u bytes (%" GST_TIME_FORMAT + ") of audio data with TS %" GST_TIME_FORMAT, buf_size, GST_TIME_ARGS (fill_time), GST_TIME_ARGS (start)); ret = gst_pad_push (munge->srcpad, audio_buf); @@ -251,7 +252,7 @@ rsn_audiomunge_handle_dvd_event (RsnAudioMunge * munge, GstEvent * event) * when a new-segment arrives */ munge->in_still = in_still; - g_print ("**** AUDIO MUNGE: still-state now %d\n", munge->in_still); + GST_INFO_OBJECT (munge, "AUDIO MUNGE: still-state now %d", munge->in_still); } } @@ -312,9 +313,9 @@ rsn_audiomunge_sink_event (GstPad * pad, GstEvent * event) } if (segment->accum >= AUDIO_FILL_THRESHOLD || munge->in_still) { - g_print ("*********** Sending audio fill: accum = %" GST_TIME_FORMAT - " still-state=%d\n", GST_TIME_ARGS (segment->accum), - munge->in_still); + GST_DEBUG_OBJECT (munge, + "Sending audio fill: accum = %" GST_TIME_FORMAT " still-state=%d", + GST_TIME_ARGS (segment->accum), munge->in_still); /* Just generate a 100ms silence buffer for now. FIXME: Fill the gap */ if (rsn_audiomunge_make_audio (munge, segment->start, -- cgit v1.2.1