2
* This library is licensed under 2 different licenses and you
3
* can choose to use it under the terms of either one of them. The
4
* two licenses are the MPL 1.1 and the LGPL.
8
* The contents of this file are subject to the Mozilla Public License
9
* Version 1.1 (the "License"); you may not use this file except in
10
* compliance with the License. You may obtain a copy of the License at
11
* http://www.mozilla.org/MPL/.
13
* Software distributed under the License is distributed on an "AS IS"
14
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15
* License for the specific language governing rights and limitations
20
* This library is free software; you can redistribute it and/or
21
* modify it under the terms of the GNU Library General Public
22
* License as published by the Free Software Foundation; either
23
* version 2 of the License, or (at your option) any later version.
25
* This library is distributed in the hope that it will be useful,
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28
* Library General Public License for more details.
30
* You should have received a copy of the GNU Library General Public
31
* License along with this library; if not, write to the
32
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
33
* Boston, MA 02111-1307, USA.
35
* The Original Code is Fluendo MPEG Demuxer plugin.
37
* The Initial Developer of the Original Code is Fluendo, S.L.
38
* Portions created by Fluendo, S.L. are Copyright (C) 2005
39
* Fluendo, S.L. All Rights Reserved.
41
* Contributor(s): Wim Taymans <wim@fluendo.com>
44
#ifndef __GST_FLUPS_DEMUX_H__
45
#define __GST_FLUPS_DEMUX_H__
48
#include <gst/base/gstadapter.h>
50
#include "gstpesfilter.h"
54
#define GST_TYPE_FLUPS_DEMUX (gst_flups_demux_get_type())
55
#define GST_FLUPS_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLUPS_DEMUX,GstFluPSDemux))
56
#define GST_FLUPS_DEMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLUPS_DEMUX,GstFluPSDemuxClass))
57
#define GST_FLUPS_DEMUX_GET_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS((klass),GST_TYPE_FLUPS_DEMUX,GstFluPSDemuxClass))
58
#define GST_IS_FLUPS_DEMUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLUPS_DEMUX))
59
#define GST_IS_FLUPS_DEMUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLUPS_DEMUX))
61
typedef struct _GstFluPSStream GstFluPSStream;
62
typedef struct _GstFluPSDemux GstFluPSDemux;
63
typedef struct _GstFluPSDemuxClass GstFluPSDemuxClass;
65
#define GST_FLUPS_DEMUX_MAX_STREAMS 256
66
#define GST_FLUPS_DEMUX_MAX_PSM 256
69
GST_FLUPS_DEMUX_SYNC_AUTO = 0,
70
GST_FLUPS_DEMUX_SYNC_SCR = 1,
71
GST_FLUPS_DEMUX_SYNC_DTS = 2
75
STATE_FLUPS_DEMUX_NEED_SYNC,
76
STATE_FLUPS_DEMUX_SYNCED,
77
STATE_FLUPS_DEMUX_NEED_MORE_DATA,
80
/* Information associated with a single FluPS stream. */
81
struct _GstFluPSStream {
90
gboolean need_segment;
93
struct _GstFluPSDemux {
99
GstAdapter * rev_adapter;
100
guint64 adapter_offset;
101
guint32 last_sync_code;
110
guint64 bytes_since_scr;
114
guint64 first_scr_offset;
115
guint64 last_scr_offset;
117
gint16 psm[GST_FLUPS_DEMUX_MAX_PSM];
119
GstSegment sink_segment;
120
GstSegment src_segment;
123
GstFluPSStream * current_stream;
126
GstFluPSStream ** streams;
127
gboolean need_no_more_pads;
129
/* Indicates an MPEG-2 stream */
130
gboolean is_mpeg2_pack;
132
/* Language codes event is stored when a dvd-lang-codes
133
* custom event arrives from upstream */
134
GstEvent * lang_codes;
137
struct _GstFluPSDemuxClass {
138
GstElementClass parent_class;
140
GstPadTemplate *sink_template;
141
GstPadTemplate *video_template;
142
GstPadTemplate *audio_template;
143
GstPadTemplate *private_template;
146
GType gst_flups_demux_get_type (void);
148
gboolean gst_flups_demux_plugin_init (GstPlugin *plugin);
152
#endif /* __GST_FLUPS_DEMUX_H__ */