mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
mpegtsparse: make sure packetsize is set on caps of buffers
This commit is contained in:
parent
bdf11016fa
commit
ec100c87c7
3 changed files with 9 additions and 4 deletions
|
@ -1994,8 +1994,15 @@ mpegts_try_discover_packet_size (MpegTSPacketizer * packetizer)
|
|||
if (dest[i] == 0x47 && dest[i + packetsize] == 0x47 &&
|
||||
dest[i + packetsize * 2] == 0x47 &&
|
||||
dest[i + packetsize * 3] == 0x47) {
|
||||
gchar *str;
|
||||
packetizer->know_packet_size = TRUE;
|
||||
packetizer->packet_size = packetsize;
|
||||
str =
|
||||
g_strdup_printf
|
||||
("video/mpegts, systemstream=(boolean)true, packetsize=%d",
|
||||
packetsize);
|
||||
packetizer->caps = gst_caps_from_string ((const gchar *) str);
|
||||
g_free (str);
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ struct _MpegTSPacketizer {
|
|||
gboolean disposed;
|
||||
gboolean know_packet_size;
|
||||
guint16 packet_size;
|
||||
GstCaps *caps;
|
||||
};
|
||||
|
||||
struct _MpegTSPacketizerClass {
|
||||
|
|
|
@ -773,15 +773,12 @@ mpegts_parse_push (MpegTSParse * parse, MpegTSPacketizerPacket * packet,
|
|||
guint16 pid;
|
||||
GstBuffer *buffer;
|
||||
GstFlowReturn ret;
|
||||
GstCaps *caps;
|
||||
GList *srcpads;
|
||||
|
||||
pid = packet->pid;
|
||||
buffer = packet->buffer;
|
||||
/* we have the same caps on all the src pads */
|
||||
caps = gst_static_pad_template_get_caps (&src_template);
|
||||
gst_buffer_set_caps (buffer, caps);
|
||||
gst_caps_unref (caps);
|
||||
gst_buffer_set_caps (buffer, parse->packetizer->caps);
|
||||
|
||||
GST_OBJECT_LOCK (parse);
|
||||
/* clear tspad->pushed on pads */
|
||||
|
|
Loading…
Reference in a new issue