This file is indexed.

/usr/include/gstreamermm-0.10/gstreamermm/basesink.h is in libgstreamermm-0.10-dev 0.10.11-0ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GSTREAMERMM_BASESINK_H
#define _GSTREAMERMM_BASESINK_H


#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>

/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gst/base/gstbasesink.h>
#include <gstreamermm/element.h>
#include <gstreamermm/buffer.h>
#include <gstreamermm/pad.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GstBaseSink GstBaseSink;
typedef struct _GstBaseSinkClass GstBaseSinkClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gst
{ class BaseSink_Class; } // namespace Gst
namespace Gst
{

class BufferList;

/** The base class for sink elements.
 * Gst::BaseSink is the base class for sink elements in GStreamer, such as
 * xvimagesink or filesink. It is a layer on top of Gst::Element that provides
 * a simplified interface to plugin writers. Gst::BaseSink handles many details
 * for you, for example: preroll, clock synchronization, state changes,
 * activation in push or pull mode, and queries.
 *
 * In most cases, when writing sink elements, there is no need to implement
 * class methods from Gst::Element or to set functions on pads, because the
 * Gst::BaseSink infrastructure should be sufficient.
 *
 * TODO: correct paragraph below for C++ and include example from C API:
 *
 * Gst::BaseSink provides support for exactly one sink pad, which should be
 * named "sink". A sink implementation (subclass of Gst::BaseSink) should
 * install a pad template in its base_init function, like so:
 *
 * Gst::BaseSink will handle the prerolling correctly. This means that it will
 * return Gst::STATE_CHANGE_ASYNC from a state change to PAUSED until the first
 * buffer arrives in this element. The base class will call the
 * Gst::BaseSink::preroll_vfunc() vmethod with this preroll buffer and will
 * then commit the state change to the next asynchronously pending state.
 *
 * When the element is set to PLAYING, Gst::BaseSink will synchronise on the
 * clock using the times returned from get_times_vfunc(). If this function
 * returns Gst::CLOCK_TIME_NONE for the start time, no synchronisation will be
 * done.  Synchronisation can be disabled entirely by setting the object "sync"
 * property to FALSE.
 *
 * After synchronisation the virtual method Gst::BaseSink::render_vfunc() will
 * be called. Subclasses should minimally implement this method.
 *
 * Since GStreamer 0.10.3 subclasses that synchronise on the clock in the
 * render_vfunc() vmethod are supported as well. These classes typically
 * receive a buffer in the render method and can then potentially block on the
 * clock while rendering. A typical example is an audiosink. Since GStreamer
 * 0.10.11 these subclasses can use wait_preroll() to perform the blocking
 * wait.
 *
 * Upon receiving the EOS event in the PLAYING state, Gst::BaseSink will wait
 * for the clock to reach the time indicated by the stop time of the last
 * get_times_vfunc() call before posting an EOS message. When the element
 * receives EOS in PAUSED, preroll completes, the event is queued and an EOS
 * message is posted when going to PLAYING.
 *
 * Gst::BaseSink will internally use the Gst::EVENT_NEWSEGMENT events to
 * schedule synchronisation and clipping of buffers. Buffers that fall
 * completely outside of the current segment are dropped. Buffers that fall
 * partially in the segment are rendered (and prerolled). Subclasses should do
 * any subbuffer clipping themselves when needed.
 *
 * Gst::BaseSink will by default report the current playback position in
 * Gst::FORMAT_TIME based on the current clock time and segment information. If
 * no clock has been set on the element, the query will be forwarded upstream.
 *
 * The set_caps_vfunc() function will be called when the subclass should
 * configure itself to process a specific media type.
 *
 * The start_vfunc() and stop_vfunc() virtual methods will be called when
 * resources should be allocated. Any preroll_vfunc(), render_vfunc() and
 * set_caps_vfunc() function will be called between the start_vfunc() and
 * stop_vfunc() calls.
 *
 * The event_vfunc() virtual method will be called when an event is received by
 * Gst::BaseSink. Normally this method should only be overriden by very
 * specific elements (such as file sinks) which need to handle the newsegment
 * event specially.
 *
 * Gst::BaseSink provides an overridable buffer_alloc_vfunc() function that can
 * be used by sinks that want to do reverse negotiation or to provide custom
 * buffers (hardware buffers for example) to upstream elements.
 *
 * The unlock_vfunc() method is called when the elements should unblock any
 * blocking operations they perform in the render_vfunc() method. This is
 * mostly useful when the render_vfunc() method performs a blocking write on a
 * file descriptor, for example.
 *
 * The max-lateness property affects how the sink deals with buffers that
 * arrive too late in the sink. A buffer arrives too late in the sink when the
 * presentation time (as a combination of the last segment, buffer timestamp
 * and element base_time) plus the duration is before the current time of the
 * clock. If the frame is later than max-lateness, the sink will drop the
 * buffer without calling the render method. This feature is disabled if sync
 * is disabled, the get_times_vfunc() method does not return a valid start time
 * or max-lateness is set to -1 (the default). Subclasses can use
 * set_max_lateness() to configure the max-lateness value.
 *
 * The qos property will enable the quality-of-service features of the basesink
 * which gather statistics about the real-time performance of the clock
 * synchronisation. For each buffer received in the sink, statistics are
 * gathered and a QOS event is sent upstream with these numbers. This
 * information can then be used by upstream elements to reduce their processing
 * rate, for example.
 *
 * Since GStreamer 0.10.15 the async property can be used to instruct the sink
 * to never perform an ASYNC state change. This feature is mostly usable when
 * dealing with non-synchronized streams or sparse streams.
 *
 * Last reviewed on 2007-08-29 (0.10.15)
 *
 * @ingroup GstBaseClasses
 */

class BaseSink
: public Element
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef BaseSink CppObjectType;
  typedef BaseSink_Class CppClassType;
  typedef GstBaseSink BaseObjectType;
  typedef GstBaseSinkClass BaseClassType;

private:  friend class BaseSink_Class;
  static CppClassType basesink_class_;

private:
  // noncopyable
  BaseSink(const BaseSink&);
  BaseSink& operator=(const BaseSink&);

protected:
  explicit BaseSink(const Glib::ConstructParams& construct_params);
  explicit BaseSink(GstBaseSink* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~BaseSink();

  /** Get the GType for this class, for use with the underlying GObject type system.
   */
  static GType get_type()      G_GNUC_CONST;

#ifndef DOXYGEN_SHOULD_SKIP_THIS


  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GstBaseSink*       gobj()       { return reinterpret_cast<GstBaseSink*>(gobject_); }

  ///Provides access to the underlying C GObject.
  const GstBaseSink* gobj() const { return reinterpret_cast<GstBaseSink*>(gobject_); }

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GstBaseSink* gobj_copy();

private:


public:
  
  /** Query the sink for the latency parameters. The latency will be queried from
   * the upstream elements. @a live will be <tt>true</tt> if @a sink is configured to
   * synchronize against the clock. @a upstream_live will be <tt>true</tt> if an upstream
   * element is live.
   * 
   * If both @a live and @a upstream_live are <tt>true</tt>, the sink will want to compensate
   * for the latency introduced by the upstream elements by setting the
   *  @a min_latency to a strictly possitive value.
   * 
   * This function is mostly used by subclasses.
   * @param live If the sink is live.
   * @param upstream_live If an upstream element is live.
   * @param min_latency The min latency of the upstream elements.
   * @param max_latency The max latency of the upstream elements.
   * @return <tt>true</tt> if the query succeeded.
   */

  bool query_latency(bool& live, bool& upstream_live, ClockTime& min_latency,
    ClockTime& max_latency) const;
  
  /** Get the currently configured latency.
   * @return The configured latency.
   */
  ClockTime get_latency() const;
  
  /** If the @a sink spawns its own thread for pulling buffers from upstream it
   * should call this method after it has pulled a buffer. If the element needed
   * to preroll, this function will perform the preroll and will then block
   * until the element state is changed.
   * 
   * This function should be called with the PREROLL_LOCK held.
   * @param obj The mini object that caused the preroll.
   * @return Gst::FLOW_OK if the preroll completed and processing can
   * continue. Any other return value should be returned from the render vmethod.
   */
  Gst::FlowReturn do_preroll(const Glib::RefPtr<Gst::MiniObject>& obj);
  
  /** If the Gst::BaseSinkClass.render() method performs its own synchronisation
   * against the clock it must unblock when going from PLAYING to the PAUSED state
   * and call this method before continuing to render the remaining data.
   * 
   * This function will block until a state change to PLAYING happens (in which
   * case this function returns Gst::FLOW_OK) or the processing must be stopped due
   * to a state change to READY or a FLUSH event (in which case this function
   * returns Gst::FLOW_WRONG_STATE).
   * 
   * This function should only be called with the PREROLL_LOCK held, like in the
   * render function.
   * @return Gst::FLOW_OK if the preroll completed and processing can
   * continue. Any other return value should be returned from the render vmethod.
   */
  FlowReturn wait_preroll();
  
  /** This function will block until @a time is reached. It is usually called by
   * subclasses that use their own internal synchronisation.
   * 
   * If @a time is not valid, no sycnhronisation is done and Gst::CLOCK_BADTIME is
   * returned. Likewise, if synchronisation is disabled in the element or there
   * is no clock, no synchronisation is done and Gst::CLOCK_BADTIME is returned.
   * 
   * This function should only be called with the PREROLL_LOCK held, like when
   * receiving an EOS event in the Gst::BaseSinkClass.event() vmethod or when
   * receiving a buffer in
   * the Gst::BaseSinkClass.render() vmethod.
   * 
   * The @a time argument should be the running_time of when this method should
   * return and is not adjusted with any latency or offset configured in the
   * sink.
   * @param time The running_time to be reached.
   * @param jitter The jitter to be filled with time diff, or <tt>0</tt>.
   * @return Gst::ClockReturn.
   */
  ClockReturn wait_clock(ClockTime time, ClockTimeDiff& jitter);

  /** This function will block until time is reached.  It is usually called by
   * subclasses that use their own internal synchronisation.
   *
   * If time is not valid, no sycnhronisation is done and Gst::CLOCK_BADTIME is
   * returned. Likewise, if synchronisation is disabled in the element or there
   * is no clock, no synchronisation is done and Gst::CLOCK_BADTIME is
   * returned.
   *
   * This function should only be called with the PREROLL_LOCK held, like when
   * receiving an EOS event in the event vmethod or when receiving a buffer in
   * the render vmethod.
   *
   * The time argument should be the running_time of when this method should
   * return and is not adjusted with any latency or offset configured in the
   * sink.
   *
   * Since 0.10.20.
   *
   * @param time The running_time to be reached.
   * @return Gst::ClockReturn.
   */
  ClockReturn wait_clock(ClockTime time);

  
  /** This function will block until @a time is reached. It is usually called by
   * subclasses that use their own internal synchronisation but want to let the
   * EOS be handled by the base class.
   * 
   * This function should only be called with the PREROLL_LOCK held, like when
   * receiving an EOS event in the signal_event() vmethod.
   * 
   * The @a time argument should be the running_time of when the EOS should happen
   * and will be adjusted with any latency and offset configured in the sink.
   * @param time The running_time to be reached.
   * @param jitter The jitter to be filled with time diff, or <tt>0</tt>.
   * @return Gst::FlowReturn.
   */
  FlowReturn wait_eos(ClockTime time, ClockTimeDiff& jitter);

  /** This function will block until time is reached.  It is usually called by
   * subclasses that use their own internal synchronisation but want to let the
   * EOS be handled by the base class.
   *
   * This function should only be called with the PREROLL_LOCK held, like when
   * receiving an EOS event in the event vmethod.
   *
   * The time argument should be the running_time of when the EOS should happen
   * and will be adjusted with any latency and offset configured in the sink.
   * 
   * Since 0.10.15.
   * 
   * @param time The running time to be reached.
   * @return Gst::FlowReturn.
   */
   FlowReturn wait_eos(ClockTime time);

  
  /** Configures @a sink to synchronize on the clock or not. When
   *  @a sync is <tt>false</tt>, incoming samples will be played as fast as
   * possible. If @a sync is <tt>true</tt>, the timestamps of the incomming
   * buffers will be used to schedule the exact render time of its
   * contents.
   * @param sync The new sync value.
   */
  void set_sync(bool sync);
  
  /** Checks if @a sink is currently configured to synchronize against the
   * clock.
   * @return <tt>true</tt> if the sink is configured to synchronize against the clock.
   */
  bool get_sync() const;
  
  /** Sets the new max lateness value to @a max_lateness. This value is
   * used to decide if a buffer should be dropped or not based on the
   * buffer timestamp and the current clock time. A value of -1 means
   * an unlimited time.
   * @param max_lateness The new max lateness value.
   */
  void set_max_lateness(gint64 max_lateness);
  
  /** Gets the max lateness value. See gst_base_sink_set_max_lateness for
   * more details.
   * @return The maximum time in nanoseconds that a buffer can be late
   * before it is dropped and not rendered. A value of -1 means an
   * unlimited time.
   */
  gint64 get_max_lateness() const;
  
  /** Configures @a sink to send Quality-of-Service events upstream.
   * @param enabled The new qos value.
   */
  void set_qos_enabled(bool enabled);
  
  /** Checks if @a sink is currently configured to send Quality-of-Service events
   * upstream.
   * @return <tt>true</tt> if the sink is configured to perform Quality-of-Service.
   */
  bool is_qos_enabled() const;
  
  /** Configures @a sink to perform all state changes asynchronusly. When async is
   * disabled, the sink will immediately go to PAUSED instead of waiting for a
   * preroll buffer. This feature is useful if the sink does not synchronize
   * against the clock or when it is dealing with sparse streams.
   * @param enabled The new async value.
   */
  void set_async_enabled(bool enabled); 
  
  /** Checks if @a sink is currently configured to perform asynchronous state
   * changes to PAUSED.
   * @return <tt>true</tt> if the sink is configured to perform asynchronous state
   * changes.
   */
  bool is_async_enabled() const;
  
  /** Adjust the synchronisation of @a sink with @a offset. A negative value will
   * render buffers earlier than their timestamp. A positive value will delay
   * rendering. This function can be used to fix playback of badly timestamped
   * buffers.
   * @param offset The new offset.
   */
  void set_ts_offset(ClockTimeDiff offset);
  
  /** Get the synchronisation offset of @a sink.
   * @return The synchronisation offset.
   */
  ClockTimeDiff get_ts_offset() const;
  
  /** Set the render delay in @a sink to @a delay. The render delay is the time
   * between actual rendering of a buffer and its synchronisation time. Some
   * devices might delay media rendering which can be compensated for with this
   * function.
   * 
   * After calling this function, this sink will report additional latency and
   * other sinks will adjust their latency to delay the rendering of their media.
   * 
   * This function is usually called by subclasses.
   * @param delay The new delay.
   */
  void set_render_delay(ClockTime delay);
  
  /** Get the render delay of @a sink. see set_render_delay() for more
   * information about the render delay.
   * @return The render delay of @a sink.
   */
  ClockTime get_render_delay() const;
  
  /** Get the last buffer that arrived in the sink and was used for preroll or for
   * rendering. This property can be used to generate thumbnails.
   * 
   * The Gst::Caps on the buffer can be used to determine the type of the buffer.
   * 
   * Free-function: gst_buffer_unref
   * @return A Gst::Buffer. gst_buffer_unref() after usage.
   * This function returns <tt>0</tt> when no buffer has arrived in the sink yet
   * or when the sink is not in PAUSED or PLAYING.
   */
  Glib::RefPtr<Gst::Buffer> get_last_buffer();
  
  /** Get the last buffer that arrived in the sink and was used for preroll or for
   * rendering. This property can be used to generate thumbnails.
   * 
   * The Gst::Caps on the buffer can be used to determine the type of the buffer.
   * 
   * Free-function: gst_buffer_unref
   * @return A Gst::Buffer. gst_buffer_unref() after usage.
   * This function returns <tt>0</tt> when no buffer has arrived in the sink yet
   * or when the sink is not in PAUSED or PLAYING.
   */
  Glib::RefPtr<const Gst::Buffer> get_last_buffer() const;
  
  /** Set the number of bytes that the sink will pull when it is operating in pull
   * mode.
   * @param blocksize The blocksize in bytes.
   */
  void set_blocksize(guint blocksize);
  
  /** Get the number of bytes that the sink will pull when it is operating in pull
   * mode.
   * @return The number of bytes @a sink will pull in pull mode.
   */
  guint get_blocksize() const;

  
  /** Configures @a sink to store the last received buffer in the last-buffer
   * property.
   * @param enabled The new enable-last-buffer value.
   */
  void set_last_buffer_enabled(bool enabled);
  
  /** Checks if @a sink is currently configured to store the last received buffer in
   * the last-buffer property.
   * @return <tt>true</tt> if the sink is configured to store the last received buffer.
   */
  bool is_last_buffer_enabled() const;
  
  /** Get the time that will be inserted between frames to control the 
   * maximum buffers per second.
   * @return The number of nanoseconds @a sink will put between frames.
   */
  guint64 get_throttle_time() const;
  
  /** Set the time that will be inserted between rendered buffers. This
   * can be used to control the maximum buffers per second that the sink
   * will render.
   * @param throttle The throttle time in nanoseconds.
   */
  void set_throttle_time(guint64 throttle);

  /** Gets the sink Gst::Pad object of the element.
   */
   Glib::RefPtr<Gst::Pad> get_sink_pad();
  Glib::RefPtr<const Gst::Pad> get_sink_pad() const;
 
  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Go asynchronously to PAUSED.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_async() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Go asynchronously to PAUSED.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_async() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** The last buffer received in the sink.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Buffer> > property_last_buffer() const;
#endif //#GLIBMM_PROPERTIES_ENABLED


  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< gint64 > property_max_lateness() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< gint64 > property_max_lateness() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Number of buffers to queue during preroll.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< guint > property_preroll_queue_len() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Number of buffers to queue during preroll.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< guint > property_preroll_queue_len() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Generate Quality-of-Service events upstream.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_qos() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Generate Quality-of-Service events upstream.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_qos() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Sync on the clock.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_sync() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Sync on the clock.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_sync() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Timestamp offset in nanoseconds.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< gint64 > property_ts_offset() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Timestamp offset in nanoseconds.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< gint64 > property_ts_offset() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Enable the last-buffer property.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_enable_last_buffer() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Enable the last-buffer property.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_enable_last_buffer() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Additional render delay of the sink in nanoseconds.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< guint64 > property_render_delay() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Additional render delay of the sink in nanoseconds.
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< guint64 > property_render_delay() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** The time to keep between rendered buffers (unused).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< guint64 > property_throttle_time() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** The time to keep between rendered buffers (unused).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< guint64 > property_throttle_time() const;
#endif //#GLIBMM_PROPERTIES_ENABLED

  #ifdef GLIBMM_PROPERTIES_ENABLED
/** Size in bytes to pull per buffer (0 = default).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy< guint > property_blocksize() ;
#endif //#GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
/** Size in bytes to pull per buffer (0 = default).
   *
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
   * the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< guint > property_blocksize() const;
#endif //#GLIBMM_PROPERTIES_ENABLED


  /** Called to get sink pad caps from the subclass.
   */
    virtual Glib::RefPtr<Gst::Caps> get_caps_vfunc() const;


  /** Notify subclass of changed caps.
   */
   virtual bool set_caps_vfunc(const Glib::RefPtr<Gst::Caps>& caps);

  /** Allocate a new buffer with given caps. */
  virtual FlowReturn buffer_alloc_vfunc(guint64 offset, guint size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer);

 
  /** Called to get the start and end times for synchronising the passed buffer
   * to the clock.
   */
    virtual void get_times_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer, ClockTime& start, ClockTime& end) const;


  /** Start processing. Ideal for opening resources in the subclass.
   */
    virtual bool start_vfunc();

  /** Stop processing. Subclasses should use this to close resources.
   */
    virtual bool stop_vfunc();

  /** Unlock any pending access to the resource. Subclasses should unblock any
   * blocked function ASAP.
   */
    virtual bool unlock_vfunc();

 
  /** Override this to handle events arriving on the sink pad.
   */
    virtual bool event_vfunc(const Glib::RefPtr<Gst::Event>& event);

  /** Called to present the preroll buffer if desired.
   */
    virtual FlowReturn preroll_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer);


  /** Called when a buffer should be presented or output, at the correct moment
   * if the Gst::BaseSink has been set to sync to the clock.
   */
    virtual FlowReturn render_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer);


  /** Subclasses should override this when they need to perform special
   * processing when changing to the PLAYING state asynchronously. Called with
   * the OBJECT_LOCK held.
   */
    virtual StateChangeReturn async_play_vfunc();


  /** Subclasses should override this when they can provide an alternate method
   * of spawning a thread to drive the pipeline in pull mode. Should start or
   * stop the pulling thread, depending on the value of the "active" argument.
   * Called after actually activating the sink pad in pull mode. The default
   * implementation starts a task on the sink pad. 
   */
    virtual bool activate_pull_vfunc(bool active);

  /** Only useful in pull mode, this vmethod will be called in response to
   * Gst::Pad::fixate_caps() being called on the sink pad. Implement if you
   * have ideas about what should be the default values for the caps you
   * support.
   */
    virtual void fixate_vfunc(const Glib::RefPtr<Gst::Caps>& caps);


  /** Clear the previous unlock request. Subclasses should clear any state they
   * set during unlock_vfunc(), such as clearing command queues.
   */
  virtual bool unlock_stop_vfunc();

 
  /// Render a BufferList.
    virtual FlowReturn render_list_vfunc(const Glib::RefPtr<Gst::BufferList>& buffer_list);


protected:

  
public:

public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::


};

} // namespace Gst


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gst::BaseSink
   */
  Glib::RefPtr<Gst::BaseSink> wrap(GstBaseSink* object, bool take_copy = false);
}


#endif /* _GSTREAMERMM_BASESINK_H */