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 gint64 pts; 70 gint64 dts; 71 72 gboolean info_changed; 73 }; 74 75 struct _GstFlvMuxPadClass { 76 GstAggregatorPadClass parent; 77 }; 78 79 typedef enum 80 { 81 GST_FLV_MUX_STATE_HEADER, 82 GST_FLV_MUX_STATE_DATA 83 } GstFlvMuxState; 84 85 struct _GstFlvMux { 86 GstAggregator aggregator; 87 88 GstPad *srcpad; 89 90 /* <private> */ 91 GstFlvMuxState state; 92 GstFlvMuxPad *audio_pad; 93 GstFlvMuxPad *video_pad; 94 gboolean streamable; 95 gchar *metadatacreator; 96 gchar *encoder; 97 98 GstTagList *tags; 99 gboolean new_tags; 100 GList *index; 101 guint64 byte_count; 102 guint64 duration; 103 gint64 first_timestamp; 104 GstClockTime last_dts; 105 106 gboolean sent_header; 107 }; 108 109 struct _GstFlvMuxClass { 110 GstAggregatorClass parent; 111 }; 112 113 GType gst_flv_mux_pad_get_type(void); 114 GType gst_flv_mux_get_type (void); 115 116 G_END_DECLS 117 118 #endif /* __GST_FLV_MUX_H__ */ 119