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
00029
00030 #include <gst/gsttask.h>
00031 #include <gstreamermm/object.h>
00032
00033
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GstTask GstTask;
00036 typedef struct _GstTaskClass GstTaskClass;
00037 #endif
00038
00039
00040 namespace Gst
00041 { class Task_Class; }
00042 namespace Gst
00043 {
00044
00050 enum TaskState
00051 {
00052 TASK_STARTED,
00053 TASK_STOPPED,
00054 TASK_PAUSED
00055 };
00056
00057 }
00058
00059
00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00061 namespace Glib
00062 {
00063
00064 template <>
00065 class Value<Gst::TaskState> : public Glib::Value_Enum<Gst::TaskState>
00066 {
00067 public:
00068 static GType value_type() G_GNUC_CONST;
00069 };
00070
00071 }
00072 #endif
00073
00074
00075 namespace Gst
00076 {
00077
00078
00110 class Task : public Object
00111 {
00112
00113 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00114
00115 public:
00116 typedef Task CppObjectType;
00117 typedef Task_Class CppClassType;
00118 typedef GstTask BaseObjectType;
00119 typedef GstTaskClass BaseClassType;
00120
00121 private: friend class Task_Class;
00122 static CppClassType task_class_;
00123
00124 private:
00125
00126 Task(const Task&);
00127 Task& operator=(const Task&);
00128
00129 protected:
00130 explicit Task(const Glib::ConstructParams& construct_params);
00131 explicit Task(GstTask* castitem);
00132
00133 #endif
00134
00135 public:
00136 virtual ~Task();
00137
00138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00139 static GType get_type() G_GNUC_CONST;
00140 static GType get_base_type() G_GNUC_CONST;
00141 #endif
00142
00144 GstTask* gobj() { return reinterpret_cast<GstTask*>(gobject_); }
00145
00147 const GstTask* gobj() const { return reinterpret_cast<GstTask*>(gobject_); }
00148
00150 GstTask* gobj_copy();
00151
00152 private:
00153
00154
00155 public:
00159 typedef sigc::slot<void> SlotTask;
00160
00161 protected:
00162 Task(const SlotTask& task_slot);
00163
00164 public:
00175 static Glib::RefPtr<Task> create(const SlotTask& task_slot);
00176 ;
00177
00178
00184 static void cleanup_all();
00185
00191 TaskState get_state();
00192
00205 bool join();
00206
00215 bool pause();
00216
00226 void set_lock(Glib::StaticRecMutex& mutex);
00227
00234 bool start();
00235
00243 bool stop();
00244
00245 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00246 private:
00247 SlotTask* slot;
00248 bool _slot_set(bool mark_set = false);
00249 #endif
00250
00251
00252 public:
00253
00254 public:
00255
00256 #ifdef GLIBMM_VFUNCS_ENABLED
00257 #endif //GLIBMM_VFUNCS_ENABLED
00258
00259 protected:
00260
00261 #ifdef GLIBMM_VFUNCS_ENABLED
00262 #endif //GLIBMM_VFUNCS_ENABLED
00263
00264
00265 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00266 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00267
00268
00269 };
00270
00271 }
00272
00273
00274 namespace Glib
00275 {
00284 Glib::RefPtr<Gst::Task> wrap(GstTask* object, bool take_copy = false);
00285 }
00286
00287
00288 #endif
00289