summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-02-14 05:20:35 +0000
committerSung-jae Park <nicesj.park@samsung.com>2013-02-14 05:20:35 +0000
commit7723f35f7990eef391148b8f51d5019576379976 (patch)
tree95e890ef218070cfb777a682a093ee7a5f58a273
parent9115faef1f19db758c5595d2ee3f5d2d3f7bf90d (diff)
downloadlivebox-7723f35f7990eef391148b8f51d5019576379976.tar.gz
livebox-7723f35f7990eef391148b8f51d5019576379976.tar.bz2
livebox-7723f35f7990eef391148b8f51d5019576379976.zip
Clear the allocated buffer.
Only for the plugin type livebox. Change-Id: Ib3148f821bf6a0db7a246c95cc266b1e78eed4f9
-rw-r--r--packaging/liblivebox.spec2
-rw-r--r--src/livebox.c15
2 files changed, 14 insertions, 3 deletions
diff --git a/packaging/liblivebox.spec b/packaging/liblivebox.spec
index 4270930..685d274 100644
--- a/packaging/liblivebox.spec
+++ b/packaging/liblivebox.spec
@@ -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
diff --git a/src/livebox.c b/src/livebox.c
index 5c6f8d0..87e4aa1 100644
--- a/src/livebox.c
+++ b/src/livebox.c
@@ -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)