- Notifications
You must be signed in to change notification settings - Fork52
ppapi2npapi compatibility layer
License
MIT, Unknown licenses found
Licenses found
i-rinat/freshplayerplugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
PPAPI-host NPAPI-plugin adapter.
As you know, Adobe have suspended further development of Flash playerplugin for GNU/Linux. Latest available as an NPAPI plugin version 11.2will get security updates for five years (since its release on May4th, 2012), but further development have been ceased. Fortunately ornot, newer versions are still available for Linux as a part of Chromebrowser, where Flash comes bundled in a form of PPAPI plugin. PPAPI orPepper Plugin API is an interface promoted by Chromium/Chrome team forbrowser plugins. It's NPAPI-inspired yet significantly different APIwhich have every conceivable function plugin may want. Two-dimensionalgraphics, OpenGL ES, font rendering, network access, audio, and soon. It's huge, there are 111 groups of functions, called interfaceswhich todays Chromium browser offers to plugins. Although specs are notfinal yet, and new interface versions are arising, with some olderones getting deleted; rate of change have significantly slowed down.
For various reasons Firefox developers are not interested now inimplementing PPAPI in Firefox. However that does not mean it cannotbe done.
The main goal of this project is to get PPAPI (Pepper) Flash playerworking in Firefox. This can be done in two ways. First one is toimplement full PPAPI interface in Firefox itself. Other one is toimplement a wrapper, some kind of adapter which will look like browserto PPAPI plugin and look like NPAPI plugin for browser.
First approach requires strong knowledge of Firefox internals, andmoreover additional effort to get the code intomainstream. Maintaining a set of patches doesn't look like a goodidea. Second approach allows to concentrate on two APIs only. Yes oneof them is big, but still graspable. Second way will be used for theproject. It will benefit other browsers too, not only Firefox.
Mostly works. Looks like all essential APIs are implemented.
describedhere.
All available Pepper Plugin API documentation usually accompanied withassertions of enhanced security due to active sandboxing usage. It'sworth to note, that API itself doesn't make any sandboxing, it's onlyallows sandboxed implementations. This particular implementationdoesn't implement any sandbox. That means if any malicious code breaksthrough plugin security, there is no additional barriers. This is thesame level of security as NPAPI Flash have.
Project is using cmake (>=2.8.8) build system.
- Install prerequisites.
Debian/Ubuntu: $ sudo apt-get install cmake gcc g++ pkg-config ragel libasound2-dev \ libssl-dev libglib2.0-dev libpango1.0-dev libgl1-mesa-dev \ libevent-dev libgtk2.0-dev libxrandr-dev libxrender-dev \ libxcursor-dev libv4l-dev libgles2-mesa-dev libavcodec-dev \ libva-dev libvdpau-dev libdrm-dev libicu-dev Fedora: $ sudo dnf install cmake gcc gcc-c++ pkgconfig ragel alsa-lib-devel openssl-devel \ glib2-devel pango-devel mesa-libGL-devel libevent-devel gtk2-devel \ libXrandr-devel libXrender-devel libXcursor-devel libv4l-devel \ mesa-libGLES-devel ffmpeg-devel libva-devel libvdpau-devel libdrm-devel \ pulseaudio-libs-devel libicu-devel
(optional) To enable PulseAudio support, install
libpulse-dev
.(optional) To enable JACK support, install
libjack-jackd2-dev
andlibsoxr-dev
Create a
build
subdirectory in the root directory, from that folder, call
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. $ make
- Put generated
libfreshwrapper-flashplayer.so
into browser plugins directory (~/.mozilla/plugins
)or install system-wide by calling:
# make install
By defaultmake install
will put plugin(s) to${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/mozilla/plugins
. Thepath could be changed either by changing CMake parameterCMAKE_INSTALL_PREFIX
, or by settingMOZPLUGIN_INSTALL_DIR
.
When loaded by browser it will search forlibpepflashplayer.so
in a directorieswhere it can be: in Chrome (stable/beta/unstable) directory, and in/usr/lib/pepperflashplugin-nonfree/
(pepperflashplugin-nonfree puts it there).It should be enough to get it running, but if it doesn't, specify full path in~/.config/freshwrapper.conf
. You may find sample configuration file in/data
.It's better to havemanifest.json
alongside withlibpepflashplayer.so
,actual Flash version will be taken from that manifest.
Hardware-accelerated video decoding code requires relatively new version of libavcodec(January 2013, version 54.39.0). If you don't have it yet, code won't compile unlessyou disable hwdec byWITH_HWDEC=0
. To do so, change configuration step command to:
$ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_HWDEC=0 ..
Note, even if built, hardware-accelerated video decoding is still disabled by default.You need to explicitly enable it in configuration file.
Although it's better to use system implementation of OpenGL|ES 2, it's still possibleto leverageANGLE GLES2 emulation by addingWITH_GLES2=0
to cmake command line at configuration time (-DWITH_GLES2=0
to be exact).Note, that requires C++11-capable compiler.
The MIT License. SeeLICENSE
file for full text.
Directory3rdparty/
contains source code from 3rd parties which can bedistributed under other license terms. See source code for details.
About
ppapi2npapi compatibility layer