static void gst_wayland_sink_end_geometry_change (GstWaylandVideo * video);
#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT
static gboolean gst_wayland_sink_event (GstBaseSink * bsink, GstEvent * event);
+static void gst_wayland_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
+ GstClockTime * start, GstClockTime * end);
static void gst_wayland_sink_update_window_geometry (GstWaylandSink * sink);
static void render_last_buffer (GstWaylandSink * sink);
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_wayland_sink_render);
#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_wayland_sink_event);
+ gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_wayland_sink_get_times);
#endif
g_object_class_install_property (gobject_class, PROP_DISPLAY,
}
return GST_BASE_SINK_CLASS (parent_class)->event (bsink, event);
}
+
+static void
+gst_wayland_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
+ GstClockTime * start, GstClockTime * end)
+{
+ /* If basesink need to drop buffer, basesink ask waylandsink to start and end */
+ GstWaylandSink *sink;
+
+ sink = GST_WAYLAND_SINK (bsink);
+
+ if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
+ *start = GST_BUFFER_TIMESTAMP (buf);
+ if (GST_BUFFER_DURATION_IS_VALID (buf)) {
+ *end = *start + GST_BUFFER_DURATION (buf);
+ } else {
+ if (sink->fps_n > 0) {
+ *end =
+ *start + gst_util_uint64_scale_int (GST_SECOND, sink->fps_d,
+ sink->fps_n);
+ }
+ }
+ }
+}
#endif
/* must be called with the display_lock */
}
}
#else /* open source */
-
formats = sink->display->formats;
for (i = 0; i < formats->len; i++) {
if (g_array_index (formats, uint32_t, i) == format)
goto unsupported_format;
#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT
+ /* init frame rate for baseink */
+ sink->fps_n = info.fps_n;
+ sink->fps_d = info.fps_d;
+
/* init value for set source */
sink->crop_x = sink->crop_y = sink->crop_w = sink->crop_h = 0;
gst_object_replace ((GstObject **) & sink->pool, (GstObject *) newpool);
gst_object_unref (newpool);
}
-#ifdef TIZEN_FEATURE_WLSINK_ENHANCEMENT
+
sink->is_native_format = sink->display->is_native_format;
if (sink->window)
gst_wayland_sink_update_window_geometry (sink);
-#endif
+
#else /*open source */
/* create a new pool for the new configuration */
self->display->tbm_bo[idx] =
tbm_bo_alloc (self->display->tbm_bufmgr, size, TBM_BO_DEFAULT);
- if (!self->display->tbm_bo[idx]) {
+ if (G_UNLIKELY (!self->display->tbm_bo[idx])) {
GST_ERROR_OBJECT (self, "alloc tbm bo(size:%d) failed: %s", size,
strerror (errno));
return FALSE;
virtual_addr.ptr = NULL;
virtual_addr =
tbm_bo_get_handle (self->display->tbm_bo[idx], TBM_DEVICE_CPU);
- if (!virtual_addr.ptr) {
+ if (G_UNLIKELY (!virtual_addr.ptr)) {
GST_ERROR_OBJECT (self, "get tbm bo handle failed: %s", strerror (errno));
tbm_bo_unref (self->display->tbm_bo[idx]);
self->display->tbm_bo[idx] = NULL;