diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-02-11 12:53:20 -0800 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.ro> | 2016-03-10 14:54:43 +0100 |
commit | 27445a1e4cd2dfa71b261877c9fe6beabadc041c (patch) | |
tree | ddc8b60e9d183573f6961965a6b9df1d5fdf034c | |
parent | 06709d784da5503ec3c735115e96a6a74e3277fa (diff) | |
download | meta-raspberrypi-27445a1e4cd2dfa71b261877c9fe6beabadc041c.tar.gz |
gstreamer1.0-omx: Add raspberry pi optimization patches and config options
Patches from Hong Li <honglh@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 files changed, 218 insertions, 0 deletions
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-config-files-path.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-config-files-path.patch new file mode 100644 index 0000000..a7da922 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-config-files-path.patch | |||
@@ -0,0 +1,137 @@ | |||
1 | --- a/config/bellagio/gstomx.conf | ||
2 | +++ b/config/bellagio/gstomx.conf | ||
3 | @@ -1,6 +1,6 @@ | ||
4 | [omxmpeg4videodec] | ||
5 | type-name=GstOMXMPEG4VideoDec | ||
6 | -core-name=/usr/local/lib/libomxil-bellagio.so.0 | ||
7 | +core-name=/usr/lib/libomxil-bellagio.so.0 | ||
8 | component-name=OMX.st.video_decoder.mpeg4 | ||
9 | rank=256 | ||
10 | in-port-index=0 | ||
11 | @@ -9,7 +9,7 @@ | ||
12 | |||
13 | [omxh264dec] | ||
14 | type-name=GstOMXH264Dec | ||
15 | -core-name=/usr/local/lib/libomxil-bellagio.so.0 | ||
16 | +core-name=/usr/lib/libomxil-bellagio.so.0 | ||
17 | component-name=OMX.st.video_decoder.avc | ||
18 | rank=256 | ||
19 | in-port-index=0 | ||
20 | @@ -18,7 +18,7 @@ | ||
21 | |||
22 | [omxmpeg4videoenc] | ||
23 | type-name=GstOMXMPEG4VideoEnc | ||
24 | -core-name=/usr/local/lib/libomxil-bellagio.so.0 | ||
25 | +core-name=/usr/lib/libomxil-bellagio.so.0 | ||
26 | component-name=OMX.st.video_encoder.mpeg4 | ||
27 | rank=0 | ||
28 | in-port-index=0 | ||
29 | @@ -27,7 +27,7 @@ | ||
30 | |||
31 | [omxaacenc] | ||
32 | type-name=GstOMXAACEnc | ||
33 | -core-name=/usr/local/lib/libomxil-bellagio.so.0 | ||
34 | +core-name=/usr/lib/libomxil-bellagio.so.0 | ||
35 | component-name=OMX.st.audio_encoder.aac | ||
36 | rank=0 | ||
37 | in-port-index=0 | ||
38 | --- a/config/rpi/gstomx.conf | ||
39 | +++ b/config/rpi/gstomx.conf | ||
40 | @@ -1,6 +1,6 @@ | ||
41 | [omxmpeg2videodec] | ||
42 | type-name=GstOMXMPEG2VideoDec | ||
43 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
44 | +core-name=/usr/lib/libopenmaxil.so | ||
45 | component-name=OMX.broadcom.video_decode | ||
46 | rank=257 | ||
47 | in-port-index=130 | ||
48 | @@ -9,7 +9,7 @@ | ||
49 | |||
50 | [omxmpeg4videodec] | ||
51 | type-name=GstOMXMPEG4VideoDec | ||
52 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
53 | +core-name=/usr/lib/libopenmaxil.so | ||
54 | component-name=OMX.broadcom.video_decode | ||
55 | rank=257 | ||
56 | in-port-index=130 | ||
57 | @@ -18,7 +18,7 @@ | ||
58 | |||
59 | [omxh263dec] | ||
60 | type-name=GstOMXH263Dec | ||
61 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
62 | +core-name=/usr/lib/libopenmaxil.so | ||
63 | component-name=OMX.broadcom.video_decode | ||
64 | rank=257 | ||
65 | in-port-index=130 | ||
66 | @@ -27,7 +27,7 @@ | ||
67 | |||
68 | [omxh264dec] | ||
69 | type-name=GstOMXH264Dec | ||
70 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
71 | +core-name=/usr/lib/libopenmaxil.so | ||
72 | component-name=OMX.broadcom.video_decode | ||
73 | rank=257 | ||
74 | in-port-index=130 | ||
75 | @@ -36,7 +36,7 @@ | ||
76 | |||
77 | [omxtheoradec] | ||
78 | type-name=GstOMXTheoraDec | ||
79 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
80 | +core-name=/usr/lib/libopenmaxil.so | ||
81 | component-name=OMX.broadcom.video_decode | ||
82 | rank=257 | ||
83 | in-port-index=130 | ||
84 | @@ -45,7 +45,7 @@ | ||
85 | |||
86 | [omxvp8dec] | ||
87 | type-name=GstOMXVP8Dec | ||
88 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
89 | +core-name=/usr/lib/libopenmaxil.so | ||
90 | component-name=OMX.broadcom.video_decode | ||
91 | rank=257 | ||
92 | in-port-index=130 | ||
93 | @@ -54,7 +54,7 @@ | ||
94 | |||
95 | [omxmjpegdec] | ||
96 | type-name=GstOMXMJPEGDec | ||
97 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
98 | +core-name=/usr/lib/libopenmaxil.so | ||
99 | component-name=OMX.broadcom.video_decode | ||
100 | rank=257 | ||
101 | in-port-index=130 | ||
102 | @@ -63,7 +63,7 @@ | ||
103 | |||
104 | [omxvc1dec] | ||
105 | type-name=GstOMXWMVDec | ||
106 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
107 | +core-name=/usr/lib/libopenmaxil.so | ||
108 | component-name=OMX.broadcom.video_decode | ||
109 | rank=256 | ||
110 | in-port-index=130 | ||
111 | @@ -73,7 +73,7 @@ | ||
112 | |||
113 | [omxh264enc] | ||
114 | type-name=GstOMXH264Enc | ||
115 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
116 | +core-name=/usr/lib/libopenmaxil.so | ||
117 | component-name=OMX.broadcom.video_encode | ||
118 | rank=257 | ||
119 | in-port-index=200 | ||
120 | @@ -82,7 +82,7 @@ | ||
121 | |||
122 | [omxanalogaudiosink] | ||
123 | type-name=GstOMXAnalogAudioSink | ||
124 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
125 | +core-name=/usr/lib/libopenmaxil.so | ||
126 | component-name=OMX.broadcom.audio_render | ||
127 | rank=256 | ||
128 | in-port-index=100 | ||
129 | @@ -92,7 +92,7 @@ | ||
130 | |||
131 | [omxhdmiaudiosink] | ||
132 | type-name=GstOMXHdmiAudioSink | ||
133 | -core-name=/opt/vc/lib/libopenmaxil.so | ||
134 | +core-name=/usr/lib/libopenmaxil.so | ||
135 | component-name=OMX.broadcom.audio_render | ||
136 | rank=257 | ||
137 | in-port-index=100 | ||
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch new file mode 100644 index 0000000..aef21a5 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 2e111e52f96f0b942abda120c30a876629bd73fc Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com> | ||
3 | Date: Mon, 25 May 2015 14:53:35 +0200 | ||
4 | Subject: [PATCH] Don't try to acquire buffer when src pad isn't active | ||
5 | |||
6 | This solves a race condition when setting the pipeline from PAUSE to | ||
7 | NULL while the decoder loop is still running. Without this patch, the | ||
8 | thread which interacts with the decode sink pad gets blocked here: | ||
9 | |||
10 | gst_element_change_state() | ||
11 | gst_element_change_state_func() | ||
12 | gst_element_pads_activate() --> Deactivating pads | ||
13 | activate_pads() | ||
14 | gst_pad_set_active() | ||
15 | gst_pad_activate_mode() | ||
16 | post_activate() | ||
17 | GST_PAD_STREAM_LOCK() | ||
18 | |||
19 | while gst_omx_port_acquire_buffer() gets stalled forever in | ||
20 | gst_omx_component_wait_message() waiting for a message that will never | ||
21 | arrive: | ||
22 | |||
23 | gst_omx_video_dec_loop() | ||
24 | gst_omx_port_acquire_buffer() | ||
25 | gst_omx_component_wait_message() | ||
26 | --- | ||
27 | omx/gstomxvideodec.c | 5 +++++ | ||
28 | 1 file changed, 5 insertions(+) | ||
29 | |||
30 | diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c | ||
31 | index cd24944..57a61dd 100644 | ||
32 | --- a/omx/gstomxvideodec.c | ||
33 | +++ b/omx/gstomxvideodec.c | ||
34 | @@ -1247,6 +1247,11 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self) | ||
35 | GstClockTimeDiff deadline; | ||
36 | OMX_ERRORTYPE err; | ||
37 | |||
38 | + if (!gst_pad_is_active(GST_VIDEO_DECODER_SRC_PAD (self))) { | ||
39 | + GST_DEBUG_OBJECT (self, "Src pad not active, not acquiring buffer and flushing instead"); | ||
40 | + goto flushing; | ||
41 | + } | ||
42 | + | ||
43 | #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) | ||
44 | port = self->eglimage ? self->egl_out_port : self->dec_out_port; | ||
45 | #else | ||
46 | -- | ||
47 | 1.8.3.2 | ||
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-fix-decoder-flushing.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-fix-decoder-flushing.patch new file mode 100644 index 0000000..a244b09 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-fix-decoder-flushing.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | diff --git a/omx/gstomx.c b/omx/gstomx.c | ||
2 | index 69696c4..c382019 100644 | ||
3 | --- a/omx/gstomx.c | ||
4 | +++ b/omx/gstomx.c | ||
5 | @@ -1508,8 +1508,8 @@ gst_omx_port_set_flushing (GstOMXPort * port, GstClockTime timeout, | ||
6 | last_error = OMX_ErrorNone; | ||
7 | gst_omx_component_handle_messages (comp); | ||
8 | while (signalled && last_error == OMX_ErrorNone && !port->flushed | ||
9 | - && port->buffers | ||
10 | - && port->buffers->len > g_queue_get_length (&port->pending_buffers)) { | ||
11 | + /* && port->buffers | ||
12 | + && port->buffers->len > g_queue_get_length (&port->pending_buffers) */) { | ||
13 | signalled = gst_omx_component_wait_message (comp, timeout); | ||
14 | if (signalled) | ||
15 | gst_omx_component_handle_messages (comp); | ||
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend new file mode 100644 index 0000000..b313acd --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend | |||
@@ -0,0 +1,19 @@ | |||
1 | # | ||
2 | # Need to make this conditional to gstreamer1 | ||
3 | # | ||
4 | SRC_URI_append_rpi = " \ | ||
5 | file://0001-config-files-path.patch \ | ||
6 | file://0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \ | ||
7 | file://0003-fix-decoder-flushing.patch \ | ||
8 | " | ||
9 | |||
10 | FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx:" | ||
11 | |||
12 | GSTREAMER_1_0_OMX_TARGET_rpi = "rpi" | ||
13 | GSTREAMER_1_0_OMX_CORE_NAME_rpi = "${libdir}/libopenmaxil.so" | ||
14 | |||
15 | |||
16 | # How to make this RPI specific? | ||
17 | EXTRA_OECONF_append_rpi = " CFLAGS="$CFLAGS -I${STAGING_DIR_TARGET}/usr/include/IL -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux"" | ||
18 | #examples only build with GL but not GLES, so disable it for RPI | ||
19 | EXTRA_OECONF_append_rpi = " --disable-examples" | ||