~oah-dev/oah/gst-plugins-bad

« back to all changes in this revision

Viewing changes to gst/mpegdemux/gstmpegdemux.h

  • Committer: Haakon Sporsheim
  • Date: 2009-03-12 13:52:03 UTC
  • Revision ID: haakon.sporsheim@tandberg.com-20090312135203-i5k294hgkushb0mt
Initial import of git repository: git://anongit.freedesktop.org/gstreamer/gst-plugins-bad (tag: RELEASE-0_10_10)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
5
 *
 
6
 * MPL:
 
7
 *
 
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/.
 
12
 *
 
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
 
16
 * under the License.
 
17
 *
 
18
 * LGPL:
 
19
 *
 
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.
 
24
 *
 
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.
 
29
 *
 
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.
 
34
 *
 
35
 * The Original Code is Fluendo MPEG Demuxer plugin.
 
36
 *
 
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.
 
40
 *
 
41
 * Contributor(s): Wim Taymans <wim@fluendo.com>
 
42
 */
 
43
 
 
44
#ifndef __GST_FLUPS_DEMUX_H__
 
45
#define __GST_FLUPS_DEMUX_H__
 
46
 
 
47
#include <gst/gst.h>
 
48
#include <gst/base/gstadapter.h>
 
49
 
 
50
#include "gstpesfilter.h"
 
51
 
 
52
G_BEGIN_DECLS
 
53
 
 
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))
 
60
 
 
61
typedef struct _GstFluPSStream GstFluPSStream;
 
62
typedef struct _GstFluPSDemux GstFluPSDemux;
 
63
typedef struct _GstFluPSDemuxClass GstFluPSDemuxClass;
 
64
 
 
65
#define GST_FLUPS_DEMUX_MAX_STREAMS     256
 
66
#define GST_FLUPS_DEMUX_MAX_PSM         256
 
67
 
 
68
typedef enum {
 
69
  GST_FLUPS_DEMUX_SYNC_AUTO = 0,
 
70
  GST_FLUPS_DEMUX_SYNC_SCR = 1,
 
71
  GST_FLUPS_DEMUX_SYNC_DTS = 2
 
72
} GstFluPSDemuxSync;
 
73
 
 
74
typedef enum {
 
75
  STATE_FLUPS_DEMUX_NEED_SYNC,
 
76
  STATE_FLUPS_DEMUX_SYNCED,
 
77
  STATE_FLUPS_DEMUX_NEED_MORE_DATA,
 
78
} GstFluPSDemuxState;
 
79
 
 
80
/* Information associated with a single FluPS stream. */
 
81
struct _GstFluPSStream {
 
82
  GstPad         * pad;
 
83
 
 
84
  gint           id;
 
85
  gint           type;
 
86
  gint           size_bound;
 
87
 
 
88
  gboolean       discont;
 
89
  gboolean       notlinked;
 
90
  gboolean       need_segment;
 
91
};
 
92
 
 
93
struct _GstFluPSDemux {
 
94
  GstElement     parent;
 
95
 
 
96
  GstPad         * sinkpad;
 
97
 
 
98
  GstAdapter     * adapter;
 
99
  GstAdapter     * rev_adapter;
 
100
  guint64        adapter_offset;
 
101
  guint32        last_sync_code;
 
102
  GstPESFilter   filter;
 
103
 
 
104
  gint64         mux_rate;
 
105
  guint64        first_scr;
 
106
  guint64        first_dts;
 
107
  guint64        base_time;
 
108
  guint64        current_scr;
 
109
  guint64        next_scr;
 
110
  guint64        bytes_since_scr;
 
111
  gint64         scr_adjust;
 
112
  guint64        scr_rate_n;
 
113
  guint64        scr_rate_d;
 
114
  guint64        first_scr_offset;
 
115
  guint64        last_scr_offset;
 
116
 
 
117
  gint16         psm[GST_FLUPS_DEMUX_MAX_PSM];
 
118
 
 
119
  GstSegment     sink_segment;
 
120
  GstSegment     src_segment;
 
121
 
 
122
  /* stream output */
 
123
  GstFluPSStream * current_stream;
 
124
  guint64        next_pts;
 
125
  guint64        next_dts;
 
126
  GstFluPSStream ** streams;
 
127
  gboolean       need_no_more_pads;
 
128
 
 
129
  /* Indicates an MPEG-2 stream */
 
130
  gboolean is_mpeg2_pack;
 
131
 
 
132
  /* Language codes event is stored when a dvd-lang-codes
 
133
   * custom event arrives from upstream */
 
134
  GstEvent * lang_codes;
 
135
};
 
136
 
 
137
struct _GstFluPSDemuxClass {
 
138
  GstElementClass parent_class;
 
139
 
 
140
  GstPadTemplate *sink_template;
 
141
  GstPadTemplate *video_template;
 
142
  GstPadTemplate *audio_template;
 
143
  GstPadTemplate *private_template;
 
144
};
 
145
 
 
146
GType           gst_flups_demux_get_type        (void);
 
147
 
 
148
gboolean        gst_flups_demux_plugin_init     (GstPlugin *plugin);
 
149
 
 
150
G_END_DECLS
 
151
 
 
152
#endif /* __GST_FLUPS_DEMUX_H__ */