[gstreamermm] Gst::Context: wrapped GstContext struct



commit e2bd8dd0d5c2fc8ffab3135461093ae03f864c6d
Author: Marcin Kolny <marcin kolny flytronic pl>
Date:   Tue Oct 14 17:10:19 2014 +0200

    Gst::Context: wrapped GstContext struct
    
        * .gitignore: added generated files to ignored list.
        * MSVC_2010/gstreamermm/gstreamermm.vcxproj:
        * MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters: added context
          files to a msvc project.
        * gstreamer/gstreamermm.h: added context header to a common include
          file.
        * gstreamer/src/context.ccg:
        * gstreamer/src/context.hg: added wrappers for GstContext structure.
        * gstreamer/src/filelist.am: added context wrapper to build file list.
        * tools/m4/convert_gst.m4: a few conversions between GstContext and
          Gst::Context added.

 .gitignore                                        |    2 +
 MSVC_2010/gstreamermm/gstreamermm.vcxproj         |    2 +
 MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters |    6 +++
 gstreamer/gstreamermm.h                           |    1 +
 gstreamer/src/context.ccg                         |   27 ++++++++++++
 gstreamer/src/context.hg                          |   48 +++++++++++++++++++++
 gstreamer/src/filelist.am                         |    1 +
 tools/m4/convert_gst.m4                           |    5 ++
 8 files changed, 92 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7c2c8eb..b9c09b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,6 +86,8 @@ gstreamer/gstreamermm/colorbalance.cc
 gstreamer/gstreamermm/colorbalance.h
 gstreamer/gstreamermm/colorbalancechannel.cc
 gstreamer/gstreamermm/colorbalancechannel.h
+gstreamer/gstreamermm/context.cc
+gstreamer/gstreamermm/context.h
 gstreamer/gstreamermm/discoverer.cc
 gstreamer/gstreamermm/discoverer.h
 gstreamer/gstreamermm/discovererinfo.cc
diff --git a/MSVC_2010/gstreamermm/gstreamermm.vcxproj b/MSVC_2010/gstreamermm/gstreamermm.vcxproj
index f2b165b..0e88b74 100644
--- a/MSVC_2010/gstreamermm/gstreamermm.vcxproj
+++ b/MSVC_2010/gstreamermm/gstreamermm.vcxproj
@@ -55,6 +55,7 @@
     <ClInclude Include="..\..\gstreamer\gstreamermm\clockoverlay.h" />
     <ClInclude Include="..\..\gstreamer\gstreamermm\colorbalance.h" />
     <ClInclude Include="..\..\gstreamer\gstreamermm\colorbalancechannel.h" />
+    <ClInclude Include="..\..\gstreamer\gstreamermm\context.h" />
     <ClInclude Include="..\..\gstreamer\gstreamermm\decodebin.h" />
     <ClInclude Include="..\..\gstreamer\gstreamermm\discoverer.h" />
     <ClInclude Include="..\..\gstreamer\gstreamermm\discovererinfo.h" />
@@ -184,6 +185,7 @@
     <ClCompile Include="..\..\gstreamer\gstreamermm\clockoverlay.cc" />
     <ClCompile Include="..\..\gstreamer\gstreamermm\colorbalance.cc" />
     <ClCompile Include="..\..\gstreamer\gstreamermm\colorbalancechannel.cc" />
+    <ClCompile Include="..\..\gstreamer\gstreamermm\context.cc" />
     <ClCompile Include="..\..\gstreamer\gstreamermm\decodebin.cc" />
     <ClCompile Include="..\..\gstreamer\gstreamermm\discoverer.cc" />
     <ClCompile Include="..\..\gstreamer\gstreamermm\discovererinfo.cc" />
diff --git a/MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters 
b/MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters
index 29bf7e5..93cb30c 100644
--- a/MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters
+++ b/MSVC_2010/gstreamermm/gstreamermm.vcxproj.filters
@@ -117,6 +117,9 @@
     <ClInclude Include="..\..\gstreamer\gstreamermm\colorbalancechannel.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\gstreamer\gstreamermm\context.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\gstreamer\gstreamermm\decodebin.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -503,6 +506,9 @@
     <ClCompile Include="..\..\gstreamer\gstreamermm\colorbalancechannel.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\gstreamer\gstreamermm\context.cc">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\gstreamer\gstreamermm\decodebin.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/gstreamer/gstreamermm.h b/gstreamer/gstreamermm.h
index 7239c8b..84b3b71 100644
--- a/gstreamer/gstreamermm.h
+++ b/gstreamer/gstreamermm.h
@@ -73,6 +73,7 @@
 #include <gstreamermm/caps.h>
 #include <gstreamermm/childproxy.h>
 #include <gstreamermm/clock.h>
+#include <gstreamermm/context.h>
 #include <gstreamermm/element.h>
 #include <gstreamermm/elementfactory.h>
 #include <gstreamermm/enums.h>
diff --git a/gstreamer/src/context.ccg b/gstreamer/src/context.ccg
new file mode 100644
index 0000000..f152c8b
--- /dev/null
+++ b/gstreamer/src/context.ccg
@@ -0,0 +1,27 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2014 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+namespace Gst {
+
+Glib::RefPtr<Context> Context::create(const Glib::ustring& context_type, bool persistent)
+{
+  return Glib::RefPtr<Context>(reinterpret_cast<Context*>(gst_context_new(context_type.c_str(), 
persistent)));
+}
+
+}
\ No newline at end of file
diff --git a/gstreamer/src/context.hg b/gstreamer/src/context.hg
new file mode 100644
index 0000000..e9f2577
--- /dev/null
+++ b/gstreamer/src/context.hg
@@ -0,0 +1,48 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2014 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+ 
+#include <gst/gst.h>
+#include <gstreamermm/miniobject.h>
+#include <gstreamermm/structure.h>
+ 
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+class Context : public MiniObject
+{
+  _CLASS_OPAQUE_REFCOUNTED(Context, GstContext, NONE, gst_context_ref, gst_context_unref)
+
+  _IGNORE(gst_context_new, gst_context_ref, gst_context_unref)
+
+public:
+  static Glib::RefPtr<Context> create(const Glib::ustring& context_type, bool persistent);
+
+  _WRAP_METHOD(Glib::RefPtr<Gst::Context> copy(), gst_context_copy)
+  _WRAP_METHOD(Glib::RefPtr<Gst::Context> copy() const, gst_context_copy, constversion)
+
+  _WRAP_METHOD(Glib::ustring get_context_type() const, gst_context_get_context_type)
+
+  _WRAP_METHOD(bool has_context_type(const Glib::ustring& context_type) const, gst_context_has_context_type)
+
+  _WRAP_METHOD(bool is_persistent() const, gst_context_is_persistent)
+
+  _WRAP_METHOD(Gst::Structure writable_structure() const, gst_context_writable_structure)
+};
+}
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 549a0e7..471fdc2 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -105,6 +105,7 @@ files_hg  =                     \
         caps.hg                 \
         childproxy.hg           \
         clock.hg                \
+        context.hg              \
         colorbalance.hg         \
         colorbalancechannel.hg  \
         discoverer.hg           \
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 531502d..14c9cca 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -108,6 +108,10 @@ dnl ColorBalanceChannel
 _CONVERSION(`const Glib::RefPtr<ColorBalanceChannel>&',`GstColorBalanceChannel*',`Glib::unwrap($3)')
 _CONVERSION(`const Glib::RefPtr<const 
ColorBalanceChannel>&',`GstColorBalanceChannel*',`const_cast<GstColorBalanceChannel*>(Glib::unwrap($3))')
 
+dnl Context
+_CONVERSION(`GstContext*',`Glib::RefPtr<Gst::Context>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Gst::Context>&',`GstContext*',`$3->gobj()')
+
 dnl DiscovererInfo
 _CONVERSION(`GstDiscovererInfo*',`Glib::RefPtr<DiscovererInfo>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<DiscovererInfo>&',`GstDiscovererInfo*',`Glib::unwrap($3)')
@@ -236,6 +240,7 @@ _CONVERSION(`Gst::AudioRingBufferSpec&', `GstAudioRingBufferSpec*', `$3.gobj()')
 dnl Structure
 _CONVERSION(`Gst::Structure&',`GstStructure*',`$3.gobj()')
 _CONVERSION(`const Gst::Structure&',`GstStructure*',`const_cast<GstStructure*>($3.gobj())') 
+_CONVERSION(`GstStructure*', `Gst::Structure', `Glib::wrap($3)')
 
 dnl TagList
 _CONVERSION(`const Gst::TagList&',`const GstTagList*',`$3.gobj()')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]