queue: move queue_size to common 09/62209/1 accepted/tizen/common/20160316.155658 accepted/tizen/ivi/20160315.120859 accepted/tizen/mobile/20160315.120807 accepted/tizen/tv/20160315.120821 accepted/tizen/wearable/20160315.120840 submit/tizen/20160315.024806
authorSangjin Lee <lsj119@samsung.com>
Tue, 15 Mar 2016 02:00:43 +0000 (11:00 +0900)
committerSangjin Lee <lsj119@samsung.com>
Tue, 15 Mar 2016 02:00:43 +0000 (11:00 +0900)
Change-Id: I447d3a5bc7b8b2a6fd540e1d54edce099d7a90ae

src/tbm_surface_queue.c
src/tbm_surface_queue.h

index 908f8fb..f78c289 100644 (file)
@@ -87,6 +87,7 @@ struct _tbm_surface_queue {
        int width;
        int height;
        int format;
+       int queue_size;
 
        queue free_queue;
        queue dirty_queue;
@@ -397,6 +398,7 @@ _tbm_surface_queue_release(tbm_surface_queue_h surface_queue,
 
 void
 _tbm_surface_queue_init(tbm_surface_queue_h surface_queue,
+                       int queue_size,
                        int width, int height, int format,
                        const tbm_surface_queue_interface *impl, void *data)
 {
@@ -409,6 +411,7 @@ _tbm_surface_queue_init(tbm_surface_queue_h surface_queue,
        pthread_cond_init(&surface_queue->free_cond, NULL);
        pthread_cond_init(&surface_queue->dirty_cond, NULL);
 
+       surface_queue->queue_size = queue_size;
        surface_queue->width = width;
        surface_queue->height = height;
        surface_queue->format = format;
@@ -625,6 +628,12 @@ tbm_surface_queue_get_format(tbm_surface_queue_h surface_queue)
        return surface_queue->format;
 }
 
+int
+tbm_surface_queue_get_size(tbm_surface_queue_h surface_queue)
+{
+       return surface_queue->queue_size;
+}
+
 tbm_surface_queue_error_e
 tbm_surface_queue_set_reset_cb(
        tbm_surface_queue_h surface_queue, tbm_surface_queue_notify_cb reset_cb,
@@ -1079,6 +1088,7 @@ tbm_surface_queue_create(int queue_size, int width,
        data->queue_size = queue_size;
        data->flags = flags;
        _tbm_surface_queue_init(surface_queue,
+                               data->queue_size,
                                width, height, format,
                                &tbm_queue_default_impl, data);
 
@@ -1210,6 +1220,7 @@ tbm_surface_queue_sequence_create(int queue_size, int width,
        data->queue_size = queue_size;
        data->flags = flags;
        _tbm_surface_queue_init(surface_queue,
+                               data->queue_size,
                                width, height, format,
                                &tbm_queue_sequence_impl, data);
 
index 5435fc4..812fa9a 100644 (file)
@@ -82,6 +82,8 @@ int tbm_surface_queue_get_height(tbm_surface_queue_h surface_queue);
 
 int tbm_surface_queue_get_format(tbm_surface_queue_h surface_queue);
 
+int tbm_surface_queue_get_size(tbm_surface_queue_h surface_queue);
+
 tbm_surface_queue_error_e tbm_surface_queue_reset(
                tbm_surface_queue_h surface_queue, int width, int height, int format);