- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# 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
    00434
    00435   static GType get_base_type() G_GNUC_CONST;
    00436 #endif
    00437
    00439   GstClock*       gobj()       { return reinterpret_cast<GstClock*>(gobject_); }
    00440
    00442   const GstClock* gobj() const { return reinterpret_cast<GstClock*>(gobject_); }
    00443
    00445   GstClock* gobj_copy();
    00446
    00447 private:
    00448
    00449
    00450 public:
    00451
    00470   bool add_observation(ClockTime slave_time, ClockTime master_time, gdouble* result);
    00471
    00489   bool set_master(const Clock& master_clock);
    00490
    00498   Glib::RefPtr<Gst::Clock> get_master();
    00499
    00507   Glib::RefPtr<const Gst::Clock> get_master() const;
    00508
    00517   ClockTime set_resolution(ClockTime resolution);
    00518
    00525   ClockTime get_resolution() const;
    00526
    00535   ClockTime get_time() const;
    00536
    00545   Glib::RefPtr<Gst::ClockID> create_single_shot_id(ClockTime time);
    00546
    00557   Glib::RefPtr<Gst::ClockID> create_periodic_id(ClockTime start_time, ClockTime intervals);
    00558
    00566   ClockTime get_internal_time() const;
    00567
    00577   ClockTime adjust_unlocked(ClockTime internal_time);
    00578
    00590   ClockTime unadjust_unlocked(ClockTime external_time);
    00591
    00604   void get_calibration(ClockTime& internal, ClockTime& external, ClockTime& rate_num, ClockTime& rate_denom) const;
    00605
    00635   void set_calibration(ClockTime internal, ClockTime external, ClockTime rate_num, ClockTime rate_denom);
    00636
    00637   #ifdef GLIBMM_PROPERTIES_ENABLED
    00638
    00644   Glib::PropertyProxy<bool> property_stats() ;
    00645 #endif //#GLIBMM_PROPERTIES_ENABLED
    00646
    00647 #ifdef GLIBMM_PROPERTIES_ENABLED
    00648
    00654   Glib::PropertyProxy_ReadOnly<bool> property_stats() const;
    00655 #endif //#GLIBMM_PROPERTIES_ENABLED
    00656
    00657   #ifdef GLIBMM_PROPERTIES_ENABLED
    00658
    00664   Glib::PropertyProxy<guint64> property_timeout() ;
    00665 #endif //#GLIBMM_PROPERTIES_ENABLED
    00666
    00667 #ifdef GLIBMM_PROPERTIES_ENABLED
    00668
    00674   Glib::PropertyProxy_ReadOnly<guint64> property_timeout() const;
    00675 #endif //#GLIBMM_PROPERTIES_ENABLED
    00676
    00677   #ifdef GLIBMM_PROPERTIES_ENABLED
    00678
    00684   Glib::PropertyProxy<int> property_window_size() ;
    00685 #endif //#GLIBMM_PROPERTIES_ENABLED
    00686
    00687 #ifdef GLIBMM_PROPERTIES_ENABLED
    00688
    00694   Glib::PropertyProxy_ReadOnly<int> property_window_size() const;
    00695 #endif //#GLIBMM_PROPERTIES_ENABLED
    00696
    00697   #ifdef GLIBMM_PROPERTIES_ENABLED
    00698
    00704   Glib::PropertyProxy<int> property_window_threshold() ;
    00705 #endif //#GLIBMM_PROPERTIES_ENABLED
    00706
    00707 #ifdef GLIBMM_PROPERTIES_ENABLED
    00708
    00714   Glib::PropertyProxy_ReadOnly<int> property_window_threshold() const;
    00715 #endif //#GLIBMM_PROPERTIES_ENABLED
    00716
    00717
    00721   #ifdef GLIBMM_VFUNCS_ENABLED
    00722   virtual ClockTime change_resolution_vfunc(ClockTime old_resolution, ClockTime new_resolution);
    00723 #endif //GLIBMM_VFUNCS_ENABLED
    00724
    00725
    00728   #ifdef GLIBMM_VFUNCS_ENABLED
    00729   virtual ClockTime get_resolution_vfunc() const;
    00730 #endif //GLIBMM_VFUNCS_ENABLED
    00731
    00732
    00735   #ifdef GLIBMM_VFUNCS_ENABLED
    00736   virtual ClockTime get_internal_time_vfunc() const;
    00737 #endif //GLIBMM_VFUNCS_ENABLED
    00738
    00739
    00743   #ifdef GLIBMM_VFUNCS_ENABLED
    00744   virtual ClockReturn wait_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
    00745 #endif //GLIBMM_VFUNCS_ENABLED
    00746
    00747
    00750   #ifdef GLIBMM_VFUNCS_ENABLED
    00751   virtual ClockReturn wait_async_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
    00752 #endif //GLIBMM_VFUNCS_ENABLED
    00753
    00754
    00757   #ifdef GLIBMM_VFUNCS_ENABLED
    00758   virtual void unschedule_vfunc(const Glib::RefPtr<Gst::ClockID>& id);
    00759 #endif //GLIBMM_VFUNCS_ENABLED
    00760
    00761
    00765   #ifdef GLIBMM_VFUNCS_ENABLED
    00766   virtual ClockReturn wait_jitter_vfunc(const Glib::RefPtr<Gst::ClockID>& id, ClockTimeDiff& jitter);
    00767 #endif //GLIBMM_VFUNCS_ENABLED
    00768
    00769
    00770 public:
    00771
    00772 public:
    00773   //C++ methods used to invoke GTK+ virtual functions:
    00774 #ifdef GLIBMM_VFUNCS_ENABLED
    00775 #endif //GLIBMM_VFUNCS_ENABLED
    00776
    00777 protected:
    00778   //GTK+ Virtual Functions (override these to change behaviour):
    00779 #ifdef GLIBMM_VFUNCS_ENABLED
    00780 #endif //GLIBMM_VFUNCS_ENABLED
    00781
    00782   //Default Signal Handlers::
    00783 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00784 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00785
    00786
    00787 };
    00788
    00789 } //namespace Gst
    00790
    00791
    00792 namespace Glib
    00793 {
    00794
    00803   Glib::RefPtr<Gst::ClockID> wrap(GstClockEntry* object, bool take_copy = false);
    00804
    00805 } // namespace Glib
    00806
    00807
    00808 namespace Glib
    00809 {
    00818   Glib::RefPtr<Gst::Clock> wrap(GstClock* object, bool take_copy = false);
    00819 }
    00820
    00821
    00822 #endif /* _GSTREAMERMM_CLOCK_H */
    00823