00001
00002
00003 #ifndef _GSTREAMERMM_TASK_H
00004 #define _GSTREAMERMM_TASK_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 <gst/gsttask.h>
00029 #include <gstreamermm/object.h>
00030
00031
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _GstTask GstTask;
00034 typedef struct _GstTaskClass GstTaskClass;
00035 #endif
00036
00037
00038 namespace Gst
00039 { class Task_Class; }
00040 namespace Gst
00041 {
00042
00048 enum TaskState
00049 {
00050 TASK_STARTED,
00051 TASK_STOPPED,
00052 TASK_PAUSED
00053 };
00054
00055 }
00056
00057
00058 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00059 namespace Glib
00060 {
00061
00062 template <>
00063 class Value<Gst::TaskState> : public Glib::Value_Enum<Gst::TaskState>
00064 {
00065 public:
00066 static GType value_type() G_GNUC_CONST;
00067 };
00068
00069 }
00070 #endif
00071
00072
00073 namespace Gst
00074 {
00075
00076
00108 class Task : public Object
00109 {
00110
00111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00112
00113 public:
00114 typedef Task CppObjectType;
00115 typedef Task_Class CppClassType;
00116 typedef GstTask BaseObjectType;
00117 typedef GstTaskClass BaseClassType;
00118
00119 private: friend class Task_Class;
00120 static CppClassType task_class_;
00121
00122 private:
00123
00124 Task(const Task&);
00125 Task& operator=(const Task&);
00126
00127 protected:
00128 explicit Task(const Glib::ConstructParams& construct_params);
00129 explicit Task(GstTask* castitem);
00130
00131 #endif
00132
00133 public:
00134 virtual ~Task();
00135
00136 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00137 static GType get_type() G_GNUC_CONST;
00138 static GType get_base_type() G_GNUC_CONST;
00139 #endif
00140
00142 GstTask* gobj() { return reinterpret_cast<GstTask*>(gobject_); }
00143
00145 const GstTask* gobj() const { return reinterpret_cast<GstTask*>(gobject_); }
00146
00148 GstTask* gobj_copy();
00149
00150 private:
00151
00152
00153 public:
00157 typedef sigc::slot<void> SlotTask;
00158
00159 protected:
00160 Task(const SlotTask& task_slot);
00161
00162 public:
00173 static Glib::RefPtr<Task> create(const SlotTask& task_slot);
00174 ;
00175
00176
00182 static void cleanup_all();
00183
00189 TaskState get_state() const;
00190
00203 bool join();
00204
00213 bool pause();
00214
00224 void set_lock(Glib::StaticRecMutex& mutex);
00225
00232 bool start();
00233
00241 bool stop();
00242
00243 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00244 private:
00245 SlotTask* slot;
00246 bool _slot_set;
00247 #endif
00248
00249
00250 public:
00251
00252 public:
00253
00254 #ifdef GLIBMM_VFUNCS_ENABLED
00255 #endif //GLIBMM_VFUNCS_ENABLED
00256
00257 protected:
00258
00259 #ifdef GLIBMM_VFUNCS_ENABLED
00260 #endif //GLIBMM_VFUNCS_ENABLED
00261
00262
00263 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00264 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00265
00266
00267 };
00268
00269 }
00270
00271
00272 namespace Glib
00273 {
00282 Glib::RefPtr<Gst::Task> wrap(GstTask* object, bool take_copy = false);
00283 }
00284
00285
00286 #endif
00287