2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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.
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.
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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #ifndef __GST_PIFFDEMUX_H__
22 #define __GST_PIFFDEMUX_H__
25 #include <gst/base/gstadapter.h>
26 #include "piffcommon.h"
29 #include <drm_client.h>
30 #include <drm_trusted_client.h>
31 #include <drm_client_types.h>
32 #include <drm_trusted_client_types.h>
37 GST_DEBUG_CATEGORY_EXTERN (piffdemux_debug);
38 #define GST_CAT_DEFAULT piffdemux_debug
40 #define GST_TYPE_PIFFDEMUX \
41 (gst_piffdemux_get_type())
42 #define GST_PIFFDEMUX(obj) \
43 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIFFDEMUX,GstPiffDemux))
44 #define GST_PIFFDEMUX_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIFFDEMUX,GstPiffDemuxClass))
46 #define GST_IS_PIFFDEMUX(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIFFDEMUX))
48 #define GST_IS_PIFFDEMUX_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIFFDEMUX))
51 #define GST_PIFFDEMUX_CAST(obj) ((GstPiffDemux *)(obj))
53 /* piffdemux produces these for atoms it cannot parse */
54 #define GST_PIFF_DEMUX_PRIVATE_TAG "private-piff-tag"
55 #define GST_PIFF_DEMUX_CLASSIFICATION_TAG "classification"
57 #define GST_PIFFDEMUX_MAX_STREAMS 8
59 typedef struct _GstPiffDemux GstPiffDemux;
60 typedef struct _GstPiffDemuxClass GstPiffDemuxClass;
61 typedef struct _PiffDemuxStream PiffDemuxStream;
63 struct _GstPiffDemux {
70 PiffDemuxStream *stream;
78 gboolean posted_redirect;
80 /* push based variables */
84 GstBuffer *mdatbuffer;
87 /* offset of the media data (i.e.: Size of header) */
89 /* offset of the mdat atom */
95 /* configured playback region */
97 gboolean segment_running;
98 GstEvent *pending_newsegment;
100 /* gst index support */
101 GstIndex *element_index;
104 gint64 requested_seek_time;
108 /* live specific params */
109 piff_live_param_t *param;
113 gboolean encrypt_content;
114 gboolean decrypt_init;
116 DRM_DECRYPT_HANDLE pr_handle;
118 GstBuffer *protection_header;
121 struct _GstPiffDemuxClass {
122 GstElementClass parent_class;
123 void (*live_param) (GstPiffDemux *piff, const piff_live_param_t *param);
126 GType gst_piffdemux_get_type (void);
128 /* prepares video caps based on input params */
129 void gst_piffdemux_set_video_params (GstPiffDemux * piffdemux, guint fourcc, guint width, guint height,
130 guint fps_n, guint fps_d, unsigned char *codec_data, unsigned int codec_data_len);
131 /* prepares audio caps based on input params */
132 void gst_piffdemux_set_audio_params (GstPiffDemux * piffdemux, guint fourcc, guint sampling_rate, guint bps,
133 guint channels, unsigned char *codec_data, unsigned int codec_data_len);
136 #endif /* __GST_PIFFDEMUX_H__ */