1 /* GStreamer Split Muxed File Source - Part reader
2 * Copyright (C) 2014 Jan Schmidt <jan@centricular.com>
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.
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.
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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
19 #ifndef __GST_SPLITMUX_PART_READER_H__
20 #define __GST_SPLITMUX_PART_READER_H__
23 #include <gst/base/gstdataqueue.h>
27 #define GST_TYPE_SPLITMUX_PART_READER \
28 (gst_splitmux_part_reader_get_type())
29 #define GST_SPLITMUX_PART_READER(obj) \
30 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SPLITMUX_PART_READER,GstSplitMuxSrc))
31 #define GST_SPLITMUX_PART_READER_CLASS(klass) \
32 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SPLITMUX_PART_READER,GstSplitMuxSrcClass))
33 #define GST_IS_SPLITMUX_PART_READER(obj) \
34 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPLITMUX_PART_READER))
35 #define GST_IS_SPLITMUX_PART_READER_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPLITMUX_PART_READER))
38 typedef struct _GstSplitMuxPartReader GstSplitMuxPartReader;
39 typedef struct _GstSplitMuxPartReaderClass GstSplitMuxPartReaderClass;
40 typedef struct _SplitMuxSrcPad SplitMuxSrcPad;
41 typedef struct _SplitMuxSrcPadClass SplitMuxSrcPadClass;
46 PART_STATE_PREPARING_COLLECT_STREAMS,
47 PART_STATE_PREPARING_MEASURE_STREAMS,
48 PART_STATE_PREPARING_RESET_FOR_READY,
51 } GstSplitMuxPartState;
53 typedef GstPad *(*GstSplitMuxPartReaderPadCb)(GstSplitMuxPartReader *reader, GstPad *src_pad, gpointer cb_data);
55 struct _GstSplitMuxPartReader
59 GstSplitMuxPartState prep_state;
67 gboolean async_pending;
72 gboolean no_more_pads;
74 GstClockTime duration;
75 GstClockTime start_offset;
83 GstSplitMuxPartReaderPadCb get_pad_cb;
87 struct _GstSplitMuxPartReaderClass
89 GstPipelineClass parent_class;
91 void (*prepared) (GstSplitMuxPartReader *reader);
92 void (*end_of_part) (GstSplitMuxPartReader *reader);
95 GType gst_splitmux_part_reader_get_type (void);
97 void gst_splitmux_part_reader_set_callbacks (GstSplitMuxPartReader *reader,
98 gpointer cb_data, GstSplitMuxPartReaderPadCb get_pad_cb);
99 gboolean gst_splitmux_part_reader_prepare (GstSplitMuxPartReader *part);
100 void gst_splitmux_part_reader_unprepare (GstSplitMuxPartReader *part);
101 void gst_splitmux_part_reader_set_location (GstSplitMuxPartReader *reader,
103 gboolean gst_splitmux_part_is_eos (GstSplitMuxPartReader *reader);
105 gboolean gst_splitmux_part_reader_activate (GstSplitMuxPartReader *part, GstSegment *seg, GstSeekFlags extra_flags);
106 void gst_splitmux_part_reader_deactivate (GstSplitMuxPartReader *part);
107 gboolean gst_splitmux_part_reader_is_active (GstSplitMuxPartReader *part);
109 gboolean gst_splitmux_part_reader_src_query (GstSplitMuxPartReader *part, GstPad *src_pad, GstQuery * query);
110 void gst_splitmux_part_reader_set_start_offset (GstSplitMuxPartReader *part, GstClockTime offset);
111 GstClockTime gst_splitmux_part_reader_get_start_offset (GstSplitMuxPartReader *part);
112 GstClockTime gst_splitmux_part_reader_get_end_offset (GstSplitMuxPartReader *part);
113 GstClockTime gst_splitmux_part_reader_get_duration (GstSplitMuxPartReader * reader);
115 GstPad *gst_splitmux_part_reader_lookup_pad (GstSplitMuxPartReader *reader, GstPad *target);
116 GstFlowReturn gst_splitmux_part_reader_pop (GstSplitMuxPartReader *reader, GstPad *part_pad, GstDataQueueItem ** item);