tizen 2.0 init
[framework/multimedia/gst-plugins-good0.10.git] / gst / multifile / gstmultifilesink.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *                    2006 Wim Taymans <wim@fluendo.com>
5  *                    2006 David A. Schleef <ds@schleef.org>
6  *
7  * gstmultifilesink.h:
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifndef __GST_MULTIFILESINK_H__
26 #define __GST_MULTIFILESINK_H__
27
28 #include <gst/gst.h>
29 #include <gst/base/gstbasesink.h>
30 #include <errno.h>
31 #include <stdio.h>
32 #include <string.h>
33 #include <sys/stat.h>
34 #include <sys/types.h>
35 #ifdef HAVE_UNISTD_H
36 #include <unistd.h>
37 #endif
38
39 G_BEGIN_DECLS
40
41 #define GST_TYPE_MULTI_FILE_SINK \
42   (gst_multi_file_sink_get_type())
43 #define GST_MULTI_FILE_SINK(obj) \
44   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_FILE_SINK,GstMultiFileSink))
45 #define GST_MULTI_FILE_SINK_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_FILE_SINK,GstMultiFileSinkClass))
47 #define GST_IS_MULTI_FILE_SINK(obj) \
48   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_FILE_SINK))
49 #define GST_IS_MULTI_FILE_SINK_CLASS(klass) \
50   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_FILE_SINK))
51
52 typedef struct _GstMultiFileSink GstMultiFileSink;
53 typedef struct _GstMultiFileSinkClass GstMultiFileSinkClass;
54
55 /**
56  * GstMultiFileSinkNext:
57  * @GST_MULTI_FILE_SINK_NEXT_BUFFER: New file for each buffer
58  * @GST_MULTI_FILE_SINK_NEXT_DISCONT: New file after each discontinuity
59  * @GST_MULTI_FILE_SINK_NEXT_KEY_FRAME: New file at each key frame
60  *  (Useful for MPEG-TS segmenting)
61  * @GST_MULTI_FILE_SINK_NEXT_KEY_UNIT_EVENT: New file after a force key unit
62  *  event (Since: 0.10.31)
63  * @GST_MULTI_FILE_SINK_NEXT_MAX_SIZE: New file when the configured maximum file
64  *  size would be exceeded with the next buffer or buffer list (Since: 0.10.31)
65  *
66  * File splitting modes.
67  */
68 typedef enum {
69   GST_MULTI_FILE_SINK_NEXT_BUFFER,
70   GST_MULTI_FILE_SINK_NEXT_DISCONT,
71   GST_MULTI_FILE_SINK_NEXT_KEY_FRAME,
72   GST_MULTI_FILE_SINK_NEXT_KEY_UNIT_EVENT,
73   GST_MULTI_FILE_SINK_NEXT_MAX_SIZE
74 } GstMultiFileSinkNext;
75
76 struct _GstMultiFileSink
77 {
78   GstBaseSink parent;
79
80   gchar *filename;
81   gint index;
82   gboolean post_messages;
83   GstMultiFileSinkNext next_file;
84   FILE *file;
85   guint max_files;
86   GSList *files;
87   guint n_files;
88
89   gint64 next_segment;
90
91   int n_streamheaders;
92   GstBuffer **streamheaders;
93   guint force_key_unit_count;
94
95   guint64 cur_file_size;
96   guint64 max_file_size;
97 };
98
99 struct _GstMultiFileSinkClass
100 {
101   GstBaseSinkClass parent_class;
102 };
103
104 GType gst_multi_file_sink_get_type (void);
105
106 G_END_DECLS
107
108 #endif /* __GST_MULTIFILESINK_H__ */