2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * <2007> Wim Taymans <wim.taymans@gmail.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __GST_PLAYBASEBIN_H__
22 #define __GST_PLAYBASEBIN_H__
25 #include "gststreaminfo.h"
29 #define GST_TYPE_PLAY_BASE_BIN (gst_play_base_bin_get_type())
30 #define GST_PLAY_BASE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_BASE_BIN,GstPlayBaseBin))
31 #define GST_PLAY_BASE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_BASE_BIN,GstPlayBaseBinClass))
32 #define GST_IS_PLAY_BASE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_BASE_BIN))
33 #define GST_IS_PLAY_BASE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_BASE_BIN))
34 #define GST_PLAY_BASE_BIN_GET_CLASS(obj) \
35 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAY_BASE_BIN, \
38 typedef struct _GstPlayBaseBin GstPlayBaseBin;
39 typedef struct _GstPlayBaseBinClass GstPlayBaseBinClass;
41 /* a GstPlayBaseGroup is a group of pads and streaminfo that together
42 * make up a playable stream. A new group is created from the current
43 * set of pads that are alive when the preroll elements are filled or
44 * when the no-more-pads signal is fired.
46 * We have to queue the groups as they can be created while the preroll
47 * queues are still playing the old group. We monitor the EOS signals
48 * on the preroll queues and when all the streams in the current group
49 * have EOSed, we switch to the next queued group.
53 GstPlayBaseBin *bin; /* ref to the owner */
57 GValueArray *streaminfo_value_array;
59 /* contained decoded elementary streams */
67 } type[NUM_TYPES]; /* AUDIO, VIDEO, TEXT, SUBPIC */
70 struct _GstPlayBaseBin {
75 guint64 queue_threshold;
76 guint64 queue_min_threshold;
77 /* connection speed in bits/sec (0 = unknown) */
78 guint connection_speed;
81 /* currently loaded media */
82 gint current[NUM_TYPES];
87 GstElement *subtitle; /* additional filesrc ! subparse bin */
88 gboolean subtitle_done;
89 gboolean need_rebuild;
90 gboolean raw_decoding_mode; /* Use smaller queues when source outputs raw data */
92 GSList *subtitle_elements; /* subtitle elements that have 'subtitle-encoding' property */
93 gchar *subencoding; /* encoding to propagate to the above subtitle elements */
94 GMutex *sub_lock; /* protecting subtitle_elements and subencoding members */
96 /* group management - using own lock */
97 GMutex *group_lock; /* lock and mutex to signal availability of new group */
99 GstPlayBaseGroup *building_group; /* the group that we are constructing */
100 GList *queued_groups; /* the constructed groups, head is the active one */
102 /* for dynamic sources */
103 guint src_np_sig_id; /* new-pad signal id */
104 guint src_nmp_sig_id; /* no-more-pads signal id */
108 struct _GstPlayBaseBinClass {
109 GstPipelineClass parent_class;
111 /* virtual functions */
112 gboolean (*setup_output_pads) (GstPlayBaseBin *play_base_bin,
113 GstPlayBaseGroup *group);
115 void (*set_subtitles_visible) (GstPlayBaseBin *play_base_bin,
117 void (*set_audio_mute) (GstPlayBaseBin *play_base_bin,
121 GType gst_play_base_bin_get_type (void);
125 #endif /* __GST_PLAYBASEBIN_H__ */