00001
00002
00003 #ifndef _GSTREAMERMM_CAPS_H
00004 #define _GSTREAMERMM_CAPS_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/gstcaps.h>
00031 #include <gstreamermm/structure.h>
00032 #include <gstreamermm/structurevalue.h>
00033
00034
00035 namespace Gst
00036 {
00037
00038 struct Structure;
00039
00066 class Caps
00067 {
00068 public:
00069 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00070 typedef Caps CppObjectType;
00071 typedef GstCaps BaseObjectType;
00072 #endif
00073
00074 static Glib::RefPtr<Caps> create();
00075
00076
00077 void reference() const;
00078 void unreference() const;
00079
00081 GstCaps* gobj();
00082
00084 const GstCaps* gobj() const;
00085
00087 GstCaps* gobj_copy() const;
00088
00089 protected:
00090
00091 Caps();
00092 void operator delete(void*, size_t);
00093
00094 private:
00095
00096 Caps(const Caps&);
00097 Caps& operator=(const Caps&);
00098
00099
00100 public:
00101
00107 static Glib::RefPtr<Caps> create_any();
00108
00114 static Glib::RefPtr<Caps> create_simple(const Glib::ustring& media_type);
00115
00122 static Glib::RefPtr<Caps> create(const Structure& first_struct);
00123
00124
00129 static Glib::RefPtr<Caps> create_from_string(const Glib::ustring& string);
00130
00131
00142 Glib::RefPtr<Caps> copy() const;
00143
00149 Glib::RefPtr<Caps> copy_nth(guint nth) const;
00150
00156 void append(const Glib::RefPtr<Caps>& caps);
00157
00166 void merge(const Glib::RefPtr<Caps>& caps);
00167
00172 void append_structure(const Structure& structure);
00173
00178 void merge_structure(const Structure& structure);
00179
00185 Structure get_structure(guint idx) const;
00186
00187
00192 void remove_structure(guint idx);
00193
00197 guint size() const;
00198
00207 void set_simple(const Glib::ustring& name, const Glib::ValueBase& value);
00208
00218 template <class DataType>
00219 void set_simple(const Glib::ustring& name, const DataType& data);
00220
00221
00222
00223
00224
00228 bool is_any() const;
00229
00233 bool empty() const;
00234
00240 bool is_fixed() const;
00241
00250 bool equals(const Glib::RefPtr<Caps>& other_caps) const;
00251
00257 bool equals_fixed(const Glib::RefPtr<Caps>& other_caps) const;
00258
00265 bool is_always_compatible(const Glib::RefPtr<Caps>& other_caps) const;
00266
00273 bool is_subset(const Glib::RefPtr<Caps>& superset_caps) const;
00274
00275
00276
00282 Glib::RefPtr<Caps> get_intersect(const Glib::RefPtr<Caps>& other_caps) const;
00283
00284
00285
00291 Glib::RefPtr<Caps> get_union(const Glib::RefPtr<Caps>& other_caps) const;
00292
00293
00294
00300 Glib::RefPtr<Caps> get_normal() const;
00301
00302
00309 bool simplify();
00310
00311
00312
00317 xmlNodePtr save(xmlNodePtr parent) const;
00318
00323 static Glib::RefPtr<Caps> load(const xmlNodePtr parent);
00324
00325
00336 Glib::ustring to_string() const;
00337
00338
00345 Glib::RefPtr<Caps> get_difference(const Glib::RefPtr<const Caps>& subtrahend_caps) const;
00346
00350 Glib::RefPtr<Caps> make_writable();
00351
00355 void truncate();
00356
00357
00358 };
00359
00360 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00361
00362
00363
00364 template <class DataType>
00365 void Caps::set_simple(const Glib::ustring& name, const DataType& data)
00366 {
00367 typedef typename Gst::StructureValue<DataType> type_cppdata;
00368 typedef typename type_cppdata::ValueType ValueType;
00369
00370 ValueType value;
00371 value.init(ValueType::value_type());
00372 value.set(data);
00373 this->set_simple(name, (Glib::ValueBase)(value));
00374 }
00375
00376 #endif
00377
00378 }
00379
00380
00381 namespace Glib
00382 {
00383
00392 Glib::RefPtr<Gst::Caps> wrap(GstCaps* object, bool take_copy = false);
00393
00394 }
00395
00396
00397 #endif
00398