Debian Codegraph @

gstreamer/gstreamermm/format.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/format.h>
7 #include <gstreamermm/private/format_p.h>
8
9
10 /* gstreamermm - a C++ wrapper for gstreamer
11 *
12 * Copyright 2008 The gstreamermm Development Team
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29 #include <gst/gst.h>
30 #include <gstreamermm/iterator.h>
31
32 namespace Gst
33 {
34
35 FormatDefinition::FormatDefinition()
36 : value(Gst::FORMAT_UNDEFINED),
37 quark(static_cast<GQuark>(0))
38 {}
39
40 FormatDefinition::FormatDefinition(const GstFormatDefinition* castitem)
41 : value(Gst::FORMAT_UNDEFINED),
42 quark((castitem) ? castitem->quark : static_cast<GQuark>(0))
43 {
44 if(castitem)
45 {
46 value = static_cast<Format>(castitem->value);
47 nick = castitem->nick;
48 description = castitem->description;
49 }
50 }
51
52 namespace Enums
53 {
54
55 Glib::ustring get_name(Format f)
56 {
57 return gst_format_get_name(static_cast<GstFormat>(f));
58 }
59
60 Glib::QueryQuark get_quark(Format f)
61 {
62 return Glib::QueryQuark(gst_format_to_quark(static_cast<GstFormat>(f)));
63 }
64
65 } //namespace Enums
66
67 Format get_format(const Glib::ustring& nick)
68 {
69 return static_cast<Format>(gst_format_get_by_nick(nick.c_str()));
70 }
71
72 Format register_format(const Glib::ustring& nick, const Glib::ustring&
73 description)
74 {
75 return static_cast<Format>(gst_format_register(nick.c_str(), description.c_str()));
76 }
77
78 bool formats_contain(const Glib::ArrayHandle<Format>& formats, Format format)
79 {
80 return gst_formats_contains(reinterpret_cast<const GstFormat*>((formats).data()), static_cast<GstFormat>(format));
81 }
82
83 bool get_format_details(Format format, FormatDefinition& def)
84 {
85 const GstFormatDefinition* gstdef = gst_format_get_details(static_cast<GstFormat>(format));
86
87 if(!gstdef)
88 return false;
89
90 def.value = Format(gstdef->value);
91 def.nick = gstdef->nick;
92 def.description = gstdef->description;
93 def.quark = gstdef->quark;
94
95 return true;
96 }
97
98 IteratorBasic<const FormatDefinition> iterate_format_definitions()
99 {
100 return IteratorBasic<const FormatDefinition>(gst_format_iterate_definitions());
101 }
102
103 } //namespace Gst
104
105 namespace
106 {
107 } // anonymous namespace
108
109 // static
110 GType Glib::Value<Gst::Format>::value_type()
111 {
112 return gst_format_get_type();
113 }
114
115
116 namespace Gst
117 {
118
119
120 } // namespace Gst
121
122