2 * mpegts_parse.h - GStreamer MPEG transport stream parser
3 * Copyright (C) 2007 Alessandro Decina
6 * Alessandro Decina <alessandro@nnva.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
25 #ifndef GST_MPEG_TS_PARSE_H
26 #define GST_MPEG_TS_PARSE_H
29 #include <gst/base/gstflowcombiner.h>
30 #include "mpegtsbase.h"
31 #include "mpegtspacketizer.h"
35 #define GST_TYPE_MPEGTS_PARSE \
36 (mpegts_parse_get_type())
37 #define GST_MPEGTS_PARSE(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MPEGTS_PARSE,MpegTSParse2))
39 #define GST_MPEGTS_PARSE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MPEGTS_PARSE,MpegTSParse2Class))
41 #define GST_IS_MPEGTS_PARSE(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MPEGTS_PARSE))
43 #define GST_IS_MPEGTS_PARSE_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEGTS_PARSE))
46 typedef struct _MpegTSParse2 MpegTSParse2;
47 typedef struct _MpegTSParse2Class MpegTSParse2Class;
49 typedef struct _MpegTSParse2Adapter {
51 guint packets_in_adapter;
52 gboolean first_is_keyframe;
53 } MpegTSParse2Adapter;
55 struct _MpegTSParse2 {
58 gboolean have_group_id;
61 GstClockTime smoothing_latency;
62 GstClockTime base_pcr;
63 GstClockTime ts_offset;
64 GstClockTime current_pcr;
68 /* Always present source pad */
71 /* Request source (single program) pads */
74 GstFlowCombiner *flowcombiner;
78 gboolean set_timestamps;
80 /* Pending buffer state */
81 GList *pending_buffers;
82 GstClockTime previous_pcr;
83 guint bytes_since_pcr;
85 /* Combine several packets into a larger buffer */
86 MpegTSParse2Adapter ts_adapter;
88 gboolean split_on_rai;
93 struct _MpegTSParse2Class {
94 MpegTSBaseClass parent_class;
97 G_GNUC_INTERNAL GType mpegts_parse_get_type(void);
98 GST_ELEMENT_REGISTER_DECLARE (tsparse);
102 #endif /* GST_MPEG_TS_PARSE_H */