Debian Codegraph @

gstreamer/gstreamermm/basesink.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!cxx . . $ `<file>/gstreamer/gstreamermm/basesink.h`/
2 #ifndef _GSTREAMERMM_BASESINK_H
3 #define _GSTREAMERMM_BASESINK_Hcxx . . $ `gstreamer/gstreamermm/basesink.h:3:9`!
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/base/gstbasesink.h>
29 #include <gstreamermm/element.h>cxx . . $ `<file>/gstreamer/gstreamermm/element.h`/
30 #include <gstreamermm/buffer.h>cxx . . $ `<file>/gstreamer/gstreamermm/buffer.h`/
31 #include <gstreamermm/pad.h>cxx . . $ `<file>/gstreamer/gstreamermm/pad.h`/
32 #include <gstreamermm/caps.h>cxx . . $ `<file>/gstreamer/gstreamermm/caps.h`/
33 #include <gstreamermm/sample.h>cxx . . $ `<file>/gstreamer/gstreamermm/sample.h`/
34
35
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 using GstBaseSinkcxx . . $ GstBaseSink# = struct _GstBaseSinkcxx . . $ _GstBaseSink#;
38 using GstBaseSinkClasscxx . . $ GstBaseSinkClass# = struct _GstBaseSinkClasscxx . . $ _GstBaseSinkClass#;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40
41
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 namespace Gstcxx . . $ Gst/
44 { class BaseSink_Classcxx . . $ Gst/BaseSink_Class#; } // namespace Gst
45 #endif //DOXYGEN_SHOULD_SKIP_THIS
46
47 namespace Gstcxx . . $ Gst/
48 {
49
50 class BufferListcxx . . $ Gst/BufferList#;
51
52 /** The base class for sink elements.
53 * Gst::BaseSink is the base class for sink elements in GStreamer, such as
54 * xvimagesink or filesink. It is a layer on top of Gst::Element that provides
55 * a simplified interface to plugin writers. Gst::BaseSink handles many details
56 * for you, for example: preroll, clock synchronization, state changes,
57 * activation in push or pull mode, and queries.
58 *
59 * In most cases, when writing sink elements, there is no need to implement
60 * class methods from Gst::Element or to set functions on pads, because the
61 * Gst::BaseSink infrastructure should be sufficient.
62 *
63 * TODO: correct paragraph below for C++ and include example from C API:
64 *
65 * Gst::BaseSink provides support for exactly one sink pad, which should be
66 * named "sink". A sink implementation (subclass of Gst::BaseSink) should
67 * install a pad template in its base_init function, like so:
68 *
69 * Gst::BaseSink will handle the prerolling correctly. This means that it will
70 * return Gst::STATE_CHANGE_ASYNC from a state change to PAUSED until the first
71 * buffer arrives in this element. The base class will call the
72 * Gst::BaseSink::preroll_vfunc() vmethod with this preroll buffer and will
73 * then commit the state change to the next asynchronously pending state.
74 *
75 * When the element is set to PLAYING, Gst::BaseSink will synchronise on the
76 * clock using the times returned from get_times_vfunc(). If this function
77 * returns Gst::CLOCK_TIME_NONE for the start time, no synchronisation will be
78 * done. Synchronisation can be disabled entirely by setting the object "sync"
79 * property to FALSE.
80 *
81 * After synchronisation the virtual method Gst::BaseSink::render_vfunc() will
82 * be called. Subclasses should minimally implement this method.
83 *
84 * Since GStreamer 0.10.3 subclasses that synchronise on the clock in the
85 * render_vfunc() vmethod are supported as well. These classes typically
86 * receive a buffer in the render method and can then potentially block on the
87 * clock while rendering. A typical example is an audiosink. Since GStreamer
88 * 0.10.11 these subclasses can use wait_preroll() to perform the blocking
89 * wait.
90 *
91 * Upon receiving the EOS event in the PLAYING state, Gst::BaseSink will wait
92 * for the clock to reach the time indicated by the stop time of the last
93 * get_times_vfunc() call before posting an EOS message. When the element
94 * receives EOS in PAUSED, preroll completes, the event is queued and an EOS
95 * message is posted when going to PLAYING.
96 *
97 * Gst::BaseSink will internally use the Gst::EVENT_NEWSEGMENT events to
98 * schedule synchronisation and clipping of buffers. Buffers that fall
99 * completely outside of the current segment are dropped. Buffers that fall
100 * partially in the segment are rendered (and prerolled). Subclasses should do
101 * any subbuffer clipping themselves when needed.
102 *
103 * Gst::BaseSink will by default report the current playback position in
104 * Gst::FORMAT_TIME based on the current clock time and segment information. If
105 * no clock has been set on the element, the query will be forwarded upstream.
106 *
107 * The set_caps_vfunc() function will be called when the subclass should
108 * configure itself to process a specific media type.
109 *
110 * The start_vfunc() and stop_vfunc() virtual methods will be called when
111 * resources should be allocated. Any preroll_vfunc(), render_vfunc() and
112 * set_caps_vfunc() function will be called between the start_vfunc() and
113 * stop_vfunc() calls.
114 *
115 * The event_vfunc() virtual method will be called when an event is received by
116 * Gst::BaseSink. Normally this method should only be overriden by very
117 * specific elements (such as file sinks) which need to handle the newsegment
118 * event specially.
119 * The unlock_vfunc() method is called when the elements should unblock any
120 * blocking operations they perform in the render_vfunc() method. This is
121 * mostly useful when the render_vfunc() method performs a blocking write on a
122 * file descriptor, for example.
123 *
124 * The max-lateness property affects how the sink deals with buffers that
125 * arrive too late in the sink. A buffer arrives too late in the sink when the
126 * presentation time (as a combination of the last segment, buffer timestamp
127 * and element base_time) plus the duration is before the current time of the
128 * clock. If the frame is later than max-lateness, the sink will drop the
129 * buffer without calling the render method. This feature is disabled if sync
130 * is disabled, the get_times_vfunc() method does not return a valid start time
131 * or max-lateness is set to -1 (the default). Subclasses can use
132 * set_max_lateness() to configure the max-lateness value.
133 *
134 * The qos property will enable the quality-of-service features of the basesink
135 * which gather statistics about the real-time performance of the clock
136 * synchronisation. For each buffer received in the sink, statistics are
137 * gathered and a QOS event is sent upstream with these numbers. This
138 * information can then be used by upstream elements to reduce their processing
139 * rate, for example.
140 *
141 * The async property can be used to instruct the sink
142 * to never perform an ASYNC state change. This feature is mostly usable when
143 * dealing with non-synchronized streams or sparse streams.
144 *
145 * Last reviewed on 2016-04-29 (1.8.0)
146 *
147 * @ingroup GstBaseClasses
148 */
149
150 class BaseSinkcxx . . $ Gst/BaseSink#
151 : public Elementcxx . . $ Gst/Element#
152 {
153
154 #ifndef DOXYGEN_SHOULD_SKIP_THIS
155
156 public:
157 using CppObjectTypecxx . . $ Gst/BaseSink#CppObjectType# = BaseSinkcxx . . $ Gst/BaseSink#;
158 using CppClassTypecxx . . $ Gst/BaseSink#CppClassType# = BaseSink_Classcxx . . $ Gst/BaseSink_Class#;
159 using BaseObjectTypecxx . . $ Gst/BaseSink#BaseObjectType# = GstBaseSinkcxx . . $ GstBaseSink#;
160 using BaseClassTypecxx . . $ Gst/BaseSink#BaseClassType# = GstBaseSinkClasscxx . . $ GstBaseSinkClass#;
161
162 // noncopyable
163 BaseSinkcxx . . $ Gst/BaseSink#BaseSink(3bee9f761963e3cd).(const BaseSinkcxx . . $ Gst/BaseSink#&) = delete;
164 BaseSinkcxx . . $ Gst/BaseSink#& operatorcxx . . $ Gst/BaseSink#`operator=`(5122b96252fe388c).=(const BaseSinkcxx . . $ Gst/BaseSink#&) = delete;
165
166 private: friend class BaseSink_Classcxx . . $ Gst/BaseSink_Class#;
167 static CppClassTypecxx . . $ Gst/BaseSink#CppClassType# basesink_class_cxx . . $ Gst/BaseSink#basesink_class_.;
168
169 protected:
170 explicit BaseSinkcxx . . $ Gst/BaseSink#BaseSink(237165b4a42a691a).(const Glibcxx . . $ Glib/::ConstructParamscxx . . $ Glib/ConstructParams#& construct_params);
171 explicit BaseSinkcxx . . $ Gst/BaseSink#BaseSink(46ff2d7ca503841b).(GstBaseSinkcxx . . $ GstBaseSink#* castitem);
172
173 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
174
175 public:
176
177 BaseSinkcxx . . $ Gst/BaseSink#BaseSink(25483a99279c67b9).(BaseSinkcxx . . $ Gst/BaseSink#&& src) noexcept;
178 BaseSinkcxx . . $ Gst/BaseSink#& operatorcxx . . $ Gst/BaseSink#`operator=`(1937e6221bb2ab3c).=(BaseSinkcxx . . $ Gst/BaseSink#&& src) noexcept;
179
180 ~cxx . . $ Gst/BaseSink#`~BaseSink`(ced63f7c635d850d).BaseSinkcxx . . $ Gst/BaseSink#() noexcept override;
181
182 /** Get the GType for this class, for use with the underlying GObject type system.
183 */
184 static GType get_typecxx . . $ Gst/BaseSink#get_type(f708dce9a8856c70).() G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!;
185
186 #ifndef DOXYGEN_SHOULD_SKIP_THIS
187
188
189 static GType get_base_typecxx . . $ Gst/BaseSink#get_base_type(f708dce9a8856c70).() G_GNUC_CONSTcxx . . $ `gstreamer/gstreamermm/wrap_init.cc:9:9`!;
190 #endif
191
192 ///Provides access to the underlying C GObject.
193 GstBaseSinkcxx . . $ GstBaseSink#* gobjcxx . . $ Gst/BaseSink#gobj(9d3c92729ce34eae).() { return reinterpret_cast<GstBaseSinkcxx . . $ GstBaseSink#*>(gobject_cxx . . $ Glib/ObjectBase#gobject_.); }
194
195 ///Provides access to the underlying C GObject.
196 const GstBaseSinkcxx . . $ GstBaseSink#* gobjcxx . . $ Gst/BaseSink#gobj(80a238b5dc0dfcad).() const { return reinterpret_cast<GstBaseSinkcxx . . $ GstBaseSink#*>(gobject_cxx . . $ Glib/ObjectBase#gobject_.); }
197
198 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
199 GstBaseSinkcxx . . $ GstBaseSink#* gobj_copycxx . . $ Gst/BaseSink#gobj_copy(9d3c92729ce34eae).();
200
201 private:
202
203
204 public:
205
206 /** Query the sink for the latency parameters. The latency will be queried from
207 * the upstream elements. @a live will be <tt>true</tt> if @a sink is configured to
208 * synchronize against the clock. @a upstream_live will be <tt>true</tt> if an upstream
209 * element is live.
210 *
211 * If both @a live and @a upstream_live are <tt>true</tt>, the sink will want to compensate
212 * for the latency introduced by the upstream elements by setting the
213 * @a min_latency to a strictly positive value.
214 *
215 * This function is mostly used by subclasses.
216 *
217 * @param live If the sink is live.
218 * @param upstream_live If an upstream element is live.
219 * @param min_latency The min latency of the upstream elements.
220 * @param max_latency The max latency of the upstream elements.
221 * @return <tt>true</tt> if the query succeeded.
222 */
223 bool query_latencycxx . . $ Gst/BaseSink#query_latency(77e856bc497700c8).(bool& live, bool& upstream_live, Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime#& min_latency, Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime#& max_latency) const;
224
225 /** Get the currently configured latency.
226 *
227 * @return The configured latency.
228 */
229 Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# get_latencycxx . . $ Gst/BaseSink#get_latency(fe4d2d262d4164a8).() const;
230
231 /** If the @a sink spawns its own thread for pulling buffers from upstream it
232 * should call this method after it has pulled a buffer. If the element needed
233 * to preroll, this function will perform the preroll and will then block
234 * until the element state is changed.
235 *
236 * This function should be called with the PREROLL_LOCK held.
237 *
238 * @param obj The mini object that caused the preroll.
239 * @return Gst::FLOW_OK if the preroll completed and processing can
240 * continue. Any other return value should be returned from the render vmethod.
241 */
242 Gstcxx . . $ Gst/::FlowReturncxx . . $ Gst/FlowReturn# do_prerollcxx . . $ Gst/BaseSink#do_preroll(26facef4ec8e0f45).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::MiniObjectcxx . . $ Gst/MiniObject#>& obj);
243
244 /** If the Gst::BaseSinkClass.render() method performs its own synchronisation
245 * against the clock it must unblock when going from PLAYING to the PAUSED state
246 * and call this method before continuing to render the remaining data.
247 *
248 * This function will block until a state change to PLAYING happens (in which
249 * case this function returns Gst::FLOW_OK) or the processing must be stopped due
250 * to a state change to READY or a FLUSH event (in which case this function
251 * returns Gst::FLOW_FLUSHING).
252 *
253 * This function should only be called with the PREROLL_LOCK held, like in the
254 * render function.
255 *
256 * @return Gst::FLOW_OK if the preroll completed and processing can
257 * continue. Any other return value should be returned from the render vmethod.
258 */
259 Gstcxx . . $ Gst/::FlowReturncxx . . $ Gst/FlowReturn# wait_prerollcxx . . $ Gst/BaseSink#wait_preroll(3a0c81c66b380fca).();
260
261 /** This function will block until @a time is reached. It is usually called by
262 * subclasses that use their own internal synchronisation.
263 *
264 * If @a time is not valid, no synchronisation is done and Gst::CLOCK_BADTIME is
265 * returned. Likewise, if synchronisation is disabled in the element or there
266 * is no clock, no synchronisation is done and Gst::CLOCK_BADTIME is returned.
267 *
268 * This function should only be called with the PREROLL_LOCK held, like when
269 * receiving an EOS event in the Gst::BaseSinkClass.event() vmethod or when
270 * receiving a buffer in
271 * the Gst::BaseSinkClass.render() vmethod.
272 *
273 * The @a time argument should be the running_time of when this method should
274 * return and is not adjusted with any latency or offset configured in the
275 * sink.
276 *
277 * @param time The running_time to be reached.
278 * @param jitter The jitter to be filled with time diff, or <tt>nullptr</tt>.
279 * @return Gst::ClockReturn.
280 */
281 Gstcxx . . $ Gst/::ClockReturncxx . . $ Gst/ClockReturn# wait_clockcxx . . $ Gst/BaseSink#wait_clock(22a9cf5eed0b5ccf).(Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# time, Gstcxx . . $ Gst/::ClockTimeDiffcxx . . $ Gst/ClockTimeDiff#& jitter);
282
283 /// A wait_clock() convenience overload.
284 Gstcxx . . $ Gst/::ClockReturncxx . . $ Gst/ClockReturn# wait_clockcxx . . $ Gst/BaseSink#wait_clock(94284dc49be76417).(Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# time);
285
286 /** This function will wait for preroll to complete and will then block until @a time
287 * is reached. It is usually called by subclasses that use their own internal
288 * synchronisation but want to let some synchronization (like EOS) be handled
289 * by the base class.
290 *
291 * This function should only be called with the PREROLL_LOCK held (like when
292 * receiving an EOS event in the signal_event() vmethod or when handling buffers in
293 * signal_render()).
294 *
295 * The @a time argument should be the running_time of when the timeout should happen
296 * and will be adjusted with any latency and offset configured in the sink.
297 *
298 * @param time The running_time to be reached.
299 * @param jitter The jitter to be filled with time diff, or <tt>nullptr</tt>.
300 * @return Gst::FlowReturn.
301 */
302 Gstcxx . . $ Gst/::FlowReturncxx . . $ Gst/FlowReturn# waitcxx . . $ Gst/BaseSink#wait(5259dfb8b23b931a).(Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# time, Gstcxx . . $ Gst/::ClockTimeDiffcxx . . $ Gst/ClockTimeDiff#& jitter);
303
304 /// A wait() convenience overload.
305 Gstcxx . . $ Gst/::FlowReturncxx . . $ Gst/FlowReturn# waitcxx . . $ Gst/BaseSink#wait(13a03661c49e98e0).(Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# time);
306
307
308 /** Configures @a sink to synchronize on the clock or not. When
309 * @a sync is <tt>false</tt>, incoming samples will be played as fast as
310 * possible. If @a sync is <tt>true</tt>, the timestamps of the incoming
311 * buffers will be used to schedule the exact render time of its
312 * contents.
313 *
314 * @param sync The new sync value.
315 */
316 void set_synccxx . . $ Gst/BaseSink#set_sync(b45ddcbc8423892c).(bool sync);
317
318 /** Checks if @a sink is currently configured to synchronize against the
319 * clock.
320 *
321 * @return <tt>true</tt> if the sink is configured to synchronize against the clock.
322 */
323 bool get_synccxx . . $ Gst/BaseSink#get_sync(50ce9a9e25b4a850).() const;
324
325
326 /** Sets the new max lateness value to @a max_lateness. This value is
327 * used to decide if a buffer should be dropped or not based on the
328 * buffer timestamp and the current clock time. A value of -1 means
329 * an unlimited time.
330 *
331 * @param max_lateness The new max lateness value.
332 */
333 void set_max_latenesscxx . . $ Gst/BaseSink#set_max_lateness(1624ee8275b10bda).(gint64 max_lateness);
334
335 /** Gets the max lateness value. See gst_base_sink_set_max_lateness for
336 * more details.
337 *
338 * @return The maximum time in nanoseconds that a buffer can be late
339 * before it is dropped and not rendered. A value of -1 means an
340 * unlimited time.
341 */
342 gint64 get_max_latenesscxx . . $ Gst/BaseSink#get_max_lateness(57a65ae535d7db84).() const;
343
344
345 /** Configures @a sink to send Quality-of-Service events upstream.
346 *
347 * @param enabled The new qos value.
348 */
349 void set_qos_enabledcxx . . $ Gst/BaseSink#set_qos_enabled(b45ddcbc8423892c).(bool enabled);
350
351 /** Checks if @a sink is currently configured to send Quality-of-Service events
352 * upstream.
353 *
354 * @return <tt>true</tt> if the sink is configured to perform Quality-of-Service.
355 */
356 bool is_qos_enabledcxx . . $ Gst/BaseSink#is_qos_enabled(50ce9a9e25b4a850).() const;
357
358
359 /** Configures @a sink to perform all state changes asynchronously. When async is
360 * disabled, the sink will immediately go to PAUSED instead of waiting for a
361 * preroll buffer. This feature is useful if the sink does not synchronize
362 * against the clock or when it is dealing with sparse streams.
363 *
364 * @param enabled The new async value.
365 */
366 void set_async_enabledcxx . . $ Gst/BaseSink#set_async_enabled(b45ddcbc8423892c).(bool enabled);
367
368 /** Checks if @a sink is currently configured to perform asynchronous state
369 * changes to PAUSED.
370 *
371 * @return <tt>true</tt> if the sink is configured to perform asynchronous state
372 * changes.
373 */
374 bool is_async_enabledcxx . . $ Gst/BaseSink#is_async_enabled(50ce9a9e25b4a850).() const;
375
376
377 /** Adjust the synchronisation of @a sink with @a offset. A negative value will
378 * render buffers earlier than their timestamp. A positive value will delay
379 * rendering. This function can be used to fix playback of badly timestamped
380 * buffers.
381 *
382 * @param offset The new offset.
383 */
384 void set_ts_offsetcxx . . $ Gst/BaseSink#set_ts_offset(1624ee8275b10bda).(Gstcxx . . $ Gst/::ClockTimeDiffcxx . . $ Gst/ClockTimeDiff# offset);
385
386 /** Get the synchronisation offset of @a sink.
387 *
388 * @return The synchronisation offset.
389 */
390 Gstcxx . . $ Gst/::ClockTimeDiffcxx . . $ Gst/ClockTimeDiff# get_ts_offsetcxx . . $ Gst/BaseSink#get_ts_offset(57a65ae535d7db84).() const;
391
392
393 /** Set the render delay in @a sink to @a delay. The render delay is the time
394 * between actual rendering of a buffer and its synchronisation time. Some
395 * devices might delay media rendering which can be compensated for with this
396 * function.
397 *
398 * After calling this function, this sink will report additional latency and
399 * other sinks will adjust their latency to delay the rendering of their media.
400 *
401 * This function is usually called by subclasses.
402 *
403 * @param delay The new delay.
404 */
405 void set_render_delaycxx . . $ Gst/BaseSink#set_render_delay(2c44cd906ae4e829).(Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# delay);
406
407 /** Get the render delay of @a sink. see set_render_delay() for more
408 * information about the render delay.
409 *
410 * @return The render delay of @a sink.
411 */
412 Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime# get_render_delaycxx . . $ Gst/BaseSink#get_render_delay(fe4d2d262d4164a8).() const;
413
414
415 /** Set the number of bytes that the sink will pull when it is operating in pull
416 * mode.
417 *
418 * @param blocksize The blocksize in bytes.
419 */
420 void set_blocksizecxx . . $ Gst/BaseSink#set_blocksize(cb2f890c2fdad230).(guint blocksize);
421
422 /** Get the number of bytes that the sink will pull when it is operating in pull
423 * mode.
424 *
425 * @return The number of bytes @a sink will pull in pull mode.
426 */
427 guint get_blocksizecxx . . $ Gst/BaseSink#get_blocksize(ddd8539a2fcdd4ce).() const;
428
429
430 /** Get the time that will be inserted between frames to control the
431 * maximum buffers per second.
432 *
433 * @return The number of nanoseconds @a sink will put between frames.
434 */
435 guint64 get_throttle_timecxx . . $ Gst/BaseSink#get_throttle_time(fe4d2d262d4164a8).() const;
436
437 /** Set the time that will be inserted between rendered buffers. This
438 * can be used to control the maximum buffers per second that the sink
439 * will render.
440 *
441 * @param throttle The throttle time in nanoseconds.
442 */
443 void set_throttle_timecxx . . $ Gst/BaseSink#set_throttle_time(2c44cd906ae4e829).(guint64 throttle);
444
445
446 /** Get the last sample that arrived in the sink and was used for preroll or for
447 * rendering. This property can be used to generate thumbnails.
448 *
449 * The Gst::Caps on the sample can be used to determine the type of the buffer.
450 *
451 * Free-function: gst_sample_unref
452 *
453 * @return A Gst::Sample. gst_sample_unref() after
454 * usage. This function returns <tt>nullptr</tt> when no buffer has arrived in the
455 * sink yet or when the sink is not in PAUSED or PLAYING.
456 */
457 Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Samplecxx . . $ Gst/Sample#> get_last_samplecxx . . $ Gst/BaseSink#get_last_sample(aa585b6a0e4e4e3a).() const;
458
459
460 /** Set the maximum amount of bits per second that the sink will render.
461 *
462 * @param max_bitrate The max_bitrate in bits per second.
463 */
464 void set_max_bitratecxx . . $ Gst/BaseSink#set_max_bitrate(2c44cd906ae4e829).(guint64 max_bitrate);
465
466 /** Get the maximum amount of bits per second that the sink will render.
467 *
468 * @return The maximum number of bits per second @a sink will render.
469 */
470 guint64 get_max_bitratecxx . . $ Gst/BaseSink#get_max_bitrate(fe4d2d262d4164a8).() const;
471
472
473 /** Configures @a sink to store the last received sample in the last-sample
474 * property.
475 *
476 * @param enabled The new enable-last-sample value.
477 */
478 void set_last_sample_enabledcxx . . $ Gst/BaseSink#set_last_sample_enabled(b45ddcbc8423892c).(bool enabled);
479
480 /** Checks if @a sink is currently configured to store the last received sample in
481 * the last-sample property.
482 *
483 * @return <tt>true</tt> if the sink is configured to store the last received sample.
484 */
485 bool is_last_sample_enabledcxx . . $ Gst/BaseSink#is_last_sample_enabled(50ce9a9e25b4a850).() const;
486
487 /** Gets the sink Gst::Pad object of the element.
488 */
489 Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Padcxx . . $ Gst/Pad#> get_sink_padcxx . . $ Gst/BaseSink#get_sink_pad(933c6ba9162839d3).();
490 Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<const Gstcxx . . $ Gst/::Padcxx . . $ Gst/Pad#> get_sink_padcxx . . $ Gst/BaseSink#get_sink_pad(dca65d54e9e25cdd).() const;
491
492 // TODO: wrap preroll?
493
494 /** Go asynchronously to PAUSED.
495 *
496 * @return A PropertyProxy that allows you to get or set the value of the property,
497 * or receive notification when the value of the property changes.
498 */
499 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< bool > property_asynccxx . . $ Gst/BaseSink#property_async(962e4b383dc974dc).() ;
500
501 /** Go asynchronously to PAUSED.
502 *
503 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
504 * or receive notification when the value of the property changes.
505 */
506 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< bool > property_asynccxx . . $ Gst/BaseSink#property_async(bb701360c56d84c7).() const;
507
508 /** Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).
509 *
510 * @return A PropertyProxy that allows you to get or set the value of the property,
511 * or receive notification when the value of the property changes.
512 */
513 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< gint64 > property_max_latenesscxx . . $ Gst/BaseSink#property_max_lateness(6b69460574dd6a75).() ;
514
515 /** Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).
516 *
517 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
518 * or receive notification when the value of the property changes.
519 */
520 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< gint64 > property_max_latenesscxx . . $ Gst/BaseSink#property_max_lateness(593ac6380b69f4e9).() const;
521
522 /** Generate Quality-of-Service events upstream.
523 *
524 * @return A PropertyProxy that allows you to get or set the value of the property,
525 * or receive notification when the value of the property changes.
526 */
527 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< bool > property_qoscxx . . $ Gst/BaseSink#property_qos(962e4b383dc974dc).() ;
528
529 /** Generate Quality-of-Service events upstream.
530 *
531 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
532 * or receive notification when the value of the property changes.
533 */
534 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< bool > property_qoscxx . . $ Gst/BaseSink#property_qos(bb701360c56d84c7).() const;
535
536 /** Sync on the clock.
537 *
538 * @return A PropertyProxy that allows you to get or set the value of the property,
539 * or receive notification when the value of the property changes.
540 */
541 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< bool > property_synccxx . . $ Gst/BaseSink#property_sync(962e4b383dc974dc).() ;
542
543 /** Sync on the clock.
544 *
545 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
546 * or receive notification when the value of the property changes.
547 */
548 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< bool > property_synccxx . . $ Gst/BaseSink#property_sync(bb701360c56d84c7).() const;
549
550 /** Timestamp offset in nanoseconds.
551 *
552 * @return A PropertyProxy that allows you to get or set the value of the property,
553 * or receive notification when the value of the property changes.
554 */
555 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< gint64 > property_ts_offsetcxx . . $ Gst/BaseSink#property_ts_offset(6b69460574dd6a75).() ;
556
557 /** Timestamp offset in nanoseconds.
558 *
559 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
560 * or receive notification when the value of the property changes.
561 */
562 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< gint64 > property_ts_offsetcxx . . $ Gst/BaseSink#property_ts_offset(593ac6380b69f4e9).() const;
563
564 /** Additional render delay of the sink in nanoseconds.
565 *
566 * @return A PropertyProxy that allows you to get or set the value of the property,
567 * or receive notification when the value of the property changes.
568 */
569 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< guint64 > property_render_delaycxx . . $ Gst/BaseSink#property_render_delay(d486e8c449033ce8).() ;
570
571 /** Additional render delay of the sink in nanoseconds.
572 *
573 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
574 * or receive notification when the value of the property changes.
575 */
576 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< guint64 > property_render_delaycxx . . $ Gst/BaseSink#property_render_delay(626cd103ac35282).() const;
577
578 /** The time to keep between rendered buffers (0 = disabled).
579 *
580 * @return A PropertyProxy that allows you to get or set the value of the property,
581 * or receive notification when the value of the property changes.
582 */
583 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< guint64 > property_throttle_timecxx . . $ Gst/BaseSink#property_throttle_time(d486e8c449033ce8).() ;
584
585 /** The time to keep between rendered buffers (0 = disabled).
586 *
587 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
588 * or receive notification when the value of the property changes.
589 */
590 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< guint64 > property_throttle_timecxx . . $ Gst/BaseSink#property_throttle_time(626cd103ac35282).() const;
591
592 /** Size in bytes to pull per buffer (0 = default).
593 *
594 * @return A PropertyProxy that allows you to get or set the value of the property,
595 * or receive notification when the value of the property changes.
596 */
597 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< guint > property_blocksizecxx . . $ Gst/BaseSink#property_blocksize(c06a410a81733cde).() ;
598
599 /** Size in bytes to pull per buffer (0 = default).
600 *
601 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
602 * or receive notification when the value of the property changes.
603 */
604 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< guint > property_blocksizecxx . . $ Gst/BaseSink#property_blocksize(9b12e6784ac5b9b).() const;
605
606 /** The last sample received in the sink.
607 *
608 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
609 * or receive notification when the value of the property changes.
610 */
611 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Samplecxx . . $ Gst/Sample#> > property_last_samplecxx . . $ Gst/BaseSink#property_last_sample(eaa5f2383002968d).() const;
612
613
614 /** Enable the last-sample property.
615 *
616 * @return A PropertyProxy that allows you to get or set the value of the property,
617 * or receive notification when the value of the property changes.
618 */
619 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< bool > property_enable_last_samplecxx . . $ Gst/BaseSink#property_enable_last_sample(962e4b383dc974dc).() ;
620
621 /** Enable the last-sample property.
622 *
623 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
624 * or receive notification when the value of the property changes.
625 */
626 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< bool > property_enable_last_samplecxx . . $ Gst/BaseSink#property_enable_last_sample(bb701360c56d84c7).() const;
627
628 /** The maximum bits per second to render (0 = disabled).
629 *
630 * @return A PropertyProxy that allows you to get or set the value of the property,
631 * or receive notification when the value of the property changes.
632 */
633 Glibcxx . . $ Glib/::PropertyProxycxx . . $ Glib/PropertyProxy#< guint64 > property_max_bitratecxx . . $ Gst/BaseSink#property_max_bitrate(d486e8c449033ce8).() ;
634
635 /** The maximum bits per second to render (0 = disabled).
636 *
637 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
638 * or receive notification when the value of the property changes.
639 */
640 Glibcxx . . $ Glib/::PropertyProxy_ReadOnlycxx . . $ Glib/PropertyProxy_ReadOnly#< guint64 > property_max_bitratecxx . . $ Gst/BaseSink#property_max_bitrate(626cd103ac35282).() const;
641
642
643 /** Called to get sink pad caps from the subclass.
644 */
645 virtual Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Capscxx . . $ Gst/Caps#> get_caps_vfunccxx . . $ Gst/BaseSink#get_caps_vfunc(74dce9e80895d45c).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Capscxx . . $ Gst/Caps#>& caps) const;
646
647
648 /** Notify subclass of changed caps.
649 */
650 virtual bool set_caps_vfunccxx . . $ Gst/BaseSink#set_caps_vfunc(d71e2c92ee80648b).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Capscxx . . $ Gst/Caps#>& caps);
651
652
653 /** Called to get the start and end times for synchronising the passed buffer
654 * to the clock.
655 */
656 virtual void get_times_vfunccxx . . $ Gst/BaseSink#get_times_vfunc(c439da376c492fdc).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>& buffer, Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime#& start, Gstcxx . . $ Gst/::ClockTimecxx . . $ Gst/ClockTime#& end) const;
657
658
659 /** Start processing. Ideal for opening resources in the subclass.
660 */
661 virtual bool start_vfunccxx . . $ Gst/BaseSink#start_vfunc(c9857a73d68e59ba).();
662
663
664 /** Stop processing. Subclasses should use this to close resources.
665 */
666 virtual bool stop_vfunccxx . . $ Gst/BaseSink#stop_vfunc(c9857a73d68e59ba).();
667
668
669 /** Unlock any pending access to the resource. Subclasses should unblock any
670 * blocked function ASAP.
671 */
672 virtual bool unlock_vfunccxx . . $ Gst/BaseSink#unlock_vfunc(c9857a73d68e59ba).();
673
674
675 /** Override this to handle events arriving on the sink pad.
676 */
677 virtual bool event_vfunccxx . . $ Gst/BaseSink#event_vfunc(2055ffde69ae5030).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Eventcxx . . $ Gst/Event#>& event);
678
679
680 /** Override this to implement custom logic to wait for the event time (for events
681 * like EOS and GAP). Subclasses should always first chain up to the default
682 * implementation.
683 */
684 virtual FlowReturncxx . . $ Gst/FlowReturn# wait_event_vfunccxx . . $ Gst/BaseSink#wait_event_vfunc(107621086e23a603).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Eventcxx . . $ Gst/Event#>& event);
685
686
687 /** Called to present the preroll buffer if desired.
688 */
689 virtual FlowReturncxx . . $ Gst/FlowReturn# preroll_vfunccxx . . $ Gst/BaseSink#preroll_vfunc(a9092e90601b697e).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>& buffer);
690
691
692 /** Called when a buffer should be presented or output, at the correct moment
693 * if the Gst::BaseSink has been set to sync to the clock.
694 */
695 virtual FlowReturncxx . . $ Gst/FlowReturn# render_vfunccxx . . $ Gst/BaseSink#render_vfunc(a9092e90601b697e).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>& buffer);
696
697
698 /** Subclasses should override this when they need to perform special
699 * processing when changing to the PLAYING state asynchronously. Called with
700 * the OBJECT_LOCK held.
701 */
702
703 /** Subclasses should override this when they can provide an alternate method
704 * of spawning a thread to drive the pipeline in pull mode. Should start or
705 * stop the pulling thread, depending on the value of the "active" argument.
706 * Called after actually activating the sink pad in pull mode. The default
707 * implementation starts a task on the sink pad.
708 */
709 virtual bool activate_pull_vfunccxx . . $ Gst/BaseSink#activate_pull_vfunc(efaadfb7dc14930a).(bool active);
710
711
712 /** Only useful in pull mode, this vmethod will be called in response to
713 * Gst::Pad::fixate_caps() being called on the sink pad. Implement if you
714 * have ideas about what should be the default values for the caps you
715 * support.
716 */
717 virtual Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Capscxx . . $ Gst/Caps#> fixate_vfunccxx . . $ Gst/BaseSink#fixate_vfunc(cac43ebfde7bbd09).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Capscxx . . $ Gst/Caps#>& caps);
718
719
720 /** Clear the previous unlock request. Subclasses should clear any state they
721 * set during unlock_vfunc(), such as clearing command queues.
722 */
723 virtual bool unlock_stop_vfunccxx . . $ Gst/BaseSink#unlock_stop_vfunc(c9857a73d68e59ba).();
724
725
726 /// Render a BufferList.
727 /** Same as render but used with buffer lists instead of buffers.
728 */
729 virtual FlowReturncxx . . $ Gst/FlowReturn# render_list_vfunccxx . . $ Gst/BaseSink#render_list_vfunc(f337cede21512d4).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#>& buffer_list);
730
731
732 /** Called to prepare the buffer for render and preroll.
733 * This function is called before synchronisation is performed.
734 */
735 virtual FlowReturncxx . . $ Gst/FlowReturn# prepare_vfunccxx . . $ Gst/BaseSink#prepare_vfunc(a9092e90601b697e).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Buffercxx . . $ Gst/Buffer#>& buffer);
736
737
738 /** Called to prepare the buffer list for render_list.
739 * This function is called before synchronisation is performed.
740 */
741 virtual FlowReturncxx . . $ Gst/FlowReturn# prepare_list_vfunccxx . . $ Gst/BaseSink#prepare_list_vfunc(f337cede21512d4).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::BufferListcxx . . $ Gst/BufferList#>& buffer_list);
742
743
744 // Cannot use query_vfunc because the name has been used in the Gst::Element class.
745 // We have to provide custom implementation, because query vfunc expects writable
746 // query object.
747 /** Perform a GstQuery on the element.
748 */
749 virtual bool base_sink_query_vfunccxx . . $ Gst/BaseSink#base_sink_query_vfunc(363e9ac1e31c4481).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Querycxx . . $ Gst/Query#>& query);
750
751 /** Configure the allocation query.
752 */
753
754
755 virtual bool propose_allocation_vfunccxx . . $ Gst/BaseSink#propose_allocation_vfunc(363e9ac1e31c4481).(const Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::Querycxx . . $ Gst/Query#>& query);
756
757
758 protected:
759
760
761 public:
762
763 public:
764 //C++ methods used to invoke GTK+ virtual functions:
765
766 protected:
767 //GTK+ Virtual Functions (override these to change behaviour):
768
769 //Default Signal Handlers::
770
771
772 };
773
774 } // namespace Gst
775
776
777 namespace Glibcxx . . $ Glib/
778 {
779 /** A Glib::wrap() method for this object.
780 *
781 * @param object The C instance.
782 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
783 * @result A C++ instance that wraps this C instance.
784 *
785 * @relates Gst::BaseSink
786 */
787 Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<Gstcxx . . $ Gst/::BaseSinkcxx . . $ Gst/BaseSink#> wrapcxx . . $ Glib/wrap(ff0d5f0961277c8c).(GstBaseSinkcxx . . $ GstBaseSink#* object, bool take_copy = false);
788 }
789
790
791 #endif /* _GSTREAMERMM_BASESINK_H */
792