tbm_fmt = g_array_index (formats, uint32_t, i);
g_value_set_string (&value, gst_wl_tbm_format_to_string (tbm_fmt));
gst_value_list_append_value (&list, &value);
- /* TBM doesn't support SN12. So we add SN12 manually as supported format.
- * SN12 is exactly same with NV12.
+ /* TBM doesn't support SN12 and ST12. So we add SN12 and ST12 manually as supported format.
+ * SN12 is same with NV12, ST12 is same with NV12MT
*/
if (tbm_fmt == TBM_FORMAT_NV12) {
g_value_set_string (&value,
gst_video_format_to_string (GST_VIDEO_FORMAT_SN12));
gst_value_list_append_value (&list, &value);
+ } else if (tbm_fmt == TBM_FORMAT_NV12MT) {
+ g_value_set_string (&value,
+ gst_video_format_to_string (GST_VIDEO_FORMAT_ST12));
+ gst_value_list_append_value (&list, &value);
}
} else { /* USE SHM */
fmt = g_array_index (formats, uint32_t, i);
gst_wl_window_render (sink->window, wlbuffer, info);
else {
if (G_UNLIKELY (info)) {
- gst_wl_window_set_video_info (sink->window, &info);
+ gst_wl_window_set_video_info (sink->window, info);
}
}
#else
g_mutex_lock (&sink->render_lock);
g_clear_object (&sink->window);
- GST_INFO ("wl_surface_id %d %p", (int) wl_surface_id,
+ GST_INFO ("wl_surface_id %d %x", (int) wl_surface_id,
(guintptr) wl_surface_id);
if (wl_surface_id) {
#include "wlshmallocator.h"
#include "wlbuffer.h"
+enum
+{
+ ROTATE_0_FLIP_NONE,
+ ROTATE_0_FLIP_HORIZONTAL,
+ ROTATE_0_FLIP_VERTICAL,
+ ROTATE_0_FLIP_BOTH,
+ ROTATE_90_FLIP_NONE = 10,
+ ROTATE_90_FLIP_HORIZONTAL,
+ ROTATE_90_FLIP_VERTICAL,
+ ROTATE_90_FLIP_BOTH,
+ ROTATE_180_FLIP_NONE = 20,
+ ROTATE_180_FLIP_HORIZONTAL,
+ ROTATE_180_FLIP_VERTICAL,
+ ROTATE_180_FLIP_BOTH,
+ ROTATE_270_FLIP_NONE = 30,
+ ROTATE_270_FLIP_HORIZONTAL,
+ ROTATE_270_FLIP_VERTICAL,
+ ROTATE_270_FLIP_BOTH,
+ ROTATE_NUM,
+};
+
GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
#define GST_CAT_DEFAULT gstwayland_debug
return (window->shell_surface != NULL);
}
+#ifdef GST_WLSINK_ENHANCEMENT
+static gint
+gst_wl_window_find_transform (guint rotate_angle, guint flip)
+{
+ gint transform;
+ guint combine = rotate_angle * 10 + flip;
+ FUNCTION;
+ GST_DEBUG ("rotate %d, flip %d, combine %d", rotate_angle, flip, combine);
+ switch (combine) {
+ case ROTATE_0_FLIP_NONE:
+ transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ case ROTATE_0_FLIP_HORIZONTAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED;
+ break;
+ case ROTATE_0_FLIP_VERTICAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_180;
+ break;
+ case ROTATE_0_FLIP_BOTH:
+ transform = WL_OUTPUT_TRANSFORM_180;
+ break;
+ case ROTATE_90_FLIP_NONE:
+ transform = WL_OUTPUT_TRANSFORM_90;
+ break;
+ case ROTATE_90_FLIP_HORIZONTAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_90;
+ break;
+ case ROTATE_90_FLIP_VERTICAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_270;
+ break;
+ case ROTATE_90_FLIP_BOTH:
+ transform = WL_OUTPUT_TRANSFORM_270;
+ break;
+ case ROTATE_180_FLIP_NONE:
+ transform = WL_OUTPUT_TRANSFORM_180;
+ break;
+ case ROTATE_180_FLIP_HORIZONTAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_180;
+ break;
+ case ROTATE_180_FLIP_VERTICAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED;
+ break;
+ case ROTATE_180_FLIP_BOTH:
+ transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ case ROTATE_270_FLIP_NONE:
+ transform = WL_OUTPUT_TRANSFORM_270;
+ break;
+ case ROTATE_270_FLIP_HORIZONTAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_270;
+ break;
+ case ROTATE_270_FLIP_VERTICAL:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_90;
+ break;
+ case ROTATE_270_FLIP_BOTH:
+ transform = WL_OUTPUT_TRANSFORM_90;
+ break;
+ }
+
+ return transform;
+}
+
+#endif
static void
gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
{
break;
}
- switch (window->rotate_angle) {
- case DEGREE_0:
- transform = WL_OUTPUT_TRANSFORM_NORMAL;
- break;
- case DEGREE_90:
- transform = WL_OUTPUT_TRANSFORM_90;
- break;
- case DEGREE_180:
- transform = WL_OUTPUT_TRANSFORM_180;
- break;
- case DEGREE_270:
- transform = WL_OUTPUT_TRANSFORM_270;
- break;
-
- default:
- GST_ERROR ("Unsupported rotation [%d]... set DEGREE 0.",
- window->rotate_angle);
- break;
- }
-
- switch (window->flip) {
- case FLIP_NONE:
- break;
- case FLIP_VERTICAL:
- transform = WL_OUTPUT_TRANSFORM_FLIPPED_180;
- break;
- case FLIP_HORIZONTAL:
- transform = WL_OUTPUT_TRANSFORM_FLIPPED;
- break;
- case FLIP_BOTH:
- transform = WL_OUTPUT_TRANSFORM_180;
- break;
- default:
- GST_ERROR ("Unsupported flip [%d]... set FLIP_NONE.", window->flip);
- }
+ transform = gst_wl_window_find_transform (window->rotate_angle, window->flip);
GST_INFO
("window[%d x %d] src[%d,%d,%d x %d],dst[%d,%d,%d x %d],input[%d,%d,%d x %d],result[%d,%d,%d x %d]",
#ifdef GST_WLSINK_ENHANCEMENT
void
-gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info)
+gst_wl_window_set_video_info (GstWlWindow * window, const GstVideoInfo * info)
{
FUNCTION;
g_return_if_fail (window != NULL);