1 /* 2 * mpegts_parse.h - GStreamer MPEG transport stream parser 3 * Copyright (C) 2007 Alessandro Decina 4 * 5 * Authors: 6 * Alessandro Decina <alessandro@nnva.org> 7 * 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. 12 * 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. 17 * 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. 22 */ 23 24 25 #ifndef GST_MPEG_TS_PARSE_H 26 #define GST_MPEG_TS_PARSE_H 27 28 #include <gst/gst.h> 29 #include <gst/base/gstflowcombiner.h> 30 #include "mpegtsbase.h" 31 #include "mpegtspacketizer.h" 32 33 G_BEGIN_DECLS 34 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)) 45 46 typedef struct _MpegTSParse2 MpegTSParse2; 47 typedef struct _MpegTSParse2Class MpegTSParse2Class; 48 49 struct _MpegTSParse2 { 50 MpegTSBase parent; 51 52 gboolean have_group_id; 53 guint group_id; 54 55 GstClockTime smoothing_latency; 56 GstClockTime base_pcr; 57 GstClockTime ts_offset; 58 GstClockTime current_pcr; 59 gint user_pcr_pid; 60 gint pcr_pid; 61 62 /* Always present source pad */ 63 GstPad *srcpad; 64 65 /* Request source (single program) pads */ 66 GList *srcpads; 67 68 GstFlowCombiner *flowcombiner; 69 70 /* state */ 71 gboolean first; 72 gboolean set_timestamps; 73 74 /* Pending buffer state */ 75 GList *pending_buffers; 76 GstClockTime previous_pcr; 77 guint bytes_since_pcr; 78 }; 79 80 struct _MpegTSParse2Class { 81 MpegTSBaseClass parent_class; 82 }; 83 84 G_GNUC_INTERNAL GType mpegts_parse_get_type(void); 85 86 G_GNUC_INTERNAL gboolean gst_mpegtsparse_plugin_init (GstPlugin * plugin); 87 88 G_END_DECLS 89 90 #endif /* GST_MPEG_TS_PARSE_H */ 91