2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gstpipeline.c: Overall pipeline management element
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 //#define GST_DEBUG_ENABLED
24 #include "gst_private.h"
26 #include "gstpipeline.h"
27 #include "gstthread.h"
30 #include "gstautoplug.h"
31 #include "gstscheduler.h"
34 GstElementDetails gst_pipeline_details = {
37 "Complete pipeline object",
39 "Erik Walthinsen <omega@cse.ogi.edu>",
43 /* Pipeline signals and args */
55 static void gst_pipeline_class_init (GstPipelineClass *klass);
56 static void gst_pipeline_init (GstPipeline *pipeline);
58 static GstElementStateReturn gst_pipeline_change_state (GstElement *element);
60 static GstBinClass *parent_class = NULL;
61 //static guint gst_pipeline_signals[LAST_SIGNAL] = { 0 };
64 gst_pipeline_get_type (void) {
65 static GType pipeline_type = 0;
68 static const GTypeInfo pipeline_info = {
69 sizeof(GstPipelineClass),
72 (GClassInitFunc)gst_pipeline_class_init,
77 (GInstanceInitFunc)gst_pipeline_init,
80 pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
86 gst_pipeline_class_init (GstPipelineClass *klass)
88 GstElementClass *gstelement_class;
90 gstelement_class = (GstElementClass*)klass;
92 parent_class = g_type_class_ref (gst_bin_get_type ());
94 gstelement_class->change_state = gst_pipeline_change_state;
98 gst_pipeline_init (GstPipeline *pipeline)
100 // we're a manager by default
101 GST_FLAG_SET (pipeline, GST_BIN_FLAG_MANAGER);
103 GST_ELEMENT_SCHED (pipeline) = gst_schedulerfactory_make ("basic", GST_ELEMENT (pipeline));
104 GST_DEBUG (GST_CAT_PIPELINE, "pipeline's scheduler is %p\n", GST_ELEMENT_SCHED (pipeline));
110 * @name: name of new pipeline
112 * Create a new pipeline with the given name.
114 * Returns: newly created GstPipeline
117 gst_pipeline_new (const gchar *name)
119 return gst_elementfactory_make ("pipeline", name);
122 static GstElementStateReturn
123 gst_pipeline_change_state (GstElement *element)
125 if (GST_ELEMENT_CLASS (parent_class)->change_state)
126 return GST_ELEMENT_CLASS (parent_class)->change_state (element);
128 return GST_STATE_SUCCESS;