From kde-devel Wed Apr 23 17:55:54 2014 From: Sinny Kumari Date: Wed, 23 Apr 2014 17:55:54 +0000 To: kde-devel Subject: Re: Loading and "unloading" a shared library after use Message-Id: X-MARC-Message: https://marc.info/?l=kde-devel&m=139827575415574 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1777570790788328285==" --===============1777570790788328285== Content-Type: multipart/alternative; boundary=047d7bdc9e027365a004f7b96f65 --047d7bdc9e027365a004f7b96f65 Content-Type: text/plain; charset=UTF-8 Hi, On Tue, Apr 22, 2014 at 2:57 AM, Albert Astals Cid wrote: > El Dilluns, 21 d'abril de 2014, a les 20:49:06, Shantanu Tushar Jha va > escriure: > > Hi fellow devs, > > > > In the latest Kubuntu release, 14.04, Plasma Media Center's primary > feature > > - playback of audio and video has stopped working. This is because we > link > > to libplasma which in turn links to libgstreamer-1.0 while > QtMultimediaKit > > links to libgstreamer-0.10. This upsets Glib because it doesn't want the > > same binary load both gstreamer-1.0 and gstreamer-0.10[1] > > > > Now, we use (and link to) Plasma for two things- > > > > - Setting the Oxygen theme - > > Plasma::Theme::defaultTheme()->setThemeName("oxygen") > > - Load PMC's main QML file and images which are part of a > Plasma::Package > > > > Removing these two from the code, and removing the link to libplasma, we > > can get PMC to play stuff fine. However, this means we 1. use the Air > theme > > which doesn't really look very nice[2] and 2. we need to figure out > another > > way to locate the installed QML files. The latter is workable, but we > > really want to be able to use Oxygen Plasma theme. > > > > We do both these things when the app starts, so I am wondering if there > is > > a way we could dynamically load libplasma, make these two method calls, > and > > somehow "unload" libplasma. I have two questions - > > > > > > - Does that ^ even make sense? Will it solve the problem? > > - If yes, how exactly do you do it? > > You can use QLibrary to load/unload libraries (basically a wrapper around > dlopen and friends). I have no idea what will happen if you still hold > objects > created by those libraries in memory though (since i guess you'll need that > for PMC), my guess would be crashing :-/ > > I would suggest helping with the port of QtMultimediaKit to > gestreamer-1.0, i > know that doesn't immediately help your users though :-/ > > We ended up loading and unloading libplasma after use using QLibrary. Review request for same is here https://git.reviewboard.kde.org/r/117691/ . It will be good if someone review it whether it is good to go or not. Thanks -- http://www.sinny.in --047d7bdc9e027365a004f7b96f65 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,


On Tue, Apr 22, 2014 at 2:57 AM, Albert Astals Cid <aacid@kde= .org> wrote:
El Dilluns, 21 d'abri= l de 2014, a les 20:49:06, Shantanu Tushar Jha va
escriure:
> Hi fellow devs,
>
> In the latest Kubuntu release, 14.04, Plasma Media Center's primar= y feature
> - playback of audio and video has stopped working. This is because we = link
> to libplasma which in turn links to libgstreamer-1.0 while QtMultimedi= aKit
> links to libgstreamer-0.10. This upsets Glib because it doesn't wa= nt the
> same binary load both gstreamer-1.0 and gstreamer-0.10[1]
>
> Now, we use (and link to) Plasma for two things-
>
> =C2=A0 =C2=A0- Setting the Oxygen theme -
> =C2=A0 =C2=A0Plasma::Theme::defaultTheme()->setThem= eName("oxygen")
> =C2=A0 =C2=A0- Load PMC's main QML file and images which are= part of a Plasma::Package
>
> Removing these two from the code, and removing the link to libplasma, = we
> can get PMC to play stuff fine. However, this means we 1. use the Air = theme
> which doesn't really look very nice[2] and 2. we need to figure ou= t another
> way to locate the installed QML files. The latter is workable, but we<= br> > really want to be able to use Oxygen Plasma theme.
>
> We do both these things when the app starts, so I am wondering if ther= e is
> a way we could dynamically load libplasma, make these two method calls= , and
> somehow "unload" libplasma. I have two questions -
>
>
> =C2=A0 =C2=A0- Does that ^ even make sense? Will it solve the problem?=
> =C2=A0 =C2=A0- If yes, how exactly do you do it?

You can use QLibrary to load/unload libraries (basically a wrapper around dlopen and friends). I have no idea what will happen if you still hold obje= cts
created by those libraries in memory though (since i guess you'll need = that
for PMC), my guess would be crashing :-/

I would suggest helping with the port of QtMultimediaKit to gestreamer-1.0,= i
know that doesn't immediately help your users though :-/


=C2=A0
We ended up loadi= ng and unloading libplasma after use using QLibrary. Review request for sam= e is here https://git= .reviewboard.kde.org/r/117691/ . It will be good if someone review it w= hether it is good to go or not.

Thanks
--047d7bdc9e027365a004f7b96f65-- --===============1777570790788328285== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============1777570790788328285==--