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_TBM_SURFACE
31 #include <gst/video/gstvideosink.h>
34 #ifdef USE_TBM_SURFACE
35 #include <tbm_surface.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_TBM_SURFACE
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 tbm_surface_h tbm_surf;
98 /* _GstEvasDisplayingBuffer
100 * buffer : manage ref count by got index through comparison
101 * bo : compare with buffer from codec for getting index
102 * n_buffer : compare with buffer from evas for getting index
103 * ref_count : decide whether it unref buffer or not in gst_evas_image_sink_fini/reset
105 struct _GstEvasImageDisplayingBuffer {
108 tbm_surface_h tbm_surf;
112 struct _GstEvasImageFlushBuffer {
114 tbm_surface_h tbm_surf;
116 #define NATIVE_BUFFER_NUM 20
117 #define SOURCE_BUFFER_NUM 8
119 struct _GstEvasImageSink
121 GstVideoSink element;
127 gboolean object_show;
128 gchar update_visibility;
129 gboolean gl_zerocopy;
133 gboolean is_evas_object_size_set;
134 guint present_data_addr;
135 #ifdef USE_TBM_SURFACE
136 GMutex *display_buffer_lock;
138 GstEvasImageDisplayingBuffer displaying_buffer[NATIVE_BUFFER_NUM];
139 GstVideoRectangle eo_size;
142 guint display_geometry_method;
148 gboolean enable_flush_buffer;
149 GstEvasImageFlushBuffer *flush_buffer;
150 gint sent_buffer_cnt;
151 gint debuglog_cnt_showFrame;
152 gint debuglog_cnt_ecoreCbPipe;
154 tbm_format tbm_surface_format;
155 struct buffer_info src_buffer_info[NATIVE_BUFFER_NUM];
157 gboolean is_buffer_allocated;
161 struct _GstEvasImageSinkClass
163 GstVideoSinkClass parent_class;
166 GType gst_evas_image_sink_get_type (void);
170 #endif /* __GST_EVASIMAGESINK_H__ */