aboutsummaryrefslogtreecommitdiffstats
path: root/common/scripts/test_can_modules.sh
blob: 87b2a86be34f5cd5c6279ac1bd01b58b1aa0ef0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh

RCAR_CAN=0
CAN_BCM=0

if [ ! -e /sys/class/net/can1 ];then
	lava-test-case show_can_modules --result skip
	lava-test-case unload_can_raw_module --result skip
	lava-test-case unload_can_module --result skip
	lava-test-case unload_c_can_platform_module --result skip
	lava-test-case unload_c_can_module --result skipp
	lava-test-case unload_can_dev_module --result skip
	lava-test-case canconfig_can0 --result skip
	lava-test-case load_can_module --result skip
	lava-test-case load_can_raw_module --result skip
	lava-test-case load_c_can_module --result skip
	lava-test-case load_can_dev_module --result skip
	lava-test-case canconfig_can0 --result skip
        exit 0
fi

# remove module "$1"
remove_module() {
	lsmod | grep -q "^$1[[:space:]]"
	if [ $? -ne 0 ];then
		lava-test-case unload_$1_module --result skip
		return 0
	fi
	rmmod $1
	if [ $? -eq 0 ];then
		lava-test-case unload_$1_module --result pass
	else
		lava-test-case unload_$1_module --result fail
	fi
}

modprobe_module() {
	modprobe $1
	if [ $? -eq 0 ];then
		lava-test-case load_$1_module --result pass
	else
		lava-test-case load_$1_module --result fail
	fi
}

remove_module can_raw

# handle "rmmod: ERROR: Module can is in use by: can_bcm"
lsmod | grep -q can_bcm
if [ $? -eq 0 ];then
	CAN_BCM=1
	remove_module can_bcm
fi

remove_module can

remove_module c_can_platform

remove_module c_can

lsmod | grep -q rcar_can
if [ $? -eq 0 ];then
	RCAR_CAN=1
	remove_module rcar_can
fi

remove_module can_dev

ip -V 2>&1 | grep -q -i BusyBox
if [ $? -eq 0 ];then
	lava-test-case canconfig_can0 --result skip
else
	ip link set can0 type can bitrate 50000
	if [ $? -eq 0 ];then
		lava-test-case canconfig_can0 --result fail
	else
		lava-test-case canconfig_can0 --result pass
	fi
fi

modprobe_module can

modprobe_module can_raw

modprobe_module c_can

modprobe_module c_can_platform

modprobe_module can_dev

if [ $RCAR_CAN -eq 1 ];then
	modprobe_module rcar_can
fi

if [ $CAN_BCM -eq 1 ];then
	modprobe_module can_bcm
fi

#Make sure always that the can interface is down before
#starting the config step.
ip link set can0 down

ip -V 2>&1 | grep -q -i BusyBox
if [ $? -eq 0 ];then
	lava-test-case canconfig_can0 --result skip
else
	ip link set can0 type can bitrate 50000
	if [ $? -eq 0 ];then
		lava-test-case canconfig_can0 --result pass
	else
		lava-test-case canconfig_can0 --result fail
	fi
fi

sleep 3
ject * object, sink->display_name = g_value_dup_string (value); GST_OBJECT_UNLOCK (sink); break; + case PROP_APP_ID: + GST_OBJECT_LOCK (sink); + sink->app_id = g_value_dup_string (value); + GST_OBJECT_UNLOCK (sink); + break; + case PROP_TITLE: + GST_OBJECT_LOCK (sink); + sink->title = g_value_dup_string (value); + GST_OBJECT_UNLOCK (sink); + break; case PROP_FULLSCREEN: GST_OBJECT_LOCK (sink); gst_wayland_sink_set_fullscreen (sink, g_value_get_boolean (value)); @@ -331,12 +363,18 @@ gst_wayland_sink_finalize (GObject * object) gst_buffer_unref (sink->last_buffer); if (sink->display) g_object_unref (sink->display); + if (sink->title) + g_object_unref (sink->title); + if (sink->app_id) + g_object_unref (sink->app_id); if (sink->window) g_object_unref (sink->window); if (sink->pool) gst_object_unref (sink->pool); g_free (sink->display_name); + g_free (sink->title); + g_free (sink->app_id); g_mutex_clear (&sink->display_lock); g_mutex_clear (&sink->render_lock); @@ -768,7 +806,8 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer) if (!sink->window) { /* if we were not provided a window, create one ourselves */ sink->window = gst_wl_window_new_toplevel (sink->display, - &sink->video_info, sink->fullscreen, &sink->render_lock); + &sink->video_info, sink->fullscreen, sink->app_id, sink->title, + &sink->render_lock); g_signal_connect_object (sink->window, "closed", G_CALLBACK (on_window_closed), sink, 0); } diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h index 46ea538..e6c94ae 100644 --- a/ext/wayland/gstwaylandsink.h +++ b/ext/wayland/gstwaylandsink.h @@ -64,6 +64,8 @@ struct _GstWaylandSink gboolean fullscreen; gchar *display_name; + gchar *app_id; + gchar *title; gboolean redraw_pending; GMutex render_lock; diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index 3aace87..16faec8 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -255,7 +255,7 @@ gst_wl_window_ensure_fullscreen (GstWlWindow * window, gboolean fullscreen) GstWlWindow * gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info, - gboolean fullscreen, GMutex * render_lock) + gboolean fullscreen, gchar *app_id, gchar *title, GMutex * render_lock) { GstWlWindow *window; @@ -288,6 +288,14 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info, /* Finally, commit the xdg_surface state as toplevel */ window->configured = FALSE; + if (app_id) + xdg_toplevel_set_app_id (window->xdg_toplevel, app_id); + else + xdg_toplevel_set_app_id (window->xdg_toplevel, "ext.wayland.waylandsink"); + if (title) + xdg_toplevel_set_title (window->xdg_toplevel, title); + else + xdg_toplevel_set_title (window->xdg_toplevel, "ext.wayland.waylandsink"); wl_surface_commit (window->area_surface); wl_display_flush (display->display); diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h index 034a5a5..6b525c8 100644 --- a/ext/wayland/wlwindow.h +++ b/ext/wayland/wlwindow.h @@ -84,7 +84,7 @@ GType gst_wl_window_get_type (void); void gst_wl_window_ensure_fullscreen (GstWlWindow * window, gboolean fullscreen); GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display, - const GstVideoInfo * info, gboolean fullscreen, GMutex * render_lock); + const GstVideoInfo * info, gboolean fullscreen, gchar * app_id, gchar *title, GMutex * render_lock); GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display, struct wl_surface * parent, GMutex * render_lock); -- 2.35.1