switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
{
- GST_DEBUG ("query duration");
+ GST_DEBUG_OBJECT (pad, "query duration");
gst_query_parse_duration (query, &format, NULL);
if (format == GST_FORMAT_TIME) {
if (!gst_pad_peer_query (base->sinkpad, query)) {
}
case GST_QUERY_LATENCY:
{
- GST_DEBUG ("query latency");
+ GST_DEBUG_OBJECT (pad, "query latency");
res = gst_pad_peer_query (base->sinkpad, query);
if (res) {
GstClockTime min_lat, max_lat;
}
case GST_QUERY_SEEKING:
{
- GST_DEBUG ("query seeking");
+ GST_DEBUG_OBJECT (pad, "query seeking");
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
- GST_DEBUG ("asked for format %s", gst_format_get_name (format));
+ GST_DEBUG_OBJECT (pad, "asked for format %s",
+ gst_format_get_name (format));
if (format == GST_FORMAT_TIME) {
gboolean seekable = FALSE;
GstClockTime dur;
if (gst_ts_demux_get_duration (demux, &dur)) {
gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, dur);
- GST_DEBUG ("Gave duration: %" GST_TIME_FORMAT, GST_TIME_ARGS (dur));
+ GST_DEBUG_OBJECT (pad, "Gave duration: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (dur));
}
}
} else {
if (gst_byte_writer_put_data (h264infos->sei,
unit.data + unit.sc_offset,
unit.size + unit.offset - unit.sc_offset)) {
- GST_DEBUG ("adding SEI %u", unit.size + unit.offset - unit.sc_offset);
+ GST_DEBUG_OBJECT (stream->pad, "adding SEI %u",
+ unit.size + unit.offset - unit.sc_offset);
} else {
- GST_WARNING ("Could not write SEI");
+ GST_WARNING_OBJECT (stream->pad, "Could not write SEI");
}
break;
case GST_H264_NAL_PPS:
if (gst_byte_writer_put_data (h264infos->pps,
unit.data + unit.sc_offset,
unit.size + unit.offset - unit.sc_offset)) {
- GST_DEBUG ("adding PPS %u", unit.size + unit.offset - unit.sc_offset);
+ GST_DEBUG_OBJECT (stream->pad, "adding PPS %u",
+ unit.size + unit.offset - unit.sc_offset);
} else {
- GST_WARNING ("Could not write PPS");
+ GST_WARNING_OBJECT (stream->pad, "Could not write PPS");
}
break;
case GST_H264_NAL_SPS:
if (gst_byte_writer_put_data (h264infos->sps,
unit.data + unit.sc_offset,
unit.size + unit.offset - unit.sc_offset)) {
- GST_DEBUG ("adding SPS %u", unit.size + unit.offset - unit.sc_offset);
+ GST_DEBUG_OBJECT (stream->pad, "adding SPS %u",
+ unit.size + unit.offset - unit.sc_offset);
} else {
- GST_WARNING ("Could not write SPS");
+ GST_WARNING_OBJECT (stream->pad, "Could not write SPS");
}
break;
/* these units are considered keyframes in h264parse */
tmpsize = gst_byte_writer_get_size (h264infos->sei);
if (tmpsize) {
- GST_DEBUG ("Adding SEI");
+ GST_DEBUG_OBJECT (stream->pad, "Adding SEI");
data = gst_byte_writer_reset_and_get_data (h264infos->sei);
gst_byte_writer_put_data (h264infos->sps, data, tmpsize);
g_free (data);
}
if (frame_unit.size) { /* We found the everything in one go! */
- GST_DEBUG ("Adding Keyframe");
+ GST_DEBUG_OBJECT (stream->pad, "Adding Keyframe");
gst_byte_writer_put_data (h264infos->sps,
frame_unit.data + frame_unit.sc_offset,
stream->current_size - frame_unit.sc_offset);
} else {
- GST_DEBUG ("Adding Keyframe");
+ GST_DEBUG_OBJECT (stream->pad, "Adding Keyframe");
gst_byte_writer_put_data (h264infos->sps,
h264infos->framedata.data, h264infos->framedata.size);
clear_simple_buffer (&h264infos->framedata);
gboolean update = FALSE;
GstSegment seeksegment;
- GST_DEBUG ("seek event, %" GST_PTR_FORMAT, event);
+ GST_DEBUG_OBJECT (demux, "seek event, %" GST_PTR_FORMAT, event);
if (base->out_segment.format == GST_FORMAT_UNDEFINED) {
GST_DEBUG_OBJECT (demux, "Cannot process seek event now, delaying");
&stop_type, &stop);
if (rate <= 0.0) {
- GST_WARNING ("Negative rate not supported");
+ GST_WARNING_OBJECT (demux, "Negative rate not supported");
goto done;
}
if (flags & (GST_SEEK_FLAG_SEGMENT)) {
- GST_WARNING ("seek flags 0x%x are not supported", (int) flags);
+ GST_WARNING_OBJECT (demux, "seek flags 0x%x are not supported",
+ (int) flags);
goto done;
}
mpegts_packetizer_ts_to_offset (base->packetizer, target,
demux->program->pcr_pid);
if (G_UNLIKELY (start_offset == -1)) {
- GST_WARNING ("Couldn't convert start position to an offset");
+ GST_WARNING_OBJECT (demux,
+ "Couldn't convert start position to an offset");
goto done;
}
case GST_EVENT_SEEK:
res = mpegts_base_handle_seek_event ((MpegTSBase *) demux, pad, event);
if (!res)
- GST_WARNING ("seeking failed");
+ GST_WARNING_OBJECT (pad, "seeking failed");
gst_event_unref (event);
break;
default:
{
const gchar *lc;
- GST_LOG ("Add language code for stream: '%s'", lang_code);
+ GST_LOG_OBJECT (stream->pad, "Add language code for stream: '%s'", lang_code);
if (!stream->taglist)
stream->taglist = gst_tag_list_new_empty ();
nb = gst_mpegts_descriptor_parse_iso_639_language_nb (desc);
- GST_DEBUG ("Found ISO 639 descriptor (%d entries)", nb);
+ GST_DEBUG_OBJECT (stream->pad, "Found ISO 639 descriptor (%d entries)", nb);
for (i = 0; i < nb; i++)
if (gst_mpegts_descriptor_parse_iso_639_language_idx (desc, i, &lang_code,
nb = gst_mpegts_descriptor_parse_dvb_subtitling_nb (desc);
- GST_DEBUG ("Found SUBTITLING descriptor (%d entries)", nb);
+ GST_DEBUG_OBJECT (stream->pad, "Found SUBTITLING descriptor (%d entries)",
+ nb);
for (i = 0; i < nb; i++)
if (gst_mpegts_descriptor_parse_dvb_subtitling_idx (desc, i, &lang_code,
gst_ts_demux_create_tags (stream);
- GST_LOG ("Attempting to create pad for stream 0x%04x with stream_type %d",
+ GST_LOG_OBJECT (demux,
+ "Attempting to create pad for stream 0x%04x with stream_type %d",
bstream->pid, bstream->stream_type);
/* First handle BluRay-specific stream types since there is some overlap
mpegts_get_descriptor_from_stream (bstream,
GST_MTS_DESC_AC3_AUDIO_STREAM);
if (ac3_desc && DESC_AC_AUDIO_STREAM_bsid (ac3_desc->data) != 16) {
- GST_LOG ("ac3 audio");
+ GST_LOG_OBJECT (demux, "ac3 audio");
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-ac3");
} else {
* * frame_rate
* * profile_and_level
*/
- GST_LOG ("mpeg video");
+ GST_LOG_OBJECT (demux, "mpeg video");
is_video = TRUE;
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT,
break;
case GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG1:
case GST_MPEGTS_STREAM_TYPE_AUDIO_MPEG2:
- GST_LOG ("mpeg audio");
+ GST_LOG_OBJECT (demux, "mpeg audio");
is_audio = TRUE;
caps =
gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 1,
gst_caps_set_simple (caps, "layer", G_TYPE_INT, 2, NULL);
break;
case GST_MPEGTS_STREAM_TYPE_PRIVATE_PES_PACKETS:
- GST_LOG ("private data");
+ GST_LOG_OBJECT (demux, "private data");
/* FIXME: Move all of this into a common method (there might be other
* types also, depending on registratino descriptors also
*/
desc = mpegts_get_descriptor_from_stream_with_extension (bstream,
GST_MTS_DESC_DVB_EXTENSION, GST_MTS_DESC_EXT_DVB_AC4);
if (desc) {
- GST_LOG ("ac4 audio");
+ GST_LOG_OBJECT (demux, "ac4 audio");
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-ac4");
break;
desc = mpegts_get_descriptor_from_stream (bstream, GST_MTS_DESC_DVB_AC3);
if (desc) {
- GST_LOG ("ac3 audio");
+ GST_LOG_OBJECT (demux, "ac3 audio");
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-ac3");
break;
mpegts_get_descriptor_from_stream (bstream,
GST_MTS_DESC_DVB_ENHANCED_AC3);
if (desc) {
- GST_LOG ("ac3 audio");
+ GST_LOG_OBJECT (demux, "ac3 audio");
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-eac3");
break;
mpegts_get_descriptor_from_stream (bstream,
GST_MTS_DESC_DVB_TELETEXT);
if (desc) {
- GST_LOG ("teletext");
+ GST_LOG_OBJECT (demux, "teletext");
is_private = TRUE;
caps = gst_caps_new_empty_simple ("application/x-teletext");
sparse = TRUE;
mpegts_get_descriptor_from_stream (bstream,
GST_MTS_DESC_DVB_SUBTITLING);
if (desc) {
- GST_LOG ("subtitling");
+ GST_LOG_OBJECT (demux, "subtitling");
is_subpicture = TRUE;
caps = gst_caps_new_empty_simple ("subpicture/x-dvb");
sparse = TRUE;
const guint desc_min_length = 24;
if (desc->length < desc_min_length) {
- GST_ERROR
- ("GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K: descriptor length %d too short",
+ GST_ERROR_OBJECT (demux,
+ "GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K: descriptor length %d too short",
desc->length);
return NULL;
}
interlaced_video = remaining_8b & 0x40;
/* we don't support demuxing interlaced at the moment */
if (interlaced_video) {
- GST_ERROR
- ("GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K: interlaced video not supported");
+ GST_ERROR_OBJECT (demux,
+ "GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K: interlaced video not supported");
return NULL;
} else {
interlace_mode = "progressive";
break;
case ST_VIDEO_DIRAC:
if (bstream->registration_id == 0x64726163) {
- GST_LOG ("dirac");
+ GST_LOG_OBJECT (demux, "dirac");
/* dirac in hex */
is_video = TRUE;
caps = gst_caps_new_empty_simple ("video/x-dirac");
if (bstream->registration_id == DRF_ID_VC1)
is_vc1 = TRUE;
if (!is_vc1) {
- GST_WARNING ("0xea private stream type found but no descriptor "
- "for VC1. Assuming plain VC1.");
+ GST_WARNING_OBJECT (demux, "0xea private stream type found but "
+ "no descriptor for VC1. Assuming plain VC1.");
}
is_video = TRUE;
break;
}
- GST_WARNING ("AC3 stream type found but no guaranteed "
+ GST_WARNING_OBJECT (demux,
+ "AC3 stream type found but no guaranteed "
"way found to differentiate between AC3 and EAC3. "
"Assuming plain AC3.");
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("video/x-cavs");
break;
default:
- GST_DEBUG ("Non-media stream (stream_type:0x%x). Not creating pad",
+ GST_DEBUG_OBJECT (demux,
+ "Non-media stream (stream_type:0x%x). Not creating pad",
bstream->stream_type);
break;
}
GstEvent *event;
const gchar *stream_id;
- GST_LOG ("stream:%p creating pad with name %s and caps %" GST_PTR_FORMAT,
+ GST_LOG_OBJECT (demux,
+ "stream:%p creating pad with name %s and caps %" GST_PTR_FORMAT,
stream, name, caps);
pad = gst_pad_new_from_template (template, name);
gst_pad_set_active (pad, TRUE);
guint size;
guint8 cc = FLAGS_CONTINUITY_COUNTER (packet->scram_afc_cc);
- GST_LOG ("pid: 0x%04x state:%d", stream->stream.pid, stream->state);
+ GST_LOG_OBJECT (demux, "pid: 0x%04x state:%d", stream->stream.pid,
+ stream->state);
size = packet->data_end - packet->payload;
data = packet->payload;
if (stream->continuity_counter == CONTINUITY_UNSET) {
- GST_DEBUG ("CONTINUITY: Initialize to %d", cc);
+ GST_DEBUG_OBJECT (demux, "CONTINUITY: Initialize to %d", cc);
} else if ((cc == stream->continuity_counter + 1 ||
(stream->continuity_counter == MAX_CONTINUITY && cc == 0))) {
- GST_LOG ("CONTINUITY: Got expected %d", cc);
+ GST_LOG_OBJECT (demux, "CONTINUITY: Got expected %d", cc);
} else {
if (stream->state != PENDING_PACKET_EMPTY) {
if (packet->payload_unit_start_indicator) {
if (stream->state == PENDING_PACKET_EMPTY) {
if (G_UNLIKELY (!packet->payload_unit_start_indicator)) {
stream->state = PENDING_PACKET_DISCONT;
- GST_DEBUG ("Didn't get the first packet of this PES");
+ GST_DEBUG_OBJECT (demux, "Didn't get the first packet of this PES");
} else {
- GST_LOG ("EMPTY=>HEADER");
+ GST_LOG_OBJECT (demux, "EMPTY=>HEADER");
stream->state = PENDING_PACKET_HEADER;
}
}
switch (stream->state) {
case PENDING_PACKET_HEADER:
{
- GST_LOG ("HEADER: Parsing PES header");
+ GST_LOG_OBJECT (demux, "HEADER: Parsing PES header");
/* parse the header */
gst_ts_demux_parse_pes_header (demux, stream, data, size, packet->offset);
}
case PENDING_PACKET_BUFFER:
{
- GST_LOG ("BUFFER: appending data");
+ GST_LOG_OBJECT (demux, "BUFFER: appending data");
if (G_UNLIKELY (stream->current_size + size > stream->allocated_size)) {
- GST_LOG ("resizing buffer");
+ GST_LOG_OBJECT (demux, "resizing buffer");
do {
stream->allocated_size = MAX (8192, 2 * stream->allocated_size);
} while (stream->current_size + size > stream->allocated_size);
}
case PENDING_PACKET_DISCONT:
{
- GST_LOG ("DISCONT: not storing/pushing");
+ GST_LOG_OBJECT (demux, "DISCONT: not storing/pushing");
if (G_UNLIKELY (stream->data)) {
g_free (stream->data);
stream->data = NULL;
GstClockTime firstts = 0;
GList *tmp;
- GST_DEBUG ("Creating new newsegment for stream %p", stream);
+ GST_DEBUG_OBJECT (demux, "Creating new newsegment for stream %p", stream);
if (target_program == NULL)
target_program = demux->program;
}
if (GST_CLOCK_TIME_IS_VALID (lowest_pts))
firstts = lowest_pts;
- GST_DEBUG ("lowest_pts %" G_GUINT64_FORMAT " => clocktime %" GST_TIME_FORMAT,
- lowest_pts, GST_TIME_ARGS (firstts));
+ GST_DEBUG_OBJECT (demux, "lowest_pts %" G_GUINT64_FORMAT " => clocktime %"
+ GST_TIME_FORMAT, lowest_pts, GST_TIME_ARGS (firstts));
if (base->out_segment.format != GST_FORMAT_TIME || demux->reset_segment) {
/* It will happen only if it's first program or after flushes. */
- GST_DEBUG ("Calculating actual segment");
+ GST_DEBUG_OBJECT (demux, "Calculating actual segment");
if (base->segment.format == GST_FORMAT_TIME) {
/* Try to recover segment info from base if it's in TIME format */
base->out_segment = base->segment;
bs->stream_type, stream->state);
if (G_UNLIKELY (stream->data == NULL)) {
- GST_LOG ("stream->data == NULL");
+ GST_LOG_OBJECT (stream->pad, "stream->data == NULL");
goto beach;
}
if (G_UNLIKELY (stream->state == PENDING_PACKET_EMPTY)) {
- GST_LOG ("EMPTY: returning");
+ GST_LOG_OBJECT (stream->pad, "EMPTY: returning");
goto beach;
}
if (G_UNLIKELY (stream->state != PENDING_PACKET_BUFFER)) {
- GST_LOG ("state:%d, returning", stream->state);
+ GST_LOG_OBJECT (stream->pad, "state:%d, returning", stream->state);
goto beach;
}
}
gst_buffer_list_unref (buffer_list);
}
- GST_DEBUG ("Not enough information to push buffers yet, storing buffer");
+ GST_DEBUG_OBJECT (demux,
+ "Not enough information to push buffers yet, storing buffer");
goto beach;
}
}
beach:
/* Reset the PES payload collection, but don't clear the state,
* we might want to keep collecting this PES */
- GST_LOG ("Cleared PES data. returning %s", gst_flow_get_name (res));
+ GST_LOG_OBJECT (demux, "Cleared PES data. returning %s",
+ gst_flow_get_name (res));
if (stream->expected_size) {
if (stream->current_size > stream->expected_size)
stream->expected_size = 0;
{
GstFlowReturn res = GST_FLOW_OK;
- GST_LOG ("pid 0x%04x pusi:%d, afc:%d, cont:%d, payload:%p", packet->pid,
- packet->payload_unit_start_indicator, packet->scram_afc_cc & 0x30,
+ GST_LOG_OBJECT (demux, "pid 0x%04x pusi:%d, afc:%d, cont:%d, payload:%p",
+ packet->pid, packet->payload_unit_start_indicator,
+ packet->scram_afc_cc & 0x30,
FLAGS_CONTINUITY_COUNTER (packet->scram_afc_cc), packet->payload);
if (G_UNLIKELY (packet->payload_unit_start_indicator) &&
if (packet->payload && (res == GST_FLOW_OK || res == GST_FLOW_NOT_LINKED)
&& stream->pad) {
gst_ts_demux_queue_data (demux, stream, packet);
- GST_LOG ("current_size:%d, expected_size:%d",
+ GST_LOG_OBJECT (demux, "current_size:%d, expected_size:%d",
stream->current_size, stream->expected_size);
/* Finally check if the data we queued completes a packet, or got too
* large and needs output now */
if ((stream->expected_size && stream->current_size >= stream->expected_size)
|| (stream->current_size >= MAX_PES_PAYLOAD)) {
- GST_LOG ("pushing packet of size %u", stream->current_size);
+ GST_LOG_OBJECT (demux, "pushing packet of size %u", stream->current_size);
res = gst_ts_demux_push_pending_data (demux, stream, NULL);
}
}