QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
pipeline.cpp
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program 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
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "pipeline.h"
18 #include "bus.h"
19 #include "clock.h"
20 #include <gst/gst.h>
21 
22 namespace QGst {
23 
24 //static
25 PipelinePtr Pipeline::create(const char *name)
26 {
27  GstElement *p = gst_pipeline_new(name);
28  if (p) {
29  gst_object_ref_sink(p);
30  }
31  return PipelinePtr::wrap(GST_PIPELINE(p), false);
32 }
33 
34 BusPtr Pipeline::bus() const
35 {
36  return BusPtr::wrap(gst_pipeline_get_bus(object<GstPipeline>()), false);
37 }
38 
39 ClockPtr Pipeline::clock() const
40 {
41  return ClockPtr::wrap(gst_pipeline_get_clock(object<GstPipeline>()), false);
42 }
43 
44 bool Pipeline::setClock(const ClockPtr & clock)
45 {
46  return gst_pipeline_set_clock(object<GstPipeline>(), clock);
47 }
48 
49 void Pipeline::useClock(const ClockPtr & clock)
50 {
51  gst_pipeline_use_clock(object<GstPipeline>(), clock);
52 }
53 
54 void Pipeline::enableAutoClock()
55 {
56  gst_pipeline_auto_clock(object<GstPipeline>());
57 }
58 
59 }
static RefPointer< Pipeline > wrap(typename Pipeline::CType *nativePtr, bool increaseRef=true)