Debian Codegraph @

gst/realmedia/rmdemux.h

raw
1 /* GStreamer RealMedia demuxer
2 * Copyright (C) <1999> Erik Walthinsen <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20
21 #ifndef __GST_RMDEMUX_H__
22 #define __GST_RMDEMUX_H__
23
24 #include <gst/gst.h>
25 #include <gst/base/gstadapter.h>
26 #include <gst/base/gstflowcombiner.h>
27 #include <gst/pbutils/descriptions.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_TYPE_RMDEMUX \
32 (gst_rmdemux_get_type())
33 #define GST_RMDEMUX(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RMDEMUX,GstRMDemux))
35 #define GST_RMDEMUX_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RMDEMUX,GstRMDemuxClass))
37 #define GST_IS_RMDEMUX(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RMDEMUX))
39 #define GST_IS_RMDEMUX_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RMDEMUX))
41
42 typedef enum
43 {
44 RMDEMUX_STATE_NULL,
45 RMDEMUX_STATE_HEADER,
46 RMDEMUX_STATE_HEADER_UNKNOWN,
47 RMDEMUX_STATE_HEADER_RMF,
48 RMDEMUX_STATE_HEADER_PROP,
49 RMDEMUX_STATE_HEADER_MDPR,
50 RMDEMUX_STATE_HEADER_INDX,
51 RMDEMUX_STATE_HEADER_DATA,
52 RMDEMUX_STATE_HEADER_CONT,
53 RMDEMUX_STATE_HEADER_SEEKING,
54 RMDEMUX_STATE_SEEKING,
55 RMDEMUX_STATE_DATA_PACKET,
56 RMDEMUX_STATE_SEEKING_EOS,
57 RMDEMUX_STATE_EOS,
58 RMDEMUX_STATE_INDX_DATA
59 } GstRMDemuxState;
60
61 typedef enum
62 {
63 RMDEMUX_LOOP_STATE_HEADER,
64 RMDEMUX_LOOP_STATE_INDEX,
65 RMDEMUX_LOOP_STATE_DATA
66 } GstRMDemuxLoopState;
67
68 typedef enum
69 {
70 GST_RMDEMUX_STREAM_UNKNOWN,
71 GST_RMDEMUX_STREAM_VIDEO,
72 GST_RMDEMUX_STREAM_AUDIO,
73 GST_RMDEMUX_STREAM_FILEINFO
74 } GstRMDemuxStreamType;
75
76 typedef struct _GstRMDemux GstRMDemux;
77 typedef struct _GstRMDemuxClass GstRMDemuxClass;
78 typedef struct _GstRMDemuxStream GstRMDemuxStream;
79
80 struct _GstRMDemux {
81 GstElement element;
82
83 /* pads */
84 GstPad *sinkpad;
85
86 gboolean have_group_id;
87 guint group_id;
88
89 GSList *streams;
90 guint n_video_streams;
91 guint n_audio_streams;
92 GstAdapter *adapter;
93 gboolean have_pads;
94
95 GstFlowCombiner *flowcombiner;
96
97 guint32 timescale;
98 guint64 duration;
99 guint32 avg_packet_size;
100 guint32 index_offset;
101 guint32 data_offset;
102 guint32 num_packets;
103
104 guint offset;
105 gboolean seekable;
106 guint32 seek_seqnum;
107
108 GstRMDemuxState state;
109 GstRMDemuxLoopState loop_state;
110 GstRMDemuxStream *index_stream;
111
112 /* playback start/stop positions */
113 GstSegment segment;
114 gboolean segment_running;
115 gboolean running;
116
117 /* Whether we need to send a newsegment event */
118 gboolean need_newsegment;
119
120 /* Current timestamp */
121 GstClockTime cur_timestamp;
122
123 /* First timestamp */
124 GstClockTime base_ts;
125 GstClockTime first_ts;
126
127 int n_chunks;
128 int chunk_index;
129
130 guint32 object_id;
131 gsize size;
132 guint16 object_version;
133
134 /* container tags for all streams */
135 GstTagList *pending_tags;
136 };
137
138 struct _GstRMDemuxClass {
139 GstElementClass parent_class;
140 };
141
142 /* RealMedia VideoCodec FOURCC codes */
143 #define GST_RM_VDO_RV10 GST_MAKE_FOURCC('R','V','1','0') // RealVideo 1
144 #define GST_RM_VDO_RV20 GST_MAKE_FOURCC('R','V','2','0') // RealVideo G2
145 #define GST_RM_VDO_RV30 GST_MAKE_FOURCC('R','V','3','0') // RealVideo 8
146 #define GST_RM_VDO_RV40 GST_MAKE_FOURCC('R','V','4','0') // RealVideo 9+10
147
148 /* RealMedia AudioCodec FOURCC codes */
149 #define GST_RM_AUD_14_4 GST_MAKE_FOURCC('1','4','_','4') // 14.4 Audio Codec
150 #define GST_RM_AUD_28_8 GST_MAKE_FOURCC('2','8','_','8') // 28.8 Audio Codec
151 #define GST_RM_AUD_COOK GST_MAKE_FOURCC('c','o','o','k') // Cooker G2 Audio Codec
152 #define GST_RM_AUD_DNET GST_MAKE_FOURCC('d','n','e','t') // DolbyNet Audio Codec (low bitrate Dolby AC3)
153 #define GST_RM_AUD_SIPR GST_MAKE_FOURCC('s','i','p','r') // Sipro/ACELP.NET Voice Codec
154 #define GST_RM_AUD_RAAC GST_MAKE_FOURCC('r','a','a','c') // LE-AAC Audio Codec
155 #define GST_RM_AUD_RACP GST_MAKE_FOURCC('r','a','c','p') // HE-AAC Audio Codec
156 #define GST_RM_AUD_RALF GST_MAKE_FOURCC('r','a','l','f') // RealAudio Lossless
157 #define GST_RM_AUD_ATRC GST_MAKE_FOURCC('a','t','r','c') // Sony ATRAC3 Audio Codec
158
159 #define GST_RM_AUD_xRA4 GST_MAKE_FOURCC('.','r','a','4') // Not a real audio codec
160 #define GST_RM_AUD_xRA5 GST_MAKE_FOURCC('.','r','a','5') // Not a real audio codec
161
162 GST_ELEMENT_REGISTER_DECLARE (rmdemux);
163
164 G_END_DECLS
165
166 #endif /* __GST_RMDEMUX_H__ */