[gstreamermm: 152/167] added memcmp method to buffer



commit 353d4fce99f185570e54ebd79293a7a46be56ed9
Author: Marcin Kolny at Flytronic.pl <marcin kolny flytronic pl>
Date:   Mon Aug 12 13:02:34 2013 +0200

    added memcmp method to buffer

 gstreamer/src/buffer.hg              |    2 ++
 tests/plugins/test-plugin-appsink.cc |    1 +
 tests/plugins/test-plugin-appsrc.cc  |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gstreamer/src/buffer.hg b/gstreamer/src/buffer.hg
index 101079c..b3b9bd6 100644
--- a/gstreamer/src/buffer.hg
+++ b/gstreamer/src/buffer.hg
@@ -79,6 +79,8 @@ public:
 
   _WRAP_METHOD(Glib::RefPtr<Gst::Memory> get_all_memory() const, gst_buffer_get_all_memory)
 
+  _WRAP_METHOD(int memcmp(gsize offset, gconstpointer mem, gsize size), gst_buffer_memcmp);
+
   _MEMBER_GET(pts, pts, ClockTime, GstClockTime)
   _MEMBER_GET(dts, dts, ClockTime, GstClockTime)
 
diff --git a/tests/plugins/test-plugin-appsink.cc b/tests/plugins/test-plugin-appsink.cc
index 8a21db1..44463e9 100644
--- a/tests/plugins/test-plugin-appsink.cc
+++ b/tests/plugins/test-plugin-appsink.cc
@@ -64,6 +64,7 @@ TEST_F(AppSinkPluginTest, UseAppSinkDuringDataFlowInPipeline)
     buf_out = sample->get_buffer();
     ASSERT_TRUE(buf_out);
 
+    ASSERT_TRUE(buf_out->memcmp(0, data.c_str(), data.length()) == 0);
     buf_out->map(map_info, MAP_READ);
     assert(std::string((char *)map_info->get_data()) == data);
     buf_out->unmap(map_info);
diff --git a/tests/plugins/test-plugin-appsrc.cc b/tests/plugins/test-plugin-appsrc.cc
index 3217a9f..324c80b 100644
--- a/tests/plugins/test-plugin-appsrc.cc
+++ b/tests/plugins/test-plugin-appsrc.cc
@@ -59,7 +59,7 @@ TEST_F(AppSrcPluginTest, SimpleDataFlowInPipelineWitAppSrcElement)
     std::string data = "hello world";
     RefPtr<Buffer> buf = Buffer::create(data.length() + 1);
     RefPtr<MapInfo> mapinfo(new Gst::MapInfo());
-    buf->map(mapinfo, Gst::MapFlags());
+    buf->map(mapinfo, MAP_WRITE);
     strcpy((char *)mapinfo->get_data(), data.c_str());
 
     RefPtr<AppSrc> appsrc;


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