caps.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GSTREAMERMM_CAPS_H
00004 #define _GSTREAMERMM_CAPS_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00010 
00011 /* gstreamermm - a C++ wrapper for gstreamer
00012  *
00013  * Copyright 2008 The gstreamermm Development Team
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free
00027  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00073 
00074   static Glib::RefPtr<Caps> create();
00075 
00076   // For use with Glib::RefPtr<> only.
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   // Do not derive this.  Gst::Caps can neither be constructed nor deleted.
00091   Caps();
00092   void operator delete(void*, size_t);
00093 
00094 private:
00095   // noncopyable
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   //This does not seem useful: _WRAP_METHOD(void set_simple_valist(char* field, const va_list& varargs), gst_caps_set_simple_valist)
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   //This is const (returns a non const) because it always creates a new instance:
00276   
00282   Glib::RefPtr<Caps> get_intersect(const Glib::RefPtr<Caps>& other_caps) const;
00283 
00284   //This is const (returns a non const) because it always creates a new instance:
00285   
00291   Glib::RefPtr<Caps> get_union(const Glib::RefPtr<Caps>& other_caps) const;
00292 
00293   //This is const (returns a non const) because it always creates a new instance:
00294   
00300   Glib::RefPtr<Caps> get_normal() const;
00301 
00302   
00309   bool simplify();
00310 
00311   //TODO: Add overloads (and dependency) for libxml++?
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 /******************************* Gst::Caps *******************************/
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00377 
00378 } //namespace Gst
00379 
00380 
00381 namespace Glib
00382 {
00383 
00392   Glib::RefPtr<Gst::Caps> wrap(GstCaps* object, bool take_copy = false);
00393 
00394 } // namespace Glib
00395 
00396 
00397 #endif /* _GSTREAMERMM_CAPS_H */
00398 

Generated on Sun Jul 27 17:07:20 2008 for gstreamermm by  doxygen 1.5.4