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>
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.
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.
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., 51 Franklin St, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
25 #ifndef __GST_MULTIFILESINK_H__
26 #define __GST_MULTIFILESINK_H__
29 #include <gst/base/base.h>
34 #include <sys/types.h>
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))
52 typedef struct _GstMultiFileSink GstMultiFileSink;
53 typedef struct _GstMultiFileSinkClass GstMultiFileSinkClass;
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
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
65 * @GST_MULTI_FILE_SINK_NEXT_MAX_DURATION: New file when the configured maximum duration
66 * would be exceeded with the next buffer or buffer list
68 * File splitting modes.
71 GST_MULTI_FILE_SINK_NEXT_BUFFER,
72 GST_MULTI_FILE_SINK_NEXT_DISCONT,
73 GST_MULTI_FILE_SINK_NEXT_KEY_FRAME,
74 GST_MULTI_FILE_SINK_NEXT_KEY_UNIT_EVENT,
75 GST_MULTI_FILE_SINK_NEXT_MAX_SIZE,
76 GST_MULTI_FILE_SINK_NEXT_MAX_DURATION
77 } GstMultiFileSinkNext;
79 struct _GstMultiFileSink
85 gboolean post_messages;
86 GstMultiFileSinkNext next_file;
95 GstBuffer **streamheaders;
96 guint force_key_unit_count;
98 guint64 cur_file_size;
99 guint64 max_file_size;
101 GstClockTime file_pts;
102 GstClockTime max_file_duration;
104 gboolean aggregate_gops;
105 GstAdapter *gop_adapter; /* to aggregate GOPs */
106 GList *potential_next_gop; /* To detect false-positives */
109 struct _GstMultiFileSinkClass
111 GstBaseSinkClass parent_class;
114 GType gst_multi_file_sink_get_type (void);
118 #endif /* __GST_MULTIFILESINK_H__ */