Clear the allocated buffer.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 14 Feb 2013 05:20:35 +0000 (05:20 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 14 Feb 2013 05:20:35 +0000 (05:20 +0000)
Only for the plugin type livebox.

Change-Id: Ib3148f821bf6a0db7a246c95cc266b1e78eed4f9

packaging/liblivebox.spec
src/livebox.c

index 4270930..685d274 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox
 Summary: Library for the development of a livebox 
-Version: 0.1.13
+Version: 0.1.14
 Release: 1
 Group: main/app
 License: Flora License
index 5c6f8d0..87e4aa1 100644 (file)
@@ -526,11 +526,22 @@ EAPI int livebox_release_buffer(struct livebox_buffer *handle)
 
 EAPI void *livebox_ref_buffer(struct livebox_buffer *handle)
 {
+       void *data;
+       int w, h, size;
+       int ret;
        if (!handle)
                return -EINVAL;
 
-       DbgPrint("Ref buffer\n");
-       return provider_buffer_ref(handle);
+       ret = provider_buffer_get_size(handle, &w, &h, &size);
+
+       data = provider_buffer_ref(handle);
+       if (data && !ret && w > 0 && h > 0 && size > 0) {
+               memset(data, 0, w * h * size);
+               provider_buffer_sync(handle);
+       }
+
+       DbgPrint("Ref buffer %ds%d(%d)\n", w, h, size);
+       return data;
 }
 
 EAPI int livebox_unref_buffer(void *buffer)