• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  *
3  * Copyright (c) 2008,2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
4  * Copyright (c) 2008-2017 Collabora Ltd
5  *  @author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
6  *  @author: Vincent Penquerc'h <vincent.penquerch@collabora.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef __GST_FLV_MUX_H__
25 #define __GST_FLV_MUX_H__
26 
27 #include <gst/gst.h>
28 #include <gst/base/gstaggregator.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GST_TYPE_FLV_MUX_PAD (gst_flv_mux_pad_get_type())
33 #define GST_FLV_MUX_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLV_MUX_PAD, GstFlvMuxPad))
34 #define GST_FLV_MUX_PAD_CAST(obj) ((GstFlvMuxPad *)(obj))
35 #define GST_FLV_MUX_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLV_MUX_PAD, GstFlvMuxPad))
36 #define GST_IS_FLV_MUX_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLV_MUX_PAD))
37 #define GST_IS_FLV_MUX_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLV_MUX_PAD))
38 
39 typedef struct _GstFlvMuxPad GstFlvMuxPad;
40 typedef struct _GstFlvMuxPadClass GstFlvMuxPadClass;
41 typedef struct _GstFlvMux GstFlvMux;
42 typedef struct _GstFlvMuxClass GstFlvMuxClass;
43 
44 #define GST_TYPE_FLV_MUX \
45   (gst_flv_mux_get_type ())
46 #define GST_FLV_MUX(obj) \
47   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_FLV_MUX, GstFlvMux))
48 #define GST_FLV_MUX_CAST(obj) ((GstFlvMux *)obj)
49 #define GST_FLV_MUX_CLASS(klass) \
50   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_FLV_MUX, GstFlvMuxClass))
51 #define GST_IS_FLV_MUX(obj) \
52   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FLV_MUX))
53 #define GST_IS_FLV_MUX_CLASS(klass) \
54   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FLV_MUX))
55 
56 struct _GstFlvMuxPad
57 {
58   GstAggregatorPad aggregator_pad;
59 
60   guint codec;
61   guint rate;
62   guint width;
63   guint channels;
64   GstBuffer *codec_data;
65 
66   guint bitrate;
67 
68   GstClockTime last_timestamp;
69   GstClockTime pts;
70   GstClockTime dts;
71 
72   gboolean info_changed;
73   gboolean drop_deltas;
74 };
75 
76 struct _GstFlvMuxPadClass {
77   GstAggregatorPadClass parent;
78 };
79 
80 typedef enum
81 {
82   GST_FLV_MUX_STATE_HEADER,
83   GST_FLV_MUX_STATE_DATA
84 } GstFlvMuxState;
85 
86 struct _GstFlvMux {
87   GstAggregator   aggregator;
88 
89   GstPad         *srcpad;
90 
91   /* <private> */
92   GstFlvMuxState state;
93   GstFlvMuxPad *audio_pad;
94   GstFlvMuxPad *video_pad;
95   gboolean streamable;
96   gchar *metadatacreator;
97   gchar *encoder;
98   gboolean skip_backwards_streams;
99 
100   GstTagList *tags;
101   gboolean new_tags;
102   GList *index;
103   guint64 byte_count;
104   GstClockTime duration;
105   GstClockTime first_timestamp;
106   guint64 last_dts;
107 
108   gboolean sent_header;
109 };
110 
111 struct _GstFlvMuxClass {
112   GstAggregatorClass parent;
113 };
114 
115 GType    gst_flv_mux_pad_get_type(void);
116 GType    gst_flv_mux_get_type    (void);
117 
118 G_END_DECLS
119 
120 #endif /* __GST_FLV_MUX_H__ */
121