summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux/mpegtspacketizer.h
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2012-05-21 17:48:54 +0200
committerEdward Hervey <edward.hervey@collabora.co.uk>2012-05-22 17:43:38 +0200
commitc6035d403cd9511ca1208ae13a664f37e5dd6ef4 (patch)
tree18870a7b62ac7f6969888c13efa7bdd248dd9b56 /gst/mpegtsdemux/mpegtspacketizer.h
parent6d01f5f1b3f14a29bd2cc16f8ddc452ff0928505 (diff)
downloadgstreamer-plugins-bad-c6035d403cd9511ca1208ae13a664f37e5dd6ef4.tar.gz
mpegtspacketizer: Avoid usage of GstBuffer internally
The overhead of creating/using 188 byte GstBuffer from GstAdapter is too expensive. We now peek the next packet, and provide a data/size which is only valid until the packetizerpacket is cleared. In addition, cleanup all the internal code to deal with that new behaviour and remove double-checks which are no longer needed. The section_length is now the corrected section_length (i.e. with the additional 3 bytes). Avoid using gst_adapter_prev_timestamp and instead track the timestamp ourself.
Diffstat (limited to 'gst/mpegtsdemux/mpegtspacketizer.h')
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.h59
1 files changed, 33 insertions, 26 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.h b/gst/mpegtsdemux/mpegtspacketizer.h
index f4811cade..2e6d2c419 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.h
+++ b/gst/mpegtsdemux/mpegtspacketizer.h
@@ -62,28 +62,33 @@ typedef struct _MpegTSPacketizerPrivate MpegTSPacketizerPrivate;
typedef struct
{
- guint continuity_counter;
- GstAdapter *section_adapter;
- guint8 section_table_id;
- guint section_length;
+ guint continuity_counter;
+
+ guint8 *section_data;
+ guint section_length;
+ guint16 section_offset;
+ guint8 section_table_id;
+
GSList *subtables;
+
+ /* Offset of the data contained in the section */
guint64 offset;
} MpegTSPacketizerStream;
struct _MpegTSPacketizer2 {
- GObject object;
+ GObject parent;
GstAdapter *adapter;
/* streams hashed by pid */
/* FIXME : be more memory efficient (see how it's done in mpegtsbase) */
MpegTSPacketizerStream **streams;
- gboolean disposed;
- gboolean know_packet_size;
- guint16 packet_size;
- GstCaps *caps;
+ gboolean disposed;
+ gboolean know_packet_size;
+ guint16 packet_size;
+ GstCaps *caps;
/* current offset of the tip of the adapter */
- guint64 offset;
+ guint64 offset;
gboolean empty;
/* clock skew calculation */
@@ -118,36 +123,38 @@ struct _MpegTSPacketizer2Class {
typedef struct
{
- GstBuffer *buffer;
- gint16 pid;
- guint8 payload_unit_start_indicator;
- guint8 adaptation_field_control;
- guint8 continuity_counter;
+ gint16 pid;
+ guint8 payload_unit_start_indicator;
+ guint8 adaptation_field_control;
+ guint8 continuity_counter;
guint8 *payload;
- GstMapInfo bufmap;
-
guint8 *data_start;
guint8 *data_end;
guint8 *data;
- guint8 afc_flags;
+ guint8 afc_flags;
guint64 pcr;
guint64 opcr;
guint64 offset;
+ GstClockTime origts;
} MpegTSPacketizerPacket;
typedef struct
{
gboolean complete;
- GstBuffer *buffer;
- gint16 pid;
- guint8 table_id;
- guint16 subtable_extension;
- guint section_length;
- guint8 version_number;
- guint8 current_next_indicator;
- guint32 crc;
+ /* GstBuffer *buffer; */
+ guint8 *data;
+ guint section_length;
+ guint64 offset;
+
+ gint16 pid;
+ guint8 table_id;
+ guint16 subtable_extension;
+ guint8 version_number;
+ guint8 current_next_indicator;
+
+ guint32 crc;
} MpegTSPacketizerSection;
typedef struct