| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_AUDIOBASESRC_H |
| 3 | #define _GSTREAMERMM_AUDIOBASESRC_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 <gst/audio/gstaudiobasesrc.h> |
| 29 | #include <gstreamermm/pushsrc.h> |
| 30 | |
| 31 | |
| 32 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 33 | using GstAudioBaseSrc = struct _GstAudioBaseSrc; |
| 34 | using GstAudioBaseSrcClass = struct _GstAudioBaseSrcClass; |
| 35 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 36 | |
| 37 | |
| 38 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 39 | namespace Gst |
| 40 | { class AudioBaseSrc_Class; } // namespace Gst |
| 41 | #endif //DOXYGEN_SHOULD_SKIP_THIS |
| 42 | |
| 43 | namespace Gst |
| 44 | { |
| 45 | |
| 46 | class AudioRingBuffer; |
| 47 | |
| 48 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 49 | |
| 50 | /** |
| 51 | * @var AudioBaseSrcSlaveMethod AUDIO_BASE_SRC_SLAVE_RESAMPLE |
| 52 | * Resample to match the master clock. |
| 53 | * |
| 54 | * @var AudioBaseSrcSlaveMethod AUDIO_BASE_SRC_SLAVE_RETIMESTAMP |
| 55 | * Retimestamp output buffers with master |
| 56 | * clock time. |
| 57 | * |
| 58 | * @var AudioBaseSrcSlaveMethod AUDIO_BASE_SRC_SLAVE_SKEW |
| 59 | * Adjust capture pointer when master clock |
| 60 | * drifts too much. |
| 61 | * |
| 62 | * @var AudioBaseSrcSlaveMethod AUDIO_BASE_SRC_SLAVE_NONE |
| 63 | * No adjustment is done. |
| 64 | * |
| 65 | * @enum AudioBaseSrcSlaveMethod |
| 66 | * |
| 67 | * Different possible clock slaving algorithms when the internal audio clock was |
| 68 | * not selected as the pipeline clock. |
| 69 | * |
| 70 | * @ingroup gstreamermmEnums |
| 71 | */ |
| 72 | enum AudioBaseSrcSlaveMethod |
| 73 | { |
| 74 | AUDIO_BASE_SRC_SLAVE_RESAMPLE, |
| 75 | AUDIO_BASE_SRC_SLAVE_RETIMESTAMP, |
| 76 | AUDIO_BASE_SRC_SLAVE_SKEW, |
| 77 | AUDIO_BASE_SRC_SLAVE_NONE |
| 78 | }; |
| 79 | |
| 80 | } // namespace Gst |
| 81 | |
| 82 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 83 | namespace Glib |
| 84 | { |
| 85 | |
| 86 | template <> |
| 87 | class Value<Gst::AudioBaseSrcSlaveMethod> : public Glib::Value_Enum<Gst::AudioBaseSrcSlaveMethod> |
| 88 | { |
| 89 | public: |
| 90 | static GType value_type() G_GNUC_CONST; |
| 91 | }; |
| 92 | |
| 93 | } // namespace Glib |
| 94 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 95 | |
| 96 | namespace Gst |
| 97 | { |
| 98 | |
| 99 | |
| 100 | /** The base class for audio sources. |
| 101 | * This is the base class for audio sources. Subclasses need to implement the |
| 102 | * create_ringbuffer_vfunc vmethod. This base class will then take care of |
| 103 | * reading samples from the audioringbuffer, synchronisation and flushing. |
| 104 | * |
| 105 | * Last reviewed on 2016-04-23 (1.8.0). |
| 106 | * |
| 107 | * @ingroup GstBaseClasses |
| 108 | */ |
| 109 | |
| 110 | class AudioBaseSrc : public Gst::PushSrc |
| 111 | { |
| 112 | |
| 113 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 114 | |
| 115 | public: |
| 116 | using CppObjectType = AudioBaseSrc; |
| 117 | using CppClassType = AudioBaseSrc_Class; |
| 118 | using BaseObjectType = GstAudioBaseSrc; |
| 119 | using BaseClassType = GstAudioBaseSrcClass; |
| 120 | |
| 121 | // noncopyable |
| 122 | AudioBaseSrc(const AudioBaseSrc&) = delete; |
| 123 | AudioBaseSrc& operator=(const AudioBaseSrc&) = delete; |
| 124 | |
| 125 | private: friend class AudioBaseSrc_Class; |
| 126 | static CppClassType audiobasesrc_class_; |
| 127 | |
| 128 | protected: |
| 129 | explicit AudioBaseSrc(const Glib::ConstructParams& construct_params); |
| 130 | explicit AudioBaseSrc(GstAudioBaseSrc* castitem); |
| 131 | |
| 132 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 133 | |
| 134 | public: |
| 135 | |
| 136 | AudioBaseSrc(AudioBaseSrc&& src) noexcept; |
| 137 | AudioBaseSrc& operator=(AudioBaseSrc&& src) noexcept; |
| 138 | |
| 139 | ~AudioBaseSrc() noexcept override; |
| 140 | |
| 141 | /** Get the GType for this class, for use with the underlying GObject type system. |
| 142 | */ |
| 143 | static GType get_type() G_GNUC_CONST; |
| 144 | |
| 145 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 146 | |
| 147 | |
| 148 | static GType get_base_type() G_GNUC_CONST; |
| 149 | #endif |
| 150 | |
| 151 | ///Provides access to the underlying C GObject. |
| 152 | GstAudioBaseSrc* gobj() { return reinterpret_cast<GstAudioBaseSrc*>(gobject_); } |
| 153 | |
| 154 | ///Provides access to the underlying C GObject. |
| 155 | const GstAudioBaseSrc* gobj() const { return reinterpret_cast<GstAudioBaseSrc*>(gobject_); } |
| 156 | |
| 157 | ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. |
| 158 | GstAudioBaseSrc* gobj_copy(); |
| 159 | |
| 160 | private: |
| 161 | |
| 162 | |
| 163 | public: |
| 164 | /** Get the Gst::Clock of the Gst::AudioSrc. |
| 165 | */ |
| 166 | Glib::RefPtr<Gst::Clock> get_clock(); |
| 167 | Glib::RefPtr<const Gst::Clock> get_clock() const; |
| 168 | |
| 169 | |
| 170 | /** Create and return the Gst::AudioRingBuffer for @a src. This function will call |
| 171 | * the ::create_ringbuffer vmethod and will set @a src as the parent of the |
| 172 | * returned buffer (see Gst::Object::set_parent()). |
| 173 | * |
| 174 | * @return The new ringbuffer of @a src. |
| 175 | */ |
| 176 | Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(); |
| 177 | |
| 178 | |
| 179 | /** Controls whether @a src will provide a clock or not. If @a provide is <tt>true</tt>, |
| 180 | * Gst::Element::provide_clock() will return a clock that reflects the datarate |
| 181 | * of @a src. If @a provide is <tt>false</tt>, Gst::Element::provide_clock() will return <tt>nullptr</tt>. |
| 182 | * |
| 183 | * @param provide New state. |
| 184 | */ |
| 185 | void set_provide_clock(bool provide); |
| 186 | |
| 187 | /** Queries whether @a src will provide a clock or not. See also |
| 188 | * gst_audio_base_src_set_provide_clock. |
| 189 | * |
| 190 | * @return <tt>true</tt> if @a src will provide a clock. |
| 191 | */ |
| 192 | bool get_provide_clock() const; |
| 193 | |
| 194 | /** Controls how clock slaving will be performed in @a src. |
| 195 | * |
| 196 | * @param method The new slave method. |
| 197 | */ |
| 198 | void set_slave_method(Gst::AudioBaseSrcSlaveMethod method); |
| 199 | |
| 200 | /** Get the current slave method used by @a src. |
| 201 | * |
| 202 | * @return The current slave method used by @a src. |
| 203 | */ |
| 204 | Gst::AudioBaseSrcSlaveMethod get_slave_method() const; |
| 205 | |
| 206 | /** Actual configured size of audio buffer in microseconds. |
| 207 | * |
| 208 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 209 | * or receive notification when the value of the property changes. |
| 210 | */ |
| 211 | Glib::PropertyProxy_ReadOnly< gint64 > property_actual_buffer_time() const; |
| 212 | |
| 213 | |
| 214 | /** Actual configured audio latency in microseconds. |
| 215 | * |
| 216 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 217 | * or receive notification when the value of the property changes. |
| 218 | */ |
| 219 | Glib::PropertyProxy_ReadOnly< gint64 > property_actual_latency_time() const; |
| 220 | |
| 221 | |
| 222 | /** Size of audio buffer in microseconds. This is the maximum amount of data that is buffered in the device and the maximum latency that the source reports. This value might be ignored by the element if necessary; see 'actual-buffer-time'. |
| 223 | * |
| 224 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 225 | * or receive notification when the value of the property changes. |
| 226 | */ |
| 227 | Glib::PropertyProxy< gint64 > property_buffer_time() ; |
| 228 | |
| 229 | /** Size of audio buffer in microseconds. This is the maximum amount of data that is buffered in the device and the maximum latency that the source reports. This value might be ignored by the element if necessary; see 'actual-buffer-time'. |
| 230 | * |
| 231 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 232 | * or receive notification when the value of the property changes. |
| 233 | */ |
| 234 | Glib::PropertyProxy_ReadOnly< gint64 > property_buffer_time() const; |
| 235 | |
| 236 | /** The minimum amount of data to read in each iteration in microseconds. This is the minimum latency that the source reports. This value might be ignored by the element if necessary; see 'actual-latency-time'. |
| 237 | * |
| 238 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 239 | * or receive notification when the value of the property changes. |
| 240 | */ |
| 241 | Glib::PropertyProxy< gint64 > property_latency_time() ; |
| 242 | |
| 243 | /** The minimum amount of data to read in each iteration in microseconds. This is the minimum latency that the source reports. This value might be ignored by the element if necessary; see 'actual-latency-time'. |
| 244 | * |
| 245 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 246 | * or receive notification when the value of the property changes. |
| 247 | */ |
| 248 | Glib::PropertyProxy_ReadOnly< gint64 > property_latency_time() const; |
| 249 | |
| 250 | /** Provide a clock to be used as the global pipeline clock. |
| 251 | * |
| 252 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 253 | * or receive notification when the value of the property changes. |
| 254 | */ |
| 255 | Glib::PropertyProxy< bool > property_provide_clock() ; |
| 256 | |
| 257 | /** Provide a clock to be used as the global pipeline clock. |
| 258 | * |
| 259 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 260 | * or receive notification when the value of the property changes. |
| 261 | */ |
| 262 | Glib::PropertyProxy_ReadOnly< bool > property_provide_clock() const; |
| 263 | |
| 264 | |
| 265 | /** Algorithm used to match the rate of the masterclock. |
| 266 | * |
| 267 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 268 | * or receive notification when the value of the property changes. |
| 269 | */ |
| 270 | Glib::PropertyProxy< AudioBaseSrcSlaveMethod > property_slave_method() ; |
| 271 | |
| 272 | /** Algorithm used to match the rate of the masterclock. |
| 273 | * |
| 274 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 275 | * or receive notification when the value of the property changes. |
| 276 | */ |
| 277 | Glib::PropertyProxy_ReadOnly< AudioBaseSrcSlaveMethod > property_slave_method() const; |
| 278 | |
| 279 | |
| 280 | /** vfunc to create and return a Gst::AudioRingBuffer to read from. |
| 281 | */ |
| 282 | virtual Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer_vfunc(); |
| 283 | |
| 284 | |
| 285 | public: |
| 286 | |
| 287 | public: |
| 288 | //C++ methods used to invoke GTK+ virtual functions: |
| 289 | |
| 290 | protected: |
| 291 | //GTK+ Virtual Functions (override these to change behaviour): |
| 292 | |
| 293 | //Default Signal Handlers:: |
| 294 | |
| 295 | |
| 296 | }; |
| 297 | |
| 298 | } // namespace Gst |
| 299 | |
| 300 | |
| 301 | namespace Glib |
| 302 | { |
| 303 | /** A Glib::wrap() method for this object. |
| 304 | * |
| 305 | * @param object The C instance. |
| 306 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 307 | * @result A C++ instance that wraps this C instance. |
| 308 | * |
| 309 | * @relates Gst::AudioBaseSrc |
| 310 | */ |
| 311 | Glib::RefPtr<Gst::AudioBaseSrc> wrap(GstAudioBaseSrc* object, bool take_copy = false); |
| 312 | } |
| 313 | |
| 314 | |
| 315 | #endif /* _GSTREAMERMM_AUDIOBASESRC_H */ |
| 316 |