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;
71 gboolean no_more_pads;
73 GstClockTime duration;
74 GstClockTime start_offset;
82 GstSplitMuxPartReaderPadCb get_pad_cb;
86 struct _GstSplitMuxPartReaderClass
88 GstPipelineClass parent_class;
90 void (*prepared) (GstSplitMuxPartReader *reader);
91 void (*end_of_part) (GstSplitMuxPartReader *reader);
94 GType gst_splitmux_part_reader_get_type (void);
96 void gst_splitmux_part_reader_set_callbacks (GstSplitMuxPartReader *reader,
97 gpointer cb_data, GstSplitMuxPartReaderPadCb get_pad_cb);
98 gboolean gst_splitmux_part_reader_prepare (GstSplitMuxPartReader *part);
99 void gst_splitmux_part_reader_unprepare (GstSplitMuxPartReader *part);
100 void gst_splitmux_part_reader_set_location (GstSplitMuxPartReader *reader,
102 gboolean gst_splitmux_part_is_eos (GstSplitMuxPartReader *reader);
104 gboolean gst_splitmux_part_reader_activate (GstSplitMuxPartReader *part, GstSegment *seg);
105 void gst_splitmux_part_reader_deactivate (GstSplitMuxPartReader *part);
107 gboolean gst_splitmux_part_reader_src_query (GstSplitMuxPartReader *part, GstPad *src_pad, GstQuery * query);
108 void gst_splitmux_part_reader_set_start_offset (GstSplitMuxPartReader *part, GstClockTime offset);
109 GstClockTime gst_splitmux_part_reader_get_start_offset (GstSplitMuxPartReader *part);
110 GstClockTime gst_splitmux_part_reader_get_end_offset (GstSplitMuxPartReader *part);
111 GstClockTime gst_splitmux_part_reader_get_duration (GstSplitMuxPartReader * reader);
113 GstPad *gst_splitmux_part_reader_lookup_pad (GstSplitMuxPartReader *reader, GstPad *target);
114 GstFlowReturn gst_splitmux_part_reader_pop (GstSplitMuxPartReader *reader, GstPad *part_pad, GstDataQueueItem ** item);