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
00170 static Glib::RefPtr<Task> create(const SlotTask& slot);
00171
00172
00178 static void cleanup_all();
00179
00185 TaskState get_state();
00186
00199 bool join();
00200
00209 bool pause();
00210
00220 void set_lock(Glib::StaticRecMutex& mutex);
00221
00228 bool start();
00229
00237 bool stop();
00238
00239 protected:
00240 SlotTask* slot;
00241
00242
00243 public:
00244
00245 public:
00246
00247 #ifdef GLIBMM_VFUNCS_ENABLED
00248 #endif //GLIBMM_VFUNCS_ENABLED
00249
00250 protected:
00251
00252 #ifdef GLIBMM_VFUNCS_ENABLED
00253 #endif //GLIBMM_VFUNCS_ENABLED
00254
00255
00256 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00257 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00258
00259
00260 };
00261
00262 }
00263
00264
00265 namespace Glib
00266 {
00275 Glib::RefPtr<Gst::Task> wrap(GstTask* object, bool take_copy = false);
00276 }
00277
00278
00279 #endif
00280