00001
00002
00003 #ifndef _GSTREAMERMM_SEGMENT_H
00004 #define _GSTREAMERMM_SEGMENT_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <gstreamermm/clock.h>
00029 #include <gstreamermm/format.h>
00030 #include <gstreamermm/event.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 extern "C" { typedef struct _GstSegment GstSegment; }
00035 #endif
00036
00037 namespace Gst
00038 {
00039
00096 class Segment
00097 {
00098 public:
00099 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00100 typedef Segment CppObjectType;
00101 typedef GstSegment BaseObjectType;
00102
00103 static GType get_type() G_GNUC_CONST;
00104 #endif
00105
00106 Segment();
00107
00108 explicit Segment(GstSegment* gobject, bool make_a_copy = true);
00109
00110 Segment(const Segment& other);
00111 Segment& operator=(const Segment& other);
00112
00113 ~Segment();
00114
00115 void swap(Segment& other);
00116
00118 GstSegment* gobj() { return gobject_; }
00119
00121 const GstSegment* gobj() const { return gobject_; }
00122
00124 GstSegment* gobj_copy() const;
00125
00126 protected:
00127 GstSegment* gobject_;
00128
00129 private:
00130
00131
00132 public:
00133
00156 bool clip(Format format, gint64 start, gint64 stop, gint64& clip_start, gint64& clip_stop) const;
00157
00165 void init(Format format);
00166
00176 void set_duration(Format format, gint64 duration);
00177
00185 void set_last_stop(Format format, gint64 position);
00186
00198 void set_newsegment(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 time);
00199
00209 void set_newsegment(bool update, double rate, double applied_rate, Format format, gint64 start, gint64 stop, gint64 time);
00210
00247 void set_seek(double rate, Format format, SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop, bool& update);
00248
00264 gint64 convert_to_running_time(Format format, gint64 position) const;
00265
00281 gint64 convert_to_stream_time(Format format, gint64 position) const;
00282
00283
00284 };
00285
00286 }
00287
00288
00289 namespace Gst
00290 {
00291
00296 inline void swap(Segment& lhs, Segment& rhs)
00297 { lhs.swap(rhs); }
00298
00299 }
00300
00301 namespace Glib
00302 {
00303
00312 Gst::Segment wrap(GstSegment* object, bool take_copy = false);
00313
00314 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00315 template <>
00316 class Value<Gst::Segment> : public Glib::Value_Boxed<Gst::Segment>
00317 {};
00318 #endif
00319
00320 }
00321
00322
00323 #endif
00324