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
00095 class Segment
00096 {
00097 public:
00098 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00099 typedef Segment CppObjectType;
00100 typedef GstSegment BaseObjectType;
00101
00102 static GType get_type() G_GNUC_CONST;
00103 #endif
00104
00105 Segment();
00106
00107 explicit Segment(GstSegment* gobject, bool make_a_copy = true);
00108
00109 Segment(const Segment& other);
00110 Segment& operator=(const Segment& other);
00111
00112 ~Segment();
00113
00114 void swap(Segment& other);
00115
00117 GstSegment* gobj() { return gobject_; }
00118
00120 const GstSegment* gobj() const { return gobject_; }
00121
00123 GstSegment* gobj_copy() const;
00124
00125 protected:
00126 GstSegment* gobject_;
00127
00128 private:
00129
00130
00131 public:
00132
00155 bool clip(Format format, gint64 start, gint64 stop, gint64& clip_start, gint64& clip_stop) const;
00156
00164 void init(Format format);
00165
00175 void set_duration(Format format, gint64 duration);
00176
00184 void set_last_stop(Format format, gint64 position);
00185
00197 void set_newsegment(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 time);
00198
00208 void set_newsegment(bool update, double rate, double applied_rate, Format format, gint64 start, gint64 stop, gint64 time);
00209
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 to_running_time(Format format, gint64 position) const;
00265
00281 gint64 to_stream_time(Format format, gint64 position) const;
00282
00292 gint64 to_position(Format format, gint64 running_time) const;
00293
00303 bool set_running_time(Format format, gint64 running_time);
00304
00305
00306 };
00307
00308 }
00309
00310
00311 namespace Gst
00312 {
00313
00318 inline void swap(Segment& lhs, Segment& rhs)
00319 { lhs.swap(rhs); }
00320
00321 }
00322
00323 namespace Glib
00324 {
00325
00334 Gst::Segment wrap(GstSegment* object, bool take_copy = false);
00335
00336 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00337 template <>
00338 class Value<Gst::Segment> : public Glib::Value_Boxed<Gst::Segment>
00339 {};
00340 #endif
00341
00342 }
00343
00344
00345 #endif
00346