QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
ghostpad.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 "ghostpad.h"
18 #include <gst/gst.h>
19 
20 namespace QGst {
21 
22 GhostPadPtr GhostPad::create(const PadPtr & target, const char *name)
23 {
24  GstPad *gp = gst_ghost_pad_new(name, target);
25  if (gp) {
26  gst_object_ref_sink(gp);
27  }
28  return GhostPadPtr::wrap(GST_GHOST_PAD(gp), false);
29 }
30 
31 GhostPadPtr GhostPad::create(PadDirection direction, const char *name)
32 {
33  GstPad *gp = gst_ghost_pad_new_no_target(name, static_cast<GstPadDirection>(direction));
34  if (gp) {
35  gst_object_ref_sink(gp);
36  }
37  return GhostPadPtr::wrap(GST_GHOST_PAD(gp), false);
38 }
39 
40 PadPtr GhostPad::target() const
41 {
42  return PadPtr::wrap(gst_ghost_pad_get_target(object<GstGhostPad>()), false);
43 }
44 
45 bool GhostPad::setTarget(const PadPtr & target)
46 {
47  return gst_ghost_pad_set_target(object<GstGhostPad>(), target);
48 }
49 
50 }
static RefPointer< T > wrap(typename T::CType *nativePtr, bool increaseRef=true)
Definition: refpointer.h:326