clock.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GSTREAMERMM_CLOCK_H
00004 #define _GSTREAMERMM_CLOCK_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/gstclock.h>
00029 #include <gstreamermm/object.h>
00030 
00031 
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _GstClock GstClock;
00034 typedef struct _GstClockClass GstClockClass;
00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 
00038 namespace Gst
00039 { class Clock_Class; } // namespace Gst
00040 namespace Gst
00041 {
00042 
00043 class Clock;
00044 
00047 typedef GstClockTime ClockTime;
00048 
00051 typedef GstClockTimeDiff ClockTimeDiff;
00052 
00055 const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
00056 
00059 const ClockTime SECOND = GST_SECOND;
00060 
00063 const ClockTime MILLI_SECOND = GST_MSECOND;
00064 
00067 const ClockTime MICRO_SECOND = GST_USECOND;
00068 
00071 const ClockTime NANO_SECOND = GST_NSECOND;
00072 
00078 enum ClockEntryType
00079 {
00080   CLOCK_ENTRY_SINGLE,
00081   CLOCK_ENTRY_PERIODIC
00082 };
00083 
00084 } // namespace Gst
00085 
00086 
00087 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00088 namespace Glib
00089 {
00090 
00091 template <>
00092 class Value<Gst::ClockEntryType> : public Glib::Value_Enum<Gst::ClockEntryType>
00093 {
00094 public:
00095   static GType value_type() G_GNUC_CONST;
00096 };
00097 
00098 } // namespace Glib
00099 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00100 
00101 
00102 namespace Gst
00103 {
00104 
00108 enum ClockReturn
00109 {
00110   CLOCK_OK,
00111   CLOCK_EARLY,
00112   CLOCK_UNSCHEDULED,
00113   CLOCK_BUSY,
00114   CLOCK_BADTIME,
00115   CLOCK_ERROR,
00116   CLOCK_UNSUPPORTED
00117 };
00118 
00119 } // namespace Gst
00120 
00121 
00122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00123 namespace Glib
00124 {
00125 
00126 template <>
00127 class Value<Gst::ClockReturn> : public Glib::Value_Enum<Gst::ClockReturn>
00128 {
00129 public:
00130   static GType value_type() G_GNUC_CONST;
00131 };
00132 
00133 } // namespace Glib
00134 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00135 
00136 
00137 namespace Gst
00138 {
00139 
00143 enum ClockFlags
00144 {
00145   CLOCK_FLAG_CAN_DO_SINGLE_SYNC = GST_OBJECT_FLAG_LAST << 0,
00146   CLOCK_FLAG_CAN_DO_SINGLE_ASYNC = GST_OBJECT_FLAG_LAST << 1,
00147   CLOCK_FLAG_CAN_DO_PERIODIC_SYNC = GST_OBJECT_FLAG_LAST << 2,
00148   CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC = GST_OBJECT_FLAG_LAST << 3,
00149   CLOCK_FLAG_CAN_SET_RESOLUTION = GST_OBJECT_FLAG_LAST << 4,
00150   CLOCK_FLAG_CAN_SET_MASTER = GST_OBJECT_FLAG_LAST << 5,
00151   CLOCK_FLAG_LAST = GST_OBJECT_FLAG_LAST << 8
00152 };
00153 
00154 } // namespace Gst
00155 
00156 
00157 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00158 namespace Glib
00159 {
00160 
00161 template <>
00162 class Value<Gst::ClockFlags> : public Glib::Value_Enum<Gst::ClockFlags>
00163 {
00164 public:
00165   static GType value_type() G_GNUC_CONST;
00166 };
00167 
00168 } // namespace Glib
00169 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00170 
00171 
00172 namespace Gst
00173 {
00174 
00175 
00179 class ClockID
00180 {
00181   public:
00182 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00183   typedef ClockID CppObjectType;
00184   typedef GstClockEntry BaseObjectType;
00185 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00186 
00187 
00188   // For use with Glib::RefPtr<> only.
00189   void reference()   const;
00190   void unreference() const;
00191 
00193   GstClockEntry*       gobj();
00194 
00196   const GstClockEntry* gobj() const;
00197 
00199   GstClockEntry* gobj_copy() const;
00200 
00201 protected:
00202   // Do not derive this.  Gst::ClockID can neither be constructed nor deleted.
00203   ClockID();
00204   void operator delete(void*, size_t);
00205 
00206 private:
00207   // noncopyable
00208   ClockID(const ClockID&);
00209   ClockID& operator=(const ClockID&);
00210 
00211 
00212 public:
00218   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Clock>&, ClockTime, const Glib::RefPtr<Gst::ClockID>& > SlotClock;
00219 
00220   
00226   ClockTime get_time() const;
00227   
00249   ClockReturn wait(ClockTimeDiff& jitter);
00250 
00260   ClockReturn wait();
00261 
00270   ClockReturn wait_async(const SlotClock& slot);
00271   
00272 
00280   void unschedule();
00281 
00282 
00283 };
00284 
00289 guint get_hours(ClockTime time);
00290 
00295 guint get_minutes(ClockTime time);
00296 
00301 guint get_seconds(ClockTime time);
00302 
00307 guint get_milliseconds(ClockTime time);
00308 
00313 guint get_microseconds(ClockTime time);
00314 
00319 guint get_nanoseconds(ClockTime time);
00320 
00325 guint get_fractional_seconds(ClockTime time);
00326 
00403 class Clock : public Object
00404 {
00405   
00406 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00407 
00408 public:
00409   typedef Clock CppObjectType;
00410   typedef Clock_Class CppClassType;
00411   typedef GstClock BaseObjectType;
00412   typedef GstClockClass BaseClassType;
00413 
00414 private:  friend class Clock_Class;
00415   static CppClassType clock_class_;
00416 
00417 private:
00418   // noncopyable
00419   Clock(const Clock&);
00420   Clock& operator=(const Clock&);
00421 
00422 protected:
00423   explicit Clock(const Glib::ConstructParams& construct_params);
00424   explicit Clock(GstClock* castitem);
00425 
00426 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00427 
00428 public:
00429   virtual ~Clock();
00430 
00431 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00432   static GType get_type()      G_GNUC_CONST;
00433   static GType get_base_type() G_GNUC_CONST;
00434 #endif
00435 
00437   GstClock*       gobj()       { return reinterpret_cast<GstClock*>(gobject_); }
00438 
00440   const GstClock* gobj() const { return reinterpret_cast<GstClock*>(gobject_); }
00441 
00443   GstClock* gobj_copy();
00444 
00445 private:
00446 
00447 
00448 public:
00449   
00468   bool add_observation(ClockTime slave_time, ClockTime master_time, gdouble* result);
00469   
00487   bool set_master(const Clock& master_clock);
00488   
00496   Glib::RefPtr<Gst::Clock> get_master();
00497   
00505   Glib::RefPtr<const Gst::Clock> get_master() const;
00506   
00515   ClockTime set_resolution(ClockTime resolution);
00516   
00523   ClockTime get_resolution() const;
00524   
00533   ClockTime get_time() const;
00534   
00543   Glib::RefPtr<Gst::ClockID> create_single_shot_id(ClockTime time);
00544   
00555   Glib::RefPtr<Gst::ClockID> create_periodic_id(ClockTime start_time, ClockTime intervals);
00556   
00564   ClockTime get_internal_time() const;
00565   
00575   ClockTime adjust_unlocked(ClockTime internal_time);
00576   
00588   ClockTime unadjust_unlocked(ClockTime external_time);
00589   
00602   void get_calibration(ClockTime& internal, ClockTime& external, ClockTime& rate_num, ClockTime& rate_denom) const;
00603   
00633   void set_calibration(ClockTime internal, ClockTime external, ClockTime rate_num, ClockTime rate_denom);
00634   
00635   #ifdef GLIBMM_PROPERTIES_ENABLED
00636 
00642   Glib::PropertyProxy<bool> property_stats() ;
00643 #endif //#GLIBMM_PROPERTIES_ENABLED
00644 
00645 #ifdef GLIBMM_PROPERTIES_ENABLED
00646 
00652   Glib::PropertyProxy_ReadOnly<bool> property_stats() const;
00653 #endif //#GLIBMM_PROPERTIES_ENABLED
00654 
00655   #ifdef GLIBMM_PROPERTIES_ENABLED
00656 
00662   Glib::PropertyProxy<guint64> property_timeout() ;
00663 #endif //#GLIBMM_PROPERTIES_ENABLED
00664 
00665 #ifdef GLIBMM_PROPERTIES_ENABLED
00666 
00672   Glib::PropertyProxy_ReadOnly<guint64> property_timeout() const;
00673 #endif //#GLIBMM_PROPERTIES_ENABLED
00674 
00675   #ifdef GLIBMM_PROPERTIES_ENABLED
00676 
00682   Glib::PropertyProxy<int> property_window_size() ;
00683 #endif //#GLIBMM_PROPERTIES_ENABLED
00684 
00685 #ifdef GLIBMM_PROPERTIES_ENABLED
00686 
00692   Glib::PropertyProxy_ReadOnly<int> property_window_size() const;
00693 #endif //#GLIBMM_PROPERTIES_ENABLED
00694 
00695   #ifdef GLIBMM_PROPERTIES_ENABLED
00696 
00702   Glib::PropertyProxy<int> property_window_threshold() ;
00703 #endif //#GLIBMM_PROPERTIES_ENABLED
00704 
00705 #ifdef GLIBMM_PROPERTIES_ENABLED
00706 
00712   Glib::PropertyProxy_ReadOnly<int> property_window_threshold() const;
00713 #endif //#GLIBMM_PROPERTIES_ENABLED
00714 
00715 
00719   #ifdef GLIBMM_VFUNCS_ENABLED
00720   virtual ClockTime change_resolution_vfunc(ClockTime old_resolution, ClockTime new_resolution);
00721 #endif //GLIBMM_VFUNCS_ENABLED
00722 
00723 
00726   #ifdef GLIBMM_VFUNCS_ENABLED
00727   virtual ClockTime get_resolution_vfunc() const;
00728 #endif //GLIBMM_VFUNCS_ENABLED
00729 
00730 
00733   #ifdef GLIBMM_VFUNCS_ENABLED
00734   virtual ClockTime get_internal_time_vfunc() const;
00735 #endif //GLIBMM_VFUNCS_ENABLED
00736 
00737 
00741   #ifdef GLIBMM_VFUNCS_ENABLED
00742   virtual ClockReturn wait_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
00743 #endif //GLIBMM_VFUNCS_ENABLED
00744 
00745 
00748   #ifdef GLIBMM_VFUNCS_ENABLED
00749   virtual ClockReturn wait_async_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
00750 #endif //GLIBMM_VFUNCS_ENABLED
00751 
00752 
00755   #ifdef GLIBMM_VFUNCS_ENABLED
00756   virtual void unschedule_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
00757 #endif //GLIBMM_VFUNCS_ENABLED
00758 
00759 
00763   #ifdef GLIBMM_VFUNCS_ENABLED
00764   virtual ClockReturn wait_jitter_vfunc(const Glib::RefPtr<Gst::ClockID>& id, ClockTimeDiff& jitter);
00765 #endif //GLIBMM_VFUNCS_ENABLED
00766 
00767 
00768 public:
00769 
00770 public:
00771   //C++ methods used to invoke GTK+ virtual functions:
00772 #ifdef GLIBMM_VFUNCS_ENABLED
00773 #endif //GLIBMM_VFUNCS_ENABLED
00774 
00775 protected:
00776   //GTK+ Virtual Functions (override these to change behaviour):
00777 #ifdef GLIBMM_VFUNCS_ENABLED
00778 #endif //GLIBMM_VFUNCS_ENABLED
00779 
00780   //Default Signal Handlers::
00781 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00782 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00783 
00784 
00785 };
00786 
00787 } //namespace Gst
00788 
00789 
00790 namespace Glib
00791 {
00792 
00801   Glib::RefPtr<Gst::ClockID> wrap(GstClockEntry* object, bool take_copy = false);
00802 
00803 } // namespace Glib
00804 
00805 
00806 namespace Glib
00807 {
00816   Glib::RefPtr<Gst::Clock> wrap(GstClock* object, bool take_copy = false);
00817 }
00818 
00819 
00820 #endif /* _GSTREAMERMM_CLOCK_H */
00821 

Generated on Wed Aug 19 15:53:16 2009 for gstreamermm by  doxygen 1.5.4