2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
\r
4 * This library is free software; you can redistribute it and/or
\r
5 * modify it under the terms of the GNU Library General Public
\r
6 * License as published by the Free Software Foundation; either
\r
7 * version 2 of the License, or (at your option) any later version.
\r
9 * This library is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
12 * Library General Public License for more details.
\r
14 * You should have received a copy of the GNU Library General Public
\r
15 * License along with this library; if not, write to the
\r
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
\r
17 * Boston, MA 02111-1307, USA.
\r
21 #ifndef __GST_PIFFDEMUX_H__
\r
22 #define __GST_PIFFDEMUX_H__
\r
24 #include <gst/gst.h>
\r
25 #include <gst/base/gstadapter.h>
\r
26 #include "piffcommon.h"
\r
30 GST_DEBUG_CATEGORY_EXTERN (piffdemux_debug);
\r
31 #define GST_CAT_DEFAULT piffdemux_debug
\r
33 #define GST_TYPE_PIFFDEMUX \
\r
34 (gst_piffdemux_get_type())
\r
35 #define GST_PIFFDEMUX(obj) \
\r
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIFFDEMUX,GstPiffDemux))
\r
37 #define GST_PIFFDEMUX_CLASS(klass) \
\r
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIFFDEMUX,GstPiffDemuxClass))
\r
39 #define GST_IS_PIFFDEMUX(obj) \
\r
40 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIFFDEMUX))
\r
41 #define GST_IS_PIFFDEMUX_CLASS(klass) \
\r
42 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIFFDEMUX))
\r
44 #define GST_PIFFDEMUX_CAST(obj) ((GstPiffDemux *)(obj))
\r
46 /* piffdemux produces these for atoms it cannot parse */
\r
47 #define GST_PIFF_DEMUX_PRIVATE_TAG "private-piff-tag"
\r
48 #define GST_PIFF_DEMUX_CLASSIFICATION_TAG "classification"
\r
50 #define GST_PIFFDEMUX_MAX_STREAMS 8
\r
52 typedef struct _GstPiffDemux GstPiffDemux;
\r
53 typedef struct _GstPiffDemuxClass GstPiffDemuxClass;
\r
54 typedef struct _PiffDemuxStream PiffDemuxStream;
\r
56 struct _GstPiffDemux {
\r
63 PiffDemuxStream *stream;
\r
68 gboolean fragmented;
\r
70 guint64 moof_offset;
\r
74 gboolean posted_redirect;
\r
76 /* push based variables */
\r
79 GstAdapter *adapter;
\r
80 GstBuffer *mdatbuffer;
\r
83 /* offset of the media data (i.e.: Size of header) */
\r
85 /* offset of the mdat atom */
\r
89 GstTagList *tag_list;
\r
91 /* configured playback region */
\r
93 gboolean segment_running;
\r
94 GstEvent *pending_newsegment;
\r
96 /* gst index support */
\r
97 GstIndex *element_index;
\r
100 gint64 requested_seek_time;
\r
101 guint64 seek_offset;
\r
102 gboolean moof_rcvd;
\r
104 /* live specific params */
\r
105 piff_live_param_t *param;
\r
106 guint lookahead_cnt;
\r
110 struct _GstPiffDemuxClass {
\r
111 GstElementClass parent_class;
\r
112 void (*live_param) (GstPiffDemux *piff, const piff_live_param_t *param);
\r
115 GType gst_piffdemux_get_type (void);
\r
117 /* prepares video caps based on input params */
\r
118 void gst_piffdemux_set_video_params (GstPiffDemux * piffdemux, guint fourcc, guint width, guint height, guint fps_n, guint fps_d, unsigned char *codec_data, unsigned int codec_data_len);
\r
119 /* prepares audio caps based on input params */
\r
120 void gst_piffdemux_set_audio_params (GstPiffDemux * piffdemux, guint fourcc,
\r
121 guint sampling_rate, guint bps, guint channels, unsigned char *codec_data, unsigned int codec_data_len);
\r
124 #endif /* __GST_PIFFDEMUX_H__ */
\r