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
00029
00030 #include <gstreamermm/clock.h>
00031 #include <gstreamermm/format.h>
00032 #include <gstreamermm/event.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 extern "C" { typedef struct _GstSegment GstSegment; }
00037 #endif
00038
00039 namespace Gst
00040 {
00041
00098 class Segment
00099 {
00100 public:
00101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00102 typedef Segment CppObjectType;
00103 typedef GstSegment BaseObjectType;
00104
00105 static GType get_type() G_GNUC_CONST;
00106 #endif
00107
00108 Segment();
00109
00110 explicit Segment(GstSegment* gobject, bool make_a_copy = true);
00111
00112 Segment(const Segment& other);
00113 Segment& operator=(const Segment& other);
00114
00115 ~Segment();
00116
00117 void swap(Segment& other);
00118
00120 GstSegment* gobj() { return gobject_; }
00121
00123 const GstSegment* gobj() const { return gobject_; }
00124
00126 GstSegment* gobj_copy() const;
00127
00128 protected:
00129 GstSegment* gobject_;
00130
00131 private:
00132
00133
00134 public:
00135
00158 bool clip(Format format, gint64 start, gint64 stop, gint64& clip_start, gint64& clip_stop);
00159
00167 void init(Format format);
00168
00178 void set_duration(Format format, gint64 duration);
00179
00187 void set_last_stop(Format format, gint64 position);
00188
00200 void set_newsegment(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 time);
00201
00211 void set_newsegment(bool update, double rate, double applied_rate, Format format, gint64 start, gint64 stop, gint64 time);
00212
00249 void set_seek(double rate, Format format, SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop, bool& update);
00250
00266 gint64 convert_to_running_time(Format format, gint64 position);
00267
00283 gint64 convert_to_stream_time(Format format, gint64 position);
00284
00285
00286 };
00287
00288 }
00289
00290
00291 namespace Gst
00292 {
00293
00298 inline void swap(Segment& lhs, Segment& rhs)
00299 { lhs.swap(rhs); }
00300
00301 }
00302
00303 namespace Glib
00304 {
00305
00314 Gst::Segment wrap(GstSegment* object, bool take_copy = false);
00315
00316 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00317 template <>
00318 class Value<Gst::Segment> : public Glib::Value_Boxed<Gst::Segment>
00319 {};
00320 #endif
00321
00322 }
00323
00324
00325 #endif
00326