4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sangchul Lee <sc11.lee@samsung.com>
8 * This library is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; either version 2.1 of the License, or (at your option)
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 * License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef __GST_EVASIMAGESINK_H__
25 #define __GST_EVASIMAGESINK_H__
27 //#define USE_NATIVE_BUFFER
31 #include <gst/video/gstvideosink.h>
34 #ifdef USE_NATIVE_BUFFER
35 #include <native-buffer.h>
36 #include <tbm_bufmgr.h>
40 /* #defines don't like whitespacey bits */
41 #define GST_TYPE_EVASIMAGESINK \
42 (gst_evas_image_sink_get_type())
43 #define GST_EVASIMAGESINK(obj) \
44 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_EVASIMAGESINK,GstEvasImageSink))
45 #define GST_EVASIMAGESINK_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_EVASIMAGESINK,GstEvasImageSinkClass))
47 #define GST_IS_EVASIMAGESINK(obj) \
48 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_EVASIMAGESINK))
49 #define GST_IS_EVASIMAGESINK_CLASS(klass) \
50 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_EVASIMAGESINK))
52 typedef struct _GstEvasImageSink GstEvasImageSink;
53 typedef struct _GstEvasImageSinkClass GstEvasImageSinkClass;
54 #ifdef USE_NATIVE_BUFFER
55 typedef struct _GstEvasImageDisplayingBuffer GstEvasImageDisplayingBuffer;
56 typedef struct _GstEvasImageFlushBuffer GstEvasImageFlushBuffer;
58 BUF_SHARE_METHOD_NONE = -1,
59 BUF_SHARE_METHOD_PADDR = 0,
61 BUF_SHARE_METHOD_TIZEN_BUFFER,
62 BUF_SHARE_METHOD_FLUSH_BUFFER
74 DISP_GEO_METHOD_LETTER_BOX = 0,
75 DISP_GEO_METHOD_ORIGIN_SIZE,
76 DISP_GEO_METHOD_FULL_SCREEN,
77 DISP_GEO_METHOD_CROPPED_FULL_SCREEN,
78 DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX,
79 DISP_GEO_METHOD_CUSTOM_DST_ROI,
95 native_buffer_t *n_buffer;
96 native_buffer_provider_t *n_provider;
99 /* _GstEvasDisplayingBuffer
101 * buffer : manage ref count by got index through comparison
102 * bo : compare with buffer from codec for getting index
103 * n_buffer : compare with buffer from evas for getting index
104 * ref_count : decide whether it unref buffer or not in gst_evas_image_sink_fini/reset
106 struct _GstEvasImageDisplayingBuffer {
109 native_buffer_t *n_buffer;
113 struct _GstEvasImageFlushBuffer {
115 native_buffer_t *n_buffer;
116 native_buffer_provider_t *n_provider;
118 #define NATIVE_BUFFER_NUM 20
119 #define SOURCE_BUFFER_NUM 8
121 struct _GstEvasImageSink
123 GstVideoSink element;
129 gboolean object_show;
130 gchar update_visibility;
131 gboolean gl_zerocopy;
135 gboolean is_evas_object_size_set;
136 guint present_data_addr;
137 #ifdef USE_NATIVE_BUFFER
138 GMutex *display_buffer_lock;
140 GstEvasImageDisplayingBuffer displaying_buffer[NATIVE_BUFFER_NUM];
141 GstVideoRectangle eo_size;
144 guint display_geometry_method;
146 native_buffer_provider_t *n_provider;
151 gboolean enable_flush_buffer;
152 GstEvasImageFlushBuffer *flush_buffer;
153 gint sent_buffer_cnt;
154 gint debuglog_cnt_showFrame;
155 gint debuglog_cnt_ecoreCbPipe;
157 native_buffer_format_t native_buffer_format;
158 struct buffer_info src_buffer_info[NATIVE_BUFFER_NUM];
160 gboolean is_buffer_allocated;
164 struct _GstEvasImageSinkClass
166 GstVideoSinkClass parent_class;
169 GType gst_evas_image_sink_get_type (void);
173 #endif /* __GST_EVASIMAGESINK_H__ */