Debian Codegraph @

gstreamer/src/capsfeatures.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2014-2016 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
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 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <gst/gst.h>
21
22 _DEFS(gstreamermm,gst)
23
24 namespace Gst
25 {
26
27 /**
28 * A set of features in caps
29 *
30 * Gst::CapsFeatures can optionally be set on a Gst::Caps to add requirements
31 * for additional features for a specific Gst::Structure. Caps structures with
32 * the same name but with a non-equal set of caps features are not compatible.
33 * If a pad supports multiple sets of features it has to add multiple equal
34 * structures with different feature sets to the caps.
35 *
36 * Empty Gst::CapsFeatures are equivalent with the Gst::CapsFeatures that only
37 * contain Gst::CapsFeatures::memory_system_memory(). ANY Gst::CapsFeatures as
38 * created by Gst::CapsFeatures::create_any() are equal to any other Gst::CapsFeatures
39 * and can be used to specify that any Gst::CapsFeatures would be supported, e.g.
40 * for elements that don't touch buffer memory. Gst::Caps with ANY Gst::CapsFeatures
41 * are considered non-fixed and during negotiation some Gst::CapsFeatures have
42 * to be selected.
43 *
44 * Examples for caps features would be the requirement of a specific Gst::Memory
45 * types or the requirement of having a specific Gst::Meta on the buffer. Features
46 * are given as a string of the format "memory:GstMemoryTypeName" or
47 * "meta:GstMetaAPIName".
48 *
49 * Last reviewed on 2016-05-16 (1.8.0)
50 *
51 * Since: 1.2
52 */
53 class CapsFeatures
54 {
55 _CLASS_BOXEDTYPE(CapsFeatures, GstCapsFeatures, gst_caps_features_new_empty, gst_caps_features_copy, gst_caps_features_free)
56
57
58 _IGNORE(gst_caps_features_new_id_valist)
59 _IGNORE(gst_caps_features_new_valist)
60 _IGNORE(gst_caps_features_new_empty)
61 _IGNORE(gst_caps_features_copy)
62 _IGNORE(gst_caps_features_free)
63
64 public:
65 /**
66 * Creates a new Gst::CapsFeatures with the given features.
67 *
68 * @param features name of features to set.
69 */
70 explicit CapsFeatures(std::initializer_list<Glib::ustring> features);
71
72 _WRAP_METHOD(static Gst::CapsFeatures create_any(), gst_caps_features_new_any)
73
74 _WRAP_METHOD(static Gst::CapsFeatures create_from_string(const Glib::ustring& features), gst_caps_features_from_string)
75
76 _WRAP_METHOD(Glib::ustring to_string() const, gst_caps_features_to_string)
77
78 _WRAP_METHOD(bool set_parent_refcount(gint *refcount), gst_caps_features_set_parent_refcount)
79
80 _WRAP_METHOD(bool is_equal(const Gst::CapsFeatures& features2) const, gst_caps_features_is_equal)
81
82 _WRAP_METHOD(bool is_any() const, gst_caps_features_is_any)
83
84 _WRAP_METHOD(bool contains(const Glib::ustring& feature) const, gst_caps_features_contains)
85
86 _WRAP_METHOD(bool contains(GQuark feature) const, gst_caps_features_contains_id)
87
88 _WRAP_METHOD(guint get_size() const, gst_caps_features_get_size)
89
90 _WRAP_METHOD(Glib::ustring get_nth(guint i) const, gst_caps_features_get_nth)
91
92 _WRAP_METHOD(GQuark get_nth_id(guint i) const, gst_caps_features_get_nth_id)
93
94 _WRAP_METHOD(void add(const Glib::ustring& feature), gst_caps_features_add)
95
96 _WRAP_METHOD(void add(GQuark feature), gst_caps_features_add_id)
97
98 _WRAP_METHOD(void remove(const Glib::ustring& feature), gst_caps_features_remove)
99
100 _WRAP_METHOD(void remove(GQuark feature), gst_caps_features_remove_id)
101
102 /** Constant for system memory feature name.
103 */
104 static Glib::ustring memory_system_memory();
105 };
106
107 }