gst-indent
[platform/upstream/gst-plugins-good.git] / gst / avi / gstavimux.h
1 /* AVI muxer plugin for GStreamer
2  * Copyright (C) 2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_AVIMUX_H__
22 #define __GST_AVIMUX_H__
23
24
25 #include <gst/gst.h>
26 #include <gst/riff/riff-ids.h>
27 #include "avi-ids.h"
28
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif                          /* __cplusplus */
34
35
36 #define GST_TYPE_AVIMUX \
37   (gst_avimux_get_type())
38 #define GST_AVIMUX(obj) \
39   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVIMUX,GstAviMux))
40 #define GST_AVIMUX_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVIMUX,GstAviMux))
42 #define GST_IS_AVIMUX(obj) \
43   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVIMUX))
44 #define GST_IS_AVIMUX_CLASS(obj) \
45   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVIMUX))
46
47
48   typedef struct _GstAviMux GstAviMux;
49   typedef struct _GstAviMuxClass GstAviMuxClass;
50
51   struct _GstAviMux
52   {
53     GstElement element;
54
55     /* pads */
56     GstPad *srcpad;
57     GstPad *audiosinkpad;
58     gboolean audio_pad_connected, audio_pad_eos;
59     GstPad *videosinkpad;
60     gboolean video_pad_connected, video_pad_eos;
61
62     /* the AVI header */
63     gst_riff_avih avi_hdr;
64     guint32 total_frames;       /* total number of frames */
65     guint64 total_data;         /* amount of total data */
66     guint32 data_size, datax_size;      /* amount of data (bytes) in the AVI/AVIX block */
67     guint32 num_frames, numx_frames;    /* num frames in the AVI/AVIX block */
68     guint32 header_size;
69     gboolean write_header;
70     gboolean restart;
71     guint32 audio_size;
72     guint64 audio_time;
73
74     /* video header */
75     gst_riff_strh vids_hdr;
76     gst_riff_strf_vids vids;
77
78     /* audio header */
79     gst_riff_strh auds_hdr;
80     gst_riff_strf_auds auds;
81
82     /* information about the AVI index ('idx') */
83     gst_riff_index_entry *idx;
84     gint idx_index, idx_count;
85     guint32 idx_offset, idx_size;
86
87     /* are we a big file already? */
88     gboolean is_bigfile;
89     guint64 avix_start;
90
91     /* whether to use "large AVI files" or just stick to small indexed files */
92     gboolean enable_large_avi;
93
94     /* in order to be usable as a loopbased element, we need an internal
95      * 'buffered' buffer for each pad, so one for audio, one for video */
96     GstBuffer *audio_buffer_queue, *video_buffer_queue;
97   };
98
99   struct _GstAviMuxClass
100   {
101     GstElementClass parent_class;
102   };
103
104   GType gst_avimux_get_type (void);
105
106 #ifdef __cplusplus
107 }
108 #endif                          /* __cplusplus */
109
110
111 #endif                          /* __GST_AVIMUX_H__ */