gstreamermm: basesink.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files

# basesink.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_BASESINK_H
    00004 #define _GSTREAMERMM_BASESINK_H
    00005
    00006
    00007 #include <glibmm.h>
    00008
    00009 /* gstreamermm - a C++ wrapper for gstreamer
    00010  *
    00011  * Copyright 2008 The gstreamermm Development Team
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Lesser General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2.1 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Lesser General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Lesser General Public
    00024  * License along with this library; if not, write to the Free
    00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00026  */
    00027
    00028 #include <gst/base/gstbasesink.h>
    00029 #include <gstreamermm/element.h>
    00030 #include <gstreamermm/buffer.h>
    00031 #include <gstreamermm/pad.h>
    00032
    00033
    00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00035 typedef struct _GstBaseSink GstBaseSink;
    00036 typedef struct _GstBaseSinkClass GstBaseSinkClass;
    00037 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00038
    00039
    00040 namespace Gst
    00041 { class BaseSink_Class; } // namespace Gst
    00042 namespace Gst
    00043 {
    00044
    00148 class BaseSink
    00149 : public Element
    00150 {
    00151
    00152 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00153
    00154 public:
    00155   typedef BaseSink CppObjectType;
    00156   typedef BaseSink_Class CppClassType;
    00157   typedef GstBaseSink BaseObjectType;
    00158   typedef GstBaseSinkClass BaseClassType;
    00159
    00160 private:  friend class BaseSink_Class;
    00161   static CppClassType basesink_class_;
    00162
    00163 private:
    00164   // noncopyable
    00165   BaseSink(const BaseSink&);
    00166   BaseSink& operator=(const BaseSink&);
    00167
    00168 protected:
    00169   explicit BaseSink(const Glib::ConstructParams& construct_params);
    00170   explicit BaseSink(GstBaseSink* castitem);
    00171
    00172 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00173
    00174 public:
    00175   virtual ~BaseSink();
    00176
    00177 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00178   static GType get_type()      G_GNUC_CONST;
    00179   static GType get_base_type() G_GNUC_CONST;
    00180 #endif
    00181
    00183   GstBaseSink*       gobj()       { return reinterpret_cast<GstBaseSink*>(gobject_); }
    00184
    00186   const GstBaseSink* gobj() const { return reinterpret_cast<GstBaseSink*>(gobject_); }
    00187
    00189   GstBaseSink* gobj_copy();
    00190
    00191 private:
    00192
    00193
    00194 public:
    00195
    00214   bool query_latency(bool& live, bool& upstream_live, ClockTime& min_latency, ClockTime& max_latency) const;
    00215
    00221   ClockTime get_latency() const;
    00222
    00234   FlowReturn wait_preroll();
    00235
    00256   ClockReturn wait_clock(ClockTime time, ClockTimeDiff& jitter);
    00257
    00279   ClockReturn wait_clock(ClockTime time);
    00280
    00281
    00297   FlowReturn wait_eos(ClockTime time, ClockTimeDiff& jitter);
    00298
    00314    FlowReturn wait_eos(ClockTime time);
    00315
    00316
    00326   void set_sync(bool sync);
    00327
    00334   bool get_sync() const;
    00335
    00344   void set_max_lateness(gint64 max_lateness);
    00345
    00354   gint64 get_max_lateness() const;
    00355
    00361   void set_qos_enabled(bool enabled);
    00362
    00369   bool is_qos_enabled() const;
    00370
    00379   void set_async_enabled(bool enabled);
    00380
    00388   bool is_async_enabled() const;
    00389
    00398   void set_ts_offset(ClockTimeDiff offset);
    00399
    00405   ClockTimeDiff get_ts_offset() const;
    00406
    00420   void set_render_delay(ClockTime delay);
    00421
    00428   ClockTime get_render_delay() const;
    00429
    00440   Glib::RefPtr<Gst::Buffer> get_last_buffer();
    00441
    00452   Glib::RefPtr<const Gst::Buffer> get_last_buffer() const;
    00453
    00456    Glib::RefPtr<Gst::Pad> get_sink_pad() const;
    00457
    00458   #ifdef GLIBMM_PROPERTIES_ENABLED
    00459
    00465   Glib::PropertyProxy<bool> property_async() ;
    00466 #endif //#GLIBMM_PROPERTIES_ENABLED
    00467
    00468 #ifdef GLIBMM_PROPERTIES_ENABLED
    00469
    00475   Glib::PropertyProxy_ReadOnly<bool> property_async() const;
    00476 #endif //#GLIBMM_PROPERTIES_ENABLED
    00477
    00478   #ifdef GLIBMM_PROPERTIES_ENABLED
    00479
    00485   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Buffer> > property_last_buffer() const;
    00486 #endif //#GLIBMM_PROPERTIES_ENABLED
    00487
    00488
    00489   #ifdef GLIBMM_PROPERTIES_ENABLED
    00490
    00496   Glib::PropertyProxy<gint64> property_max_lateness() ;
    00497 #endif //#GLIBMM_PROPERTIES_ENABLED
    00498
    00499 #ifdef GLIBMM_PROPERTIES_ENABLED
    00500
    00506   Glib::PropertyProxy_ReadOnly<gint64> property_max_lateness() const;
    00507 #endif //#GLIBMM_PROPERTIES_ENABLED
    00508
    00509   #ifdef GLIBMM_PROPERTIES_ENABLED
    00510
    00516   Glib::PropertyProxy<guint> property_preroll_queue_len() ;
    00517 #endif //#GLIBMM_PROPERTIES_ENABLED
    00518
    00519 #ifdef GLIBMM_PROPERTIES_ENABLED
    00520
    00526   Glib::PropertyProxy_ReadOnly<guint> property_preroll_queue_len() const;
    00527 #endif //#GLIBMM_PROPERTIES_ENABLED
    00528
    00529   #ifdef GLIBMM_PROPERTIES_ENABLED
    00530
    00536   Glib::PropertyProxy<bool> property_qos() ;
    00537 #endif //#GLIBMM_PROPERTIES_ENABLED
    00538
    00539 #ifdef GLIBMM_PROPERTIES_ENABLED
    00540
    00546   Glib::PropertyProxy_ReadOnly<bool> property_qos() const;
    00547 #endif //#GLIBMM_PROPERTIES_ENABLED
    00548
    00549   #ifdef GLIBMM_PROPERTIES_ENABLED
    00550
    00556   Glib::PropertyProxy<bool> property_sync() ;
    00557 #endif //#GLIBMM_PROPERTIES_ENABLED
    00558
    00559 #ifdef GLIBMM_PROPERTIES_ENABLED
    00560
    00566   Glib::PropertyProxy_ReadOnly<bool> property_sync() const;
    00567 #endif //#GLIBMM_PROPERTIES_ENABLED
    00568
    00569   #ifdef GLIBMM_PROPERTIES_ENABLED
    00570
    00576   Glib::PropertyProxy<gint64> property_ts_offset() ;
    00577 #endif //#GLIBMM_PROPERTIES_ENABLED
    00578
    00579 #ifdef GLIBMM_PROPERTIES_ENABLED
    00580
    00586   Glib::PropertyProxy_ReadOnly<gint64> property_ts_offset() const;
    00587 #endif //#GLIBMM_PROPERTIES_ENABLED
    00588
    00589
    00590   //TODO: bool vfuncs are a problem because if the base class does not
    00591   //implement one (which occurs often in GStreamer -- don't know why) the
    00592   //default generated callback returns false because of the "typedef RType;
    00593   //return RType()" statements (see discussion about bug #530416 in element.hg
    00594   //for more).  I've filed a patch for the bug which will allow a custom return
    00595   //to be specified for the callback, in which case the bool vfuncs can be made
    00596   //to return true which would then work.
    00597
    00598
    00601   #ifdef GLIBMM_VFUNCS_ENABLED
    00602   virtual Glib::RefPtr<Gst::Caps> get_caps_vfunc() const;
    00603 #endif //GLIBMM_VFUNCS_ENABLED
    00604
    00605
    00607    //*/
    00608   //_WRAP_VFUNC(bool set_caps(const Glib::RefPtr<Gst::Caps>& caps), "set_caps")
    00609
    00610 //TODO: #m4 __CONVERSION(`Glib::RefPtr<Gst::Buffer>&', `GstBuffer**', `*($3)')
    00611   //_WRAP_VFUNC(FlowReturn buffer_alloc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer), "buffer_alloc")
    00612
    00613
    00617   #ifdef GLIBMM_VFUNCS_ENABLED
    00618   virtual void get_times_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer, ClockTime& start, ClockTime& end) const;
    00619 #endif //GLIBMM_VFUNCS_ENABLED
    00620
    00621
    00623    //*/
    00624   //_WRAP_VFUNC(bool start(), "start")
    00625
    00627    //*/
    00628   //_WRAP_VFUNC(bool stop(), "stop")
    00629
    00631    //* blocked function ASAP.
    00632    //*/
    00633   //_WRAP_VFUNC(bool unlock(), "unlock")
    00634
    00636    //*/
    00637   //_WRAP_VFUNC(bool event(const Glib::RefPtr<Gst::Event>& event), "event")
    00638
    00641   #ifdef GLIBMM_VFUNCS_ENABLED
    00642   virtual FlowReturn preroll_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer);
    00643 #endif //GLIBMM_VFUNCS_ENABLED
    00644
    00645
    00649   #ifdef GLIBMM_VFUNCS_ENABLED
    00650   virtual FlowReturn render_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer);
    00651 #endif //GLIBMM_VFUNCS_ENABLED
    00652
    00653
    00658   #ifdef GLIBMM_VFUNCS_ENABLED
    00659   virtual StateChangeReturn async_play_vfunc();
    00660 #endif //GLIBMM_VFUNCS_ENABLED
    00661
    00662
    00664    //* of spawning a thread to drive the pipeline in pull mode. Should start or
    00665    //* stop the pulling thread, depending on the value of the "active" argument.
    00666    //* Called after actually activating the sink pad in pull mode. The default
    00667    //* implementation starts a task on the sink pad.
    00668    //*/
    00669   //_WRAP_VFUNC(bool activate_pull(bool active), "activate_pull")
    00670
    00676   #ifdef GLIBMM_VFUNCS_ENABLED
    00677   virtual void fixate_vfunc(const Glib::RefPtr<Gst::Caps>& caps);
    00678 #endif //GLIBMM_VFUNCS_ENABLED
    00679
    00680
    00682    //* set during unlock_vfunc(), such as clearing command queues.
    00683    //*/
    00684   //_WRAP_VFUNC(bool unlock_stop(), "unlock_stop")
    00685
    00686
    00687 public:
    00688
    00689 public:
    00690   //C++ methods used to invoke GTK+ virtual functions:
    00691 #ifdef GLIBMM_VFUNCS_ENABLED
    00692 #endif //GLIBMM_VFUNCS_ENABLED
    00693
    00694 protected:
    00695   //GTK+ Virtual Functions (override these to change behaviour):
    00696 #ifdef GLIBMM_VFUNCS_ENABLED
    00697 #endif //GLIBMM_VFUNCS_ENABLED
    00698
    00699   //Default Signal Handlers::
    00700 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00701 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00702
    00703
    00704 };
    00705
    00706 } //namespace Gst
    00707
    00708
    00709 namespace Glib
    00710 {
    00719   Glib::RefPtr<Gst::BaseSink> wrap(GstBaseSink* object, bool take_copy = false);
    00720 }
    00721
    00722
    00723 #endif /* _GSTREAMERMM_BASESINK_H */
    00724