aboutsummaryrefslogtreecommitdiffstats
path: root/android/camera
Commit message (Collapse)AuthorAgeFilesLines
* Fixed compilation error with new x86_64-w64-mingw32 compilerAndrew Hsieh2012-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | Fixed the following for the new compiler 1. android/camera/camera-capture-windows.c: Added "#include <windows.h>" 2. SetClassLong() is deprecated. GCL_HICON doesn't exist in _WIN64. Replacted it with SetClassLongPtr(h, GCLP_HICON, icon) 3. [v]asprintf now actually exisit in libray. Changed the prototype to match the standard ones but will remove them later for GCC 4.5 and up. 4. Renamed _set_errno to set_errno because it exists in stdlib.h. Renamed _fix_errno to fix_errno for consistency. 5. EAI_NODATA and EAI_NONAME become the same things. 6. ddk/*h don't exisit. tap-win32.c actually only needs winioctl.h which provide constants. I have make sure they got the same constants in both old and new mingw compilers 7. #undef DELETE before redefining it for KEY_CODE in hw-events.h because DELETE is defined to be a constant in standard header. The above don't break the old one (ie. /usr/bin/i586-mingw32msvc-*) Change-Id: Ic7d13fd0fd237d433f923ee01c6ce50f5c02f095
* Refactor HW config to use hw.camera_back, and hw.camera_front properties.Vladimir Chtchetkine2012-03-191-85/+54
| | | | | | | | | | This is a continuation of an effort to simplify HW config, and make the UI for it clearer. This CL gets rid of multiple camera emulation properties, combining everything into just two properties: - hw.camera_back that controls emulation of a camera facing back, and - hw.camera_front that controls emulation of a camera facing front. Change-Id: Ia114ae4caf2053685cbff00f39088e5b5be2952c
* 64-bit emulatorAndrew Hsieh2012-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch to allow emulator searches for emulator64-${ARCH} first on 64-bit OS. If none is found, the original behavior which searchs for 32-bit emulator-${ARCH} is performed as usual. 64-bit emulator (which still emulates Android built in 32-bit) offers up to 20% speedup compared to its 32-bit counterpart. Details: android/main-emulator.c 1) search emulator64 based on the OS 2) dlopen lib64OpenglRender in 64-bit Makefile.* 1) Rules to build 64-bit executable emulator64-{x86,arm} and libraries emulator64-{libui,libqemu,target-i386,target-arm,libelff,common} 2) remove -Wa,-32 3) Changes prebuit toolchain path android-configure.h android/build/common.h 1) no longer force 32-bit build (because now prebuilts/tools/gcc-sdk/gcc can now handle 64-bit 2) set ANDROID_PREBUILTS to correctly locate ccache android/config/*/config-host.h 1) Detect HOST_X86_64 and HOST_X86_64/HOST_I386 Misc 64-bit porting clean-up 1) use %zx to print variable of type size_t in hex 2) use %zu to print variable of type size_t in dec 3) Initialize query_parm to NULL 4) use PRIu64 to replace PDUd64 5) use PRId64/PRIu64/PRIX64 to print 64-bit 6) drop PRUx64 because PRIx64 does the same 7) cast pointer arith to intptr_t before casting to int 8) fixed 1ULL<<63 Change-Id: Ife62a20063a6ec38d4a9b23977e840af1fce149a
* Fixes camera RTE on WindowsVladimir Chtchetkine2012-02-221-1/+15
| | | | | | | | | The root of the issue was that some cameras / camera drivers don't set compression type in the bitmap header explicitly to a V4L2_XXX, but set it to BI_RGB, which is unknown value for frame converters. To fix this, this CL converts BI_RGB to an appropriate V4L2_XXX value. Change-Id: Ifd70aa44138ab38fe66e8c80806a7dbb91725cf2
* Fix problem with using clipboard in Windows camera emulationVladimir Chtchetkine2012-02-021-20/+140
| | | | | | | | | | | | | | | This is a fix for a user reported issue #24794. In the nutshell, when emulator grabs a frame from webcam it leaves its bitmap in the clipboard (which is global). So, when user does a 'paste' somewhere else, that bitmap will be pasted there. Being bad by itself, it gets worst, because 'copy / paste' will be globally broken while camera application is running in the emulator. I.e, if you have camera app running in the emulator, and at the same time you're editing a Word file (for example), copy / paste will not work in Word. This CL contains a fix such as when possible, camera emulator on windows will not use clipboard to grab video frames, but will grab video frames using frame callback. Change-Id: I115a9c653b252620cf5407173c1e1eec69b4a2ee
* Refactor camera parameters parsing routinesVladimir Chtchetkine2012-01-231-170/+10
| | | | | | | | | | Move routines that pulls values out of the parameter string from camera-service.c to misc.c Those are general purpose routines that are also used in multitouch emulation, so it's better to keep it an an general utility file. Change-Id: I02978075b64b42ff07f5042cda770bbef8939e24
* Respect 'camera' flag in AVDVladimir Chtchetkine2012-01-061-0/+6
| | | | | | | | Turns of webcam emulation on condition that 'camera' AVD property is set to 'false'. Note that command line options (-webcam) will enable webcam emulation even if 'camera' AVD property is set to 'false' Change-Id: I493446f1d12b732ed49f9a5a9967b87b31b180f6
* Fix filename typo.Koan-Sin Tan2012-01-041-1/+1
| | | | | This goes invisible on case-insensitive filesystems, but fails when XCode is installed on a case-sensitive filesystem.
* Implements white balance and exposure compensation for emulated webcamVladimir Chtchetkine2011-12-057-80/+274
| | | | Change-Id: Id2dbb227280f0c0e1b5708ef78b9f19b087f92d5
* Add 320x240 frame support for Windows and Mac camera emulationVladimir Chtchetkine2011-11-152-0/+4
| | | | Change-Id: I54897ca86b372d98c7a30a47ecf88a4df8ee0fe9
* Add required frame dimensions for Win and Mac.Vladimir Chtchetkine2011-11-152-12/+22
| | | | | | | | | | Camera framework requires that certain frame dimensions must be supported by the camera devices. Since on Windows and Mac we have no way of knowing the real webcam capabilities, but camera API there pretty much allows us to choose any frame dimensions that we want, we will hard-code those that are required by the camera framework. Change-Id: I625381776f374103d2ac1c62fabae23b1c5afa88
* Fix emulator crash.Vladimir Chtchetkine2011-10-211-5/+7
| | | | Change-Id: I4f238bbd0175036b6003ebdf266de608d6acc6e7
* Bound loop indexVladimir Chtchetkine2011-10-211-1/+1
| | | | | | | In some cases (when frame sizes for pixel formats are not available) the loop will be not properly bounded, and may cause a crash. Change-Id: I2f2380ab4e2f7454bff8eeabcaff4e3f238fe71e
* Fix emulator crash caused by bad 'printf'Vladimir Chtchetkine2011-10-202-3/+3
| | | | Change-Id: I7c4830ba7606bedcf462e967adad3358723c44ba
* Implemented Mac camera emulationVladimir Chtchetkine2011-10-122-86/+549
| | | | Change-Id: I01609e8bfcdd8ee5ef876344d0a334ecd69a2b7a
* Fix windows buildVladimir Chtchetkine2011-09-232-2/+2
| | | | Change-Id: I7387eea3639d63b278b702100ee2d4584f87f4e2
* Check that first two cameras are facing in opposite direction.Vladimir Chtchetkine2011-09-231-12/+29
| | | | | | | Currently camera app will crash on an attempt to switch cameras if camera 0 and 1 are facing in the same direction. So, user should be warned about that on emulator start. Change-Id: Ic85da614d30295b04d2a318fb1c2015cc52f1140
* Timeout frame capturing.Vladimir Chtchetkine2011-09-236-24/+64
| | | | | | | | | | | It has been observed on some of the MS camera devices, that device may got stuck on something that would alwais return EAGAIN when queried for the next video frame. This requires us to timeout the loop that repeats attempts to acquire first frame from the device. Also added detection and reporting of I/O errors occurred during frame capturing. Also, this CL contains some cosmetick changes to error and warning reporting. Change-Id: I81edaf5ff8bfe147dbe4510e1446e77a87817f37
* Properly reset camera device between capture requestsVladimir Chtchetkine2011-09-221-9/+40
| | | | Change-Id: Ia748fe3f38e8366d0507fcee995eac311dd8c72a
* Fix video recording on WindowsVladimir Chtchetkine2011-09-221-15/+80
| | | | | | | Reseting capture windows on each "stop capture" + setting capture parameters allow to change video frame dimensions. Change-Id: I0ce8ed77dfa9838894acb9e9e84d84692bb3d520
* Fix captured frame pixel format on WindowsVladimir Chtchetkine2011-09-211-2/+2
| | | | | | | Apparently, bitmap obtained through the capXxx + clipboard API is formatted with BRG, not RGB format. Change-Id: Ib161be50d2d3258045a467b152a5a750e1a8fb42
* Fix NV12, and NV21 format descriptorsVladimir Chtchetkine2011-09-213-4/+20
| | | | | | Also adds support for YU12 pixel format that is used in video frames Change-Id: I613beef8b3e2296fd1fab7e2b9d2956fba1ac788
* Print warning on invalid webcam nameVladimir Chtchetkine2011-09-211-0/+4
| | | | Change-Id: I94939964890c4304a47ba86c582baf3a9544b5aa
* Fix win/mac buildVladimir Chtchetkine2011-09-211-4/+4
| | | | Change-Id: I8d074590bb1efd68789e341e37356bc9fb2c9c08
* Fix Mac/Windows buildsVladimir Chtchetkine2011-09-211-0/+14
| | | | Change-Id: I0acc651be93eb9b5bea49280a7dccd18c1386d48
* Implements converters for BAYER pixel formatVladimir Chtchetkine2011-09-212-43/+559
| | | | Change-Id: I68abaa8b89e2b46dc57bff1d7dbd6d9fda213dc8
* Add -webcam commandline option to control webcam emulationVladimir Chtchetkine2011-09-205-44/+186
| | | | | | -webcam name=<name>[,dir=<direction>] options controls web cameras to use for emulation. Change-Id: I961fd399c7e041541adda040dd24f194cc383cb9
* Refactor the converters to make them more manageableVladimir Chtchetkine2011-09-171-1151/+690
| | | | | | | | | | | | | | | The current conversion implementation was laking flexibility as far as adding support for new formats was concerned. In particular, adding support for each new format meant adding four converter routines: new format <--> RGB, new format <--> YUV. This was not scalable, so had to be rewritten. The new conversion implementation consists of four generic converters between different flavors og RGB/YUV formats, and array of descriptors for each supported format. Each descriptor contains information that is sufficient for the converter routines to perform its job. So, adding new format is just creating a new descriptor for that format, and adding it to the array of supported descriptors. Change-Id: Ica107d14fa03fa8f41eb9192f2c023a97f54b62c
* Add support for NV21, and NV12 formatsVladimir Chtchetkine2011-09-162-0/+584
| | | | Change-Id: I4bea0f3678b2ac21f3c6cf80581e997145e2a58d
* Fixes "stop device" issue on LinuxVladimir Chtchetkine2011-09-141-0/+19
| | | | | | | | Apparently, video driver doesn't allow frame size change, once it has been explicitly set. In order to get around this we need to reset the handle to the camera device by closing, and then reopening it. Change-Id: Icfd37b3c196d2643507218b965c5015884ed455b
* Fix Mac buildVladimir Chtchetkine2011-09-121-1/+0
| | | | | | Remove Windows artifact Change-Id: I2ffd5979674619786742f14995edbf10edfff23a
* Fix Mac buildVladimir Chtchetkine2011-09-121-0/+87
| | | | | | Add dummy rutines implementing public camera API on Mac Change-Id: Id3c9d99d863785b0e00d1bdf6deb0a1af49ce91c
* Implements camera service in emulatorVladimir Chtchetkine2011-09-127-461/+2866
| | | | | | | | | | | | This is fully functional camera service implementation, that works (tested) on both, Linux and Windows. Fixed little/big endian bugs in the coverter code. Moved preview frames to use RGB32 instead of RGB565: RGB32 conversions are simpler and faster in the guest. Made "payload size send" a separate routine Change-Id: I96954f4c2cb4e4ef4dd6a20e41897d79c5037bae
* Camera service skeletonVladimir Chtchetkine2011-09-072-0/+349
| | | | | | | | | | Skeleton that implements camera emulation service over QEMU pipe. More meat will be added as the guest camera emulation develops. This is a patch taken from approved AOSP commit that didn't go through because of a merge conflict. Change-Id: I6f0a2e42be4f5f0bd86d3dbf0c2a609e74b200c2
* Fix the darwin buildVladimir Chtchetkine2011-08-242-2/+5
| | | | Change-Id: I87bd356f7673bdbcc8e5f196f4a89182b3a36cbe
* Fix build break: make sure darwin build picks up on required declarationsVladimir Chtchetkine2011-08-242-3/+3
| | | | Change-Id: I801d56668d8591e599994c65fb47b9c3ea77ff73
* Fix the build by #ifdefing linux-only includesVladimir Chtchetkine2011-08-241-2/+4
| | | | Change-Id: Ia4b6b45ad305307f28858f834f284b07be7d134d
* Video capturing code for Linux, and WindowsVladimir Chtchetkine2011-08-187-0/+1467
Contains API that connects to a camera device, and pulls video frames from it on request from the client. Change-Id: If1d80c57611afff637a7734ce5c3a2c874cfc85a