Debian Codegraph @

gstreamer/src/audioinfo.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008-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/audio/audio-info.h>
21 #include <gstreamermm/audioformat.h>
22 #include <gstreamermm/audioringbuffer.h>
23
24 _DEFS(gstreamermm,gst)
25
26 namespace Gst
27 {
28
29 _WRAP_ENUM(AudioFlags, GstAudioFlags)
30 _WRAP_ENUM(AudioLayout, GstAudioLayout)
31
32 class Caps;
33
34 /** Information describing audio properties. This information can be filled
35 * in from Gst::Caps with from_caps() or Gst::AudioInfo() constructor.
36 *
37 * Last reviewed on 2016-04-23 (1.8.0).
38 */
39 class AudioInfo
40 {
41 _CLASS_BOXEDTYPE(AudioInfo, GstAudioInfo, gst_audio_info_new, gst_audio_info_copy, gst_audio_info_free)
42 _IGNORE(gst_audio_info_copy, gst_audio_info_free)
43 public:
44
45 /** Create AudioInfo from @a caps.
46 *
47 * @param caps A Gst::Caps.
48 *
49 * @throw std::runtime_error if @a caps could not be parsed.
50 */
51 AudioInfo(const Glib::RefPtr<const Gst::Caps>& caps);
52
53 _WRAP_METHOD(bool is_equal(const Gst::AudioInfo& other) const, gst_audio_info_is_equal)
54
55 _WRAP_METHOD(void init(), gst_audio_info_init)
56
57 _WRAP_METHOD(bool from_caps(const Glib::RefPtr<const Gst::Caps>& caps), gst_audio_info_from_caps)
58 _WRAP_METHOD(Glib::RefPtr<Gst::Caps> to_caps() const, gst_audio_info_to_caps)
59
60 _WRAP_METHOD(bool convert(Gst::Format fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val) const, gst_audio_info_convert, newin "1,8")
61
62 #m4 _CONVERSION(`const Gst::AudioChannelPosition*',`const GstAudioChannelPosition*',`reinterpret_cast<const GstAudioChannelPosition*>($3)')
63 _WRAP_METHOD(void set_format(Gst::AudioFormat format, int rate, int channels, const Gst::AudioChannelPosition *position), gst_audio_info_set_format, newin "1,8")
64
65 _MEMBER_GET(flags, flags, Gst::AudioFlags, GstAudioFlags)
66 _MEMBER_SET(flags, flags, Gst::AudioFlags, GstAudioFlags)
67
68 _MEMBER_GET(layout, layout, Gst::AudioLayout, GstAudioLayout)
69 _MEMBER_SET(layout, layout, Gst::AudioLayout, GstAudioLayout)
70
71 _MEMBER_GET(rate, rate, int, gint)
72 _MEMBER_SET(rate, rate, int, gint)
73
74 _MEMBER_GET(channels, channels, int, gint)
75 _MEMBER_SET(channels, channels, int, gint)
76
77 _MEMBER_GET(bpf, bpf, int, gint)
78 _MEMBER_SET(bpf, bpf, int, gint)
79
80 _MEMBER_GET(finfo, finfo, const Gst::AudioFormatInfo, const GstAudioFormatInfo*)
81 };
82
83 }