Debian Codegraph @

gstreamer/gstreamermm/audiosink.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_AUDIOSINK_H
3 #define _GSTREAMERMM_AUDIOSINK_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2008-2016 The gstreamermm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28 #include <gstreamermm/audioringbuffer.h>
29 #include <gstreamermm/audiobasesink.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 using GstAudioSink = struct _GstAudioSink;
34 using GstAudioSinkClass = struct _GstAudioSinkClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 namespace Gst
40 { class AudioSink_Class; } // namespace Gst
41 #endif //DOXYGEN_SHOULD_SKIP_THIS
42
43 namespace Gst
44 {
45
46 /** A simple base class for audio sinks.
47 * This is the most simple base class for audio sinks that only requires
48 * subclasses to implement a set of simple virtual functions:
49 *
50 * - open_vfunc() - Open the device.
51 * - prepare_vfunc() - Configure the device with the specified format.
52 * - write_vfunc() - Write samples to the device.
53 * - reset_vfunc() - Unblock writes and flush the device.
54 * - get_delay_vfunc() - Get the number of samples written but not yet played
55 * by the device.
56 * - unprepare_vfunc() - Undo operations done by prepare.
57 * - close_vfunc() - Close the device.
58 *
59 * All scheduling of samples and timestamps is done in this base class together
60 * with Gst::AudioBaseSink using a default implementation of a
61 * Gst::AudioRingBuffer that uses threads.
62 *
63 * Last reviewed on 2016-04-23 (1.8.0)
64 *
65 * @ingroup GstBaseClasses
66 */
67
68 class AudioSink : public Gst::AudioBaseSink
69 {
70
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72
73 public:
74 using CppObjectType = AudioSink;
75 using CppClassType = AudioSink_Class;
76 using BaseObjectType = GstAudioSink;
77 using BaseClassType = GstAudioSinkClass;
78
79 // noncopyable
80 AudioSink(const AudioSink&) = delete;
81 AudioSink& operator=(const AudioSink&) = delete;
82
83 private: friend class AudioSink_Class;
84 static CppClassType audiosink_class_;
85
86 protected:
87 explicit AudioSink(const Glib::ConstructParams& construct_params);
88 explicit AudioSink(GstAudioSink* castitem);
89
90 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91
92 public:
93
94 AudioSink(AudioSink&& src) noexcept;
95 AudioSink& operator=(AudioSink&& src) noexcept;
96
97 ~AudioSink() noexcept override;
98
99 /** Get the GType for this class, for use with the underlying GObject type system.
100 */
101 static GType get_type() G_GNUC_CONST;
102
103 #ifndef DOXYGEN_SHOULD_SKIP_THIS
104
105
106 static GType get_base_type() G_GNUC_CONST;
107 #endif
108
109 ///Provides access to the underlying C GObject.
110 GstAudioSink* gobj() { return reinterpret_cast<GstAudioSink*>(gobject_); }
111
112 ///Provides access to the underlying C GObject.
113 const GstAudioSink* gobj() const { return reinterpret_cast<GstAudioSink*>(gobject_); }
114
115 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
116 GstAudioSink* gobj_copy();
117
118 private:
119
120
121 public:
122 /** vfunc to open the device. No configuration needs to be done at this
123 * point. This function is also used to check if the device is available.
124 */
125 virtual bool open_vfunc();
126
127
128 /** vfunc to prepare the device to operate with the specified parameters.
129 */
130 virtual bool prepare_audiosink_vfunc(Gst::AudioRingBufferSpec& spec);
131
132 /** vfunc to undo operations done in prepare.
133 */
134 virtual bool unprepare_vfunc();
135
136
137 /** vfunc to close the device.
138 */
139 virtual bool close_vfunc();
140
141
142 /** vfunc to write data to the device.
143 */
144 virtual int write_vfunc(gpointer data, guint lenght);
145
146
147 /** vfunc to return how many samples are still in the device. This is used to
148 * drive the synchronisation.
149 */
150 virtual guint get_delay_vfunc() const;
151
152
153 /** vfunc to return as quickly as possible from a write and flush any pending
154 * samples from the device.
155 */
156 virtual void reset_vfunc();
157
158
159 protected:
160
161
162 public:
163
164 public:
165 //C++ methods used to invoke GTK+ virtual functions:
166
167 protected:
168 //GTK+ Virtual Functions (override these to change behaviour):
169
170 //Default Signal Handlers::
171
172
173 };
174
175 } // namespace Gst
176
177
178 namespace Glib
179 {
180 /** A Glib::wrap() method for this object.
181 *
182 * @param object The C instance.
183 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
184 * @result A C++ instance that wraps this C instance.
185 *
186 * @relates Gst::AudioSink
187 */
188 Glib::RefPtr<Gst::AudioSink> wrap(GstAudioSink* object, bool take_copy = false);
189 }
190
191
192 #endif /* _GSTREAMERMM_AUDIOSINK_H */
193