2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_PLAYBASEBIN_H__
21 #define __GST_PLAYBASEBIN_H__
24 #include "gststreaminfo.h"
28 #define GST_TYPE_PLAY_BASE_BIN (gst_play_base_bin_get_type())
29 #define GST_PLAY_BASE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_BASE_BIN,GstPlayBaseBin))
30 #define GST_PLAY_BASE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_BASE_BIN,GstPlayBaseBinClass))
31 #define GST_IS_PLAY_BASE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_BASE_BIN))
32 #define GST_IS_PLAY_BASE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_BASE_BIN))
33 #define GST_PLAY_BASE_BIN_GET_CLASS(obj) \
34 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAY_BASE_BIN, \
37 typedef struct _GstPlayBaseBin GstPlayBaseBin;
38 typedef struct _GstPlayBaseBinClass GstPlayBaseBinClass;
40 /* a GstPlayBaseGroup is a group of pads and streaminfo that together
41 * make up a playable stream. A new group is created from the current
42 * set of pads that are alive when the preroll elements are filled or
43 * when the no-more-pads signal is fired.
45 * We have to queue the groups as they can be created while the preroll
46 * queues are still playing the old group. We monitor the EOS signals
47 * on the preroll queues and when all the streams in the current group
48 * have EOSed, we switch to the next queued group.
52 GstPlayBaseBin *bin; /* ref to the owner */
57 /* contained decoded elementary streams */
65 } type[NUM_TYPES]; /* AUDIO, VIDEO, TEXT */
68 struct _GstPlayBaseBin {
73 guint queue_threshold;
75 /* currently loaded media */
76 gint current[NUM_TYPES];
81 GstElement *subtitle; /* additional filesrc ! subparse bin */
82 gboolean need_rebuild;
84 /* group management - using own lock */
85 GMutex *group_lock; /* lock and mutex to signal availability of new group */
87 GstPlayBaseGroup *building_group; /* the group that we are constructing */
88 GList *queued_groups; /* the constructed groups, head is the active one */
91 struct _GstPlayBaseBinClass {
92 GstPipelineClass parent_class;
94 /* virtual fuctions */
95 gboolean (*setup_output_pads) (GstPlayBaseBin *play_base_bin,
96 GstPlayBaseGroup *group);
99 GType gst_play_base_bin_get_type (void);
103 #endif /* __GST_PLAYBASEBIN_H__ */