libvlc and java swt application crashing fix
Aswin Thoudam <[email protected]> Wed, 24 Feb 2016 15:59:27 +0530
| Newsgroups | gmane.comp.video.videolan.vlc.devel,gmane.comp.video.videolan.vlc.general |
|---|---|
| Message-ID | <CANB3vWkLrd7S7nrDE_6YCGW2Jhr+Tgvy8DiQ31eDgH7AEz6LuA@mail.gmail.com> |
--94eb2c0b8fac6636c4052c818a86
Content-Type: multipart/alternative; boundary=94eb2c0b8fac6636c1052c818a84
--94eb2c0b8fac6636c1052c818a84
Content-Type: text/plain; charset=UTF-8
Hi,
I am creating a surface in java SWT and using the window id created by the
java application I used vlc to play the video on the surface. On stopping
of video playback and attempting to dispose the window my application
sometimes crashes. This due to faulty implementation by either by SWT or
vlc or xcb. After checking the various logs I saw that on some situation
vlc loads xcb-window and on other time another window type is created.
Further I saw that if xcb_glx is used then my java application never
crashes. Also I am using vlc-2.2.1 on a RHEL 6.6 and sometimes on core i3
processor with 2 real core and 2 simulated core for a total of 4 core
hardware acceleration seems to have a bad effect with no video output
although audio output is heard sometime. So I made the following changes by
patching the file media_player.c with the following patch and found my
application is working fine. The patch I am submitting now
diff -crB vlc-2.2.1-orig/lib/media_player.c vlc-2.2.1/lib/media_player.c
*** vlc-2.2.1-orig/lib/media_player.c 2015-01-17 13:20:50.000000000 +0530
--- vlc-2.2.1/lib/media_player.c 2015-08-21 18:59:31.000000000 +0530
***************
*** 938,945 ****
assert (p_mi != NULL);
! var_SetString (p_mi, "avcodec-hw", "");
! var_SetString (p_mi, "vout", drawable ? "xid" : "any");
! var_SetString (p_mi, "window", drawable ? "embed-xid,any" : "any");
var_SetInteger (p_mi, "drawable-xid", drawable);
}
--- 938,945 ----
assert (p_mi != NULL);
! var_SetString (p_mi, "avcodec-hw", "none");
! var_SetString (p_mi, "vout", drawable ? "xcb_glx,any" : "any");
! var_SetString (p_mi, "window", drawable ? "any" : "any");
var_SetInteger (p_mi, "drawable-xid", drawable);
}
Aswin
--94eb2c0b8fac6636c1052c818a84
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div>Hi,<br><br></div>I am creating a surface in java=
SWT and using the window id created by the java application I used vlc to =
play the video on the surface. On stopping of video playback and attempting=
to dispose the window my application sometimes crashes. This due to faulty=
implementation by either by SWT or vlc or xcb. After checking the various =
logs I saw that on some situation vlc loads xcb-window and on other time an=
other window type is created. Further I saw that if xcb_glx is used then my=
java application never crashes. Also I am using vlc-2.2.1 on a RHEL 6.6 an=
d sometimes on core i3 processor with 2 real core and 2 simulated core for =
a total of 4 core hardware acceleration seems to have a bad effect with no =
video output although audio output is heard sometime. So I made the followi=
ng changes by patching the file media_player.c with the following patch and=
found my application is working fine. The patch I am submitting now<br><br=
>diff -crB vlc-2.2.1-orig/lib/media_player.c vlc-2.2.1/lib/media_player.c<b=
r>*** vlc-2.2.1-orig/lib/media_player.c=C2=A0=C2=A0=C2=A0 2015-01-17 13:20:=
50.000000000 +0530<br>--- vlc-2.2.1/lib/media_player.c=C2=A0=C2=A0=C2=A0 20=
15-08-21 18:59:31.000000000 +0530<br>***************<br>*** 938,945 ****<br=
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 assert (p_mi !=3D NULL);<br>=C2=A0 <br>!=C2=
=A0=C2=A0=C2=A0=C2=A0 var_SetString (p_mi, "avcodec-hw", "&q=
uot;);<br>!=C2=A0=C2=A0=C2=A0=C2=A0 var_SetString (p_mi, "vout", =
drawable ? "xid" : "any");<br>!=C2=A0=C2=A0=C2=A0=C2=A0=
var_SetString (p_mi, "window", drawable ? "embed-xid,any&qu=
ot; : "any");<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 var_SetInteger (p=
_mi, "drawable-xid", drawable);<br>=C2=A0 }<br>=C2=A0 <br>--- 938=
,945 ----<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 assert (p_mi !=3D NULL);<br>=C2=
=A0 <br>!=C2=A0=C2=A0=C2=A0=C2=A0 var_SetString (p_mi, "avcodec-hw&quo=
t;, "none");<br>!=C2=A0=C2=A0=C2=A0=C2=A0 var_SetString (p_mi, &q=
uot;vout", drawable ? "xcb_glx,any" : "any");<br>!=
=C2=A0=C2=A0=C2=A0=C2=A0 var_SetString (p_mi, "window", drawable =
? "any" : "any");<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 var=
_SetInteger (p_mi, "drawable-xid", drawable);<br>=C2=A0 }<br><br>=
</div>Aswin<br></div>
--94eb2c0b8fac6636c1052c818a84--
--94eb2c0b8fac6636c4052c818a86
Content-Type: application/octet-stream; name="java-vlc.patch"
Content-Disposition: attachment; filename="java-vlc.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_il0p6e0g0
ZGlmZiAtY3JCIHZsYy0yLjIuMS1vcmlnL2xpYi9tZWRpYV9wbGF5ZXIuYyB2bGMtMi4yLjEvbGli
L21lZGlhX3BsYXllci5jCioqKiB2bGMtMi4yLjEtb3JpZy9saWIvbWVkaWFfcGxheWVyLmMJMjAx
NS0wMS0xNyAxMzoyMDo1MC4wMDAwMDAwMDAgKzA1MzAKLS0tIHZsYy0yLjIuMS9saWIvbWVkaWFf
cGxheWVyLmMJMjAxNS0wOC0yMSAxODo1OTozMS4wMDAwMDAwMDAgKzA1MzAKKioqKioqKioqKioq
KioqCioqKiA5MzgsOTQ1ICoqKioKICAgICAgYXNzZXJ0IChwX21pICE9IE5VTEwpOwogIAohICAg
ICB2YXJfU2V0U3RyaW5nIChwX21pLCAiYXZjb2RlYy1odyIsICIiKTsKISAgICAgdmFyX1NldFN0
cmluZyAocF9taSwgInZvdXQiLCBkcmF3YWJsZSA/ICJ4aWQiIDogImFueSIpOwohICAgICB2YXJf
U2V0U3RyaW5nIChwX21pLCAid2luZG93IiwgZHJhd2FibGUgPyAiZW1iZWQteGlkLGFueSIgOiAi
YW55Iik7CiAgICAgIHZhcl9TZXRJbnRlZ2VyIChwX21pLCAiZHJhd2FibGUteGlkIiwgZHJhd2Fi
bGUpOwogIH0KICAKLS0tIDkzOCw5NDUgLS0tLQogICAgICBhc3NlcnQgKHBfbWkgIT0gTlVMTCk7
CiAgCiEgICAgIHZhcl9TZXRTdHJpbmcgKHBfbWksICJhdmNvZGVjLWh3IiwgIm5vbmUiKTsKISAg
ICAgdmFyX1NldFN0cmluZyAocF9taSwgInZvdXQiLCBkcmF3YWJsZSA/ICJ4Y2JfZ2x4LGFueSIg
OiAiYW55Iik7CiEgICAgIHZhcl9TZXRTdHJpbmcgKHBfbWksICJ3aW5kb3ciLCBkcmF3YWJsZSA/
ICJhbnkiIDogImFueSIpOwogICAgICB2YXJfU2V0SW50ZWdlciAocF9taSwgImRyYXdhYmxlLXhp
ZCIsIGRyYXdhYmxlKTsKICB9Cg==
--94eb2c0b8fac6636c4052c818a86
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
--94eb2c0b8fac6636c4052c818a86--