These two tasks (starting the camera device, and starting working thread that pulls frames
from the started camera device) should be clearly separated, and should not be combined in
one method (as it was with the 'startCapturing' method).
Change-Id: I779bee924d99d9a87257c6b76791545b76795e72
Holding an object lock while macking the callbacks cause deadlocks
due to reentrance to the callabck notifier.
Change-Id: I5f2780989798ebf5c5d7aab34ac233bb5952079d
When stopping the camera, the working thread should be stopped before sending
"stop" query to the emulator: we don't want "frame" queries to be floating around
while we're in the process of stopping the camera.
Change-Id: I16dc56ca1c2e304a07a074302001d2e27100f2ac
This patch adds support for Win32 named pipes for the communication
channel between the Opengl renderer library and its clients.
Named pipes should be much faster than local TCP sockets on this
platform. Note that by default, TCP sockets are still used. The
emulator needs to call setStreamMode(STREAM_MODE_PIPE) to be able
to use these.
Change-Id: I86d36624cf2b7fdd50f41e1e43c908348dca4657
This patch allows the OpenGLES rendering library to use Unix
sockets instead of TCP ones when communicating with its clients.
On certain benchmarks (e.g. 0xBench teapot), this provides a
noticeable improvement (x1.05 fps) without any other changes.
On practice, Unix sockets are faster than TCP sockets, even
local ones. Also, this introduces a moderate amount of
abstraction that will allow us to use Win32 named pipes
on Windows (where TCP sockets are much slower than they
are on Unix).
Note that by default, TCP streams are still used.
The client (emulator) must call the new API 'setStreamMode'
to change it to STREAM_MODE_UNIX between 'initLibrary' and
'startOpenglRenderer' calls.
+ Adjust callers / user appropriately.
Change-Id: I4105bbf07541f3146b50a58d1a5b51e8cf044fab
This re-enables the build of the gralloc GLES emulation library.
This is only for experimentation / debugging purpose. GLES emulation
is still disabled by default in the emulator. Even if you force-enable
it by using the '-gpu on' flag, this module will not properly yet
and nothing will be displayed.
Change-Id: I8f0ca8805ed99037b011365d08507ca08bff5e75
The code submitted here builds a camera.goldfish.so module that encapsulates a camera HAL.
The major components of the camera HAL implementation are:
* Generic HAL module implemented in emulated_camera_hal.cpp There is nothing much
to it: just exporting the required HAL header.
* EmulatedCameraFactory class that manages emulated cameras, and provides handling for
camera_module_methods_ methods. There is only one object of this class, that is statically
instantiated when camera.goldfish.so module is loaded.
* EmulatedCamera class that implements camera_device_ops_t API. Objects of this class are
instantiated during EmulatedCameraFactory construction, and they interact with objects
of EmulatedCameraDevice class to get frames.
* EmulatedCameraDevice class encapsulates an actual camera device. Objects of this class
are contained in EmulatedCameraDevice objects, and interact with them as required by the
API.
The fake camera implementation is shared between EmulatedFakeCamera, and EmulatedFakeCameraDevice
classes. They are pretty light. In fact, EmulatedFakeCamera is nothing more than just a
placeholder for EmulatedFakeCameraDevice instance, and EmulatedFakeCameraDevice does nothing
more, than just drawing a checker board with a bouncing square.
Other components / routines are minor: helpers, wrappers, etc. The code is heavily commented,
so there will be plenty of explanations between the lines.
Change-Id: I4463e14c255c6e3b1dcca17bed5f4efde32d9879
This fixes the definition of the emulator-specific egl.cfg file
used to indicate to our EGL system library which support modules
are available in the emulator.
We need to list two modules here:
'emulation' corresponding to GPU emulation
'android' corresponding to the software renderer
The indices before each name correspond to the 'display' and 'impl'
numbers that are expected by frameworks/base/opengl/libs/EGL/Loader.cpp
In a nutshell, 'display' should always be 0, and 'impl' should be 0
for the software renderer, and 1 for a hardware-based one. See the code
under framewors/base/opengl/libs/EGL/egl.cpp for mode details.
Change-Id: I52c898759200c2dfba9049ed00b31b18e8c37f69
The gralloc.goldfish module cannot build in master because
the gralloc interface evolved considerably since gingerbread
(which the current code is based on).
For now, disable it completely, this will make it impossible
to test GPU emulation in the internal master tree for now.
We'll have to port this module to the new world-order to solve
this.
Change-Id: I864217f9c41fd1234f0df497005499800af879e5
This adds an initLibrary() function to libOpenglRender.
It will be used by the emulator to fallback on software rendering
if the library cannot be initialized properly, e.g. if it is not
possible to load the host EGL/GLES libraries.
Change-Id: I41e8ad73a315166e4a15cbee1db72c2552370f46
This patch changes the filter used to scale the GL window
in the rendering library. Instead of nearest-neighbour, use
bi-linear, which will provide for much more pleasant results
when scaling the emulator UI window, or toggling to full-screen
mode.
Change-Id: If2d9e1300fa4878c25e1221eaedb565b9150431a
This patch modifies the gralloc.goldfish module to check
that the emulator does, indeed, support GPU emulation.
If this is not the case, it loads the framebuffer-based fallback
module (gralloc.default) explicitely and uses it instead.
This is necessary because sometimes the emulator will be started
in headless mode in restricted environment, i.e. without access
to the display subsystem or GL libraries, which make GPU emulation
impossible.
We check for ro.kernel.qemu.gles which will be either undefined
or set to 0 if the emulator doesn't support GPU emulation, or 1
otherwise.
Change-Id: Ib6b143e6dcdfb44ff2c5b889138d0fb4118bb461
This patch modifies GLDispatch.cpp in the translator libraries
to open the Darwin GL library as a framework. Using a hard-coded
system path prevents the requirement to modify LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH to point to the directory that contains the
library.
In this specific case, this is equivalent to
/System/Frameworks/OpenGL.framework/Libraries/libGL.dylib
But is the "kosher" way to open it the library.
Change-Id: Iccd6568d36fc97200617c268f05d7b4ea85f918e