Adding GstBuffer managing functions 62/5862/1
authorJosé Bollo <jose.bollo@eurogiciel.fr>
Wed, 17 Jul 2013 12:16:40 +0000 (14:16 +0200)
committerJosé Bollo <jose.bollo@eurogiciel.fr>
Wed, 17 Jul 2013 12:16:40 +0000 (14:16 +0200)
Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h

index deeb339..a51f72a 100755 (executable)
@@ -166,5 +166,23 @@ template <> void derefGPtr<GstElementFactory>(GstElementFactory* ptr)
         gst_object_unref(ptr);
 }
 
+template<> GRefPtr<GstBuffer> adoptGRef(GstBuffer* ptr)
+{
+    return GRefPtr<GstBuffer>(ptr, GRefPtrAdopt);
+}
+
+template<> GstBuffer* refGPtr<GstBuffer>(GstBuffer* ptr)
+{
+    if (ptr)
+        gst_buffer_ref(ptr);
+
+    return ptr;
+}
+
+template<> void derefGPtr<GstBuffer>(GstBuffer* ptr)
+{
+    if (ptr)
+        gst_buffer_unref(ptr);
+}
 }
 #endif // USE(GSTREAMER)
index 5b0ed0d..002879f 100755 (executable)
@@ -30,6 +30,7 @@ typedef struct _GstCaps GstCaps;
 typedef struct _GstTask GstTask;
 typedef struct _GstBus GstBus;
 typedef struct _GstElementFactory GstElementFactory;
+typedef struct _GstBuffer GstBuffer;
 
 namespace WTF {
 
@@ -61,6 +62,9 @@ template<> GRefPtr<GstElementFactory> adoptGRef(GstElementFactory* ptr);
 template<> GstElementFactory* refGPtr<GstElementFactory>(GstElementFactory* ptr);
 template<> void derefGPtr<GstElementFactory>(GstElementFactory* ptr);
 
+template<> GRefPtr<GstBuffer> adoptGRef(GstBuffer* ptr);
+template<> GstBuffer* refGPtr<GstBuffer>(GstBuffer* ptr);
+template<> void derefGPtr<GstBuffer>(GstBuffer* ptr);
 }
 
 #endif // USE(GSTREAMER)