/* create a sub buffer from the start of the section (table_id and
* section_length included) to the end */
- sub_buf = gst_buffer_create_sub (packet->buffer,
- data - GST_BUFFER_DATA (packet->buffer), packet->data_end - data);
+ sub_buf = gst_buffer_copy_region (packet->buffer, GST_BUFFER_COPY_ALL,
+ data - packet->bufmap.data, packet->data_end - data);
-
stream = packetizer->streams[packet->pid];
if (stream == NULL) {
stream = mpegts_packetizer_stream_new ();
demux->program = NULL;
/* Find end position */
- if (G_UNLIKELY (!gst_pad_query_peer_duration (base->sinkpad, &format,
- &total_bytes) || format != GST_FORMAT_BYTES)) {
+ if (G_UNLIKELY (!gst_pad_peer_query_duration (base->sinkpad, GST_FORMAT_BYTES,
+ &total_bytes))) {
GST_WARNING_OBJECT (base, "Couldn't get upstream size in bytes");
- ret = GST_FLOW_ERROR;
mpegts_packetizer_clear (base->packetizer);
- return ret;
+
+ return GST_FLOW_ERROR;
}
GST_DEBUG ("Upstream is %" G_GINT64_FORMAT " bytes", total_bytes);
pcrpattern = 0x47000020 | ((program->pcr_pid & 0x1fff) << 8);
for (i = 0; (i < 20) && (nbpcr < numpcr); i++) {
- guint offset, size;
+ guint offset;
+ GstMapInfo map;
+ gsize size;
- ret =
- gst_pad_pull_range (base->sinkpad,
+ ret = gst_pad_pull_range (base->sinkpad,
initoff + i * 500 * base->packetsize, 500 * base->packetsize, &buf);
if (G_UNLIKELY (ret != GST_FLOW_OK))
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&sink_template));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&vidsrc_template));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&audsrc_template));
+ gst_element_class_add_static_pad_template (element_class, &sink_template);
+ gst_element_class_add_static_pad_template (element_class, &vidsrc_template);
+ gst_element_class_add_static_pad_template (element_class, &audsrc_template);
++
gst_element_class_set_details_simple (element_class, "MVE Demuxer",
"Codec/Demuxer",
"Demultiplex an Interplay movie (MVE) stream into audio and video",