Commit Graph

65 Commits

Author SHA1 Message Date
Vladimir Chtchetkine
c9d6edeea5 Change camera HAL to catch up with changes in emulator.
Emulator now allows fake camera to emulate both, back and front cameras at the same time.
Camera HAL is changed in this CL in order to support this.

Change-Id: I4dcf2d569bb0c6a3800b4a8da5edd4777b5a078a
2012-03-19 13:34:28 -07:00
James Dong
7803a1db5b Merge "Switched to use header files in /frameworks/native" 2012-03-13 12:44:43 -07:00
Andreas Huber
bd7ef3835c Merge "We're configuring media codecs dynamically now." 2012-03-13 09:01:32 -07:00
James Dong
27b71c7383 Switched to use header files in /frameworks/native
o related-to-bug: 6044887

Change-Id: Iea98db35e51aaf52063565818ecfea8a935693f3
2012-03-12 20:37:02 -07:00
Derek Sollenberger
a96af3f6f8 am 3565ea1a: am 89e98da5: am a848b972: am 89b7a104: Merge "Add missing includes for threads.h"
* commit '3565ea1a6ecccc59839d883ee74fc4ba83f4ab02':
  Add missing includes for threads.h
2012-03-08 11:34:13 -08:00
Derek Sollenberger
94548b6323 Add missing includes for threads.h
The missing headers were being transitively included through a
Skia header which is being removed.

Change-Id: I6a5b26c1f1bb3ed4c65e7e39fff3b927cb14eabf
2012-03-06 10:13:19 -05:00
Nick Kralevich
c7f0d89684 remove HAL_MODULE_INFO_SYM const
HAL_MODULE_INFO_SYM was declared as read-only, but
the struct is written to by libhardware.  This causes
a segfault when -Wl,-z,relro is enabled.

Fixed.

Change-Id: I3a3e8366bc2468aef75a3480edd0b3e8fcfeafa5
2012-03-01 17:06:37 -08:00
Andreas Huber
e01feb2d89 We're configuring media codecs dynamically now.
Change-Id: I55dcc3a9976f6db8f9fc10bf1b33068b1b26d339
2012-03-01 11:48:12 -08:00
Steve Block
5a622cba8c Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic6cac56d137f705dfa7266f21e9b0269219bd5d1
2012-01-09 10:39:43 +00:00
Steve Block
6aff44c27e Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I03c41e20d8f5d7f3c7ef1f01506885e3e250e921
2012-01-06 10:06:41 +00:00
Steve Block
cad4194fad Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ia7ba0ca669b2c4168d90837f9b409b21503f95f0
2012-01-04 21:08:55 +00:00
Steve Block
112bc5e57e Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: Ia14c98936bb1dc74e681bf2de342ad6861646778
2012-01-03 22:29:55 +00:00
Jean-Baptiste Queru
a98b9f28b1 Revert "Revert "Update the media_profiles.xml file to include...""
This reverts commit 2400b2c340.

Change-Id: I017f4a212ff34478e498513a6b8c0da2e7c0f27e
2011-12-09 13:13:25 -08:00
Vladimir Chtchetkine
031b92f4c7 Pass white balance and exposure compensation to webcam emulator
Using fake camera implementation for WB/exposure, implement the same functionality
on frames comming from webcam emulator. Note that due to heavy computations that
are involved in implementing this, we will do all that math in the emulator
application in order to provide a decent performance.

Change-Id: Id6c37b472860674c91e6ca37522fc61f497515a3
2011-12-05 09:16:23 -08:00
Xavier Ducrohet
6038109394 am 2400b2c3: Revert "Update the media_profiles.xml file to include..." do not merge.
* commit '2400b2c3402e6585437274f8acd5fd6e32367bb3':
  Revert "Update the media_profiles.xml file to include..."  do not merge.
2011-11-23 14:41:05 -08:00
Xavier Ducrohet
2400b2c340 Revert "Update the media_profiles.xml file to include..." do not merge.
This reverts commit a8fe85ea64.
2011-11-23 14:36:58 -08:00
Vladimir Chtchetkine
9a1a290e58 am fd1bdd61: Update supported frame sizes for fake camera. do not merge.
* commit 'fd1bdd611a2954bfb171548b8fa288b0319a0aa9':
  Update supported frame sizes for fake camera. do not merge.
2011-11-23 14:04:29 -08:00
James Dong
a8fe85ea64 Update the media_profiles.xml file to include maximum memory usage support for video editor. do not merge.
related-to-bug: 5625690

(cherry picked from commit f8781452d9)

Change-Id: Id27eb9052f00328ba04bac8486c9ed23f3c6a09b
2011-11-23 13:14:50 -08:00
Vladimir Chtchetkine
fd1bdd611a Update supported frame sizes for fake camera. do not merge.
Camera framework requires 352x288, and 320x240 frames for video preview and video
recording. If these dimensions are missing in camera properties the camera app
may abort when entering video mode, or start video recording.

Also truned off switching fake frames, leaving only the checker board.

(cherry picked from commit 6f00e7fc48)

Change-Id: Ic50225e1700ea3b04ae5445549548f2ffe4ae2df
2011-11-23 13:14:16 -08:00
Vladimir Chtchetkine
6f00e7fc48 Update supported frame sizes for fake camera
Camera framework requires 352x288, and 320x240 frames for video preview and video
recording. If these dimensions are missing in camera properties the camera app
may abort when entering video mode, or start video recording.

Also truned off switching fake frames, leaving only the checker board.

Change-Id: I63d145c967f1ba83992141ec97700f094a9d53a7
2011-11-22 15:15:57 -08:00
James Dong
43a67b48c2 am b62c5b91: am f8781452: Update the media_profiles.xml file to include maximum memory usage support for video editor
* commit 'b62c5b9156d589ea8aaa6c441530b2ef371f1915':
  Update the media_profiles.xml file to include maximum memory usage support for video editor
2011-11-17 07:48:19 -08:00
James Dong
f8781452d9 Update the media_profiles.xml file to include maximum memory usage support for video editor
Change-Id: I26eacaaca76b72fc5a43ee8fabacf62060418edd
related-to-bug: 5625690
2011-11-16 14:37:49 -08:00
Vladimir Chtchetkine
50ab613ece Fix temperature sensor
Change-Id: I4cc1264f4437172e78b38ce394e4dd005ad1a59f
2011-11-09 18:02:21 -08:00
Steve Block
629719e390 Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: Iad3a485eed0dc273d66607d30a7b9b79b02c03b6
2011-10-25 18:24:59 +01:00
Christine Chen
12c0b21abe Added white balance settings to the camera Emulator.
- Added the white balance control to the fake camera.

Change-Id: I5ada253a3ae7195ca5625a3601c9e4ed819fa2cc
2011-10-20 17:49:35 -07:00
Vladimir Chtchetkine
f7f6886820 Cherry picked from c9a94b0f in master. Do not merge.
Implement CAMERA_MSG_PREVIEW_FRAME callback

Also does better work detecting pixel format for video frames, depending on the
mode that camera is intended to be operated with.

Change-Id: Idb2dfc7c0a79e81eff58f83a14af769afc713096
2011-10-18 12:32:24 -07:00
Vladimir Chtchetkine
caa1aeafba Implement CAMERA_MSG_PREVIEW_FRAME callback
Also does better work detecting pixel format for video frames, depending on the
mode that camera is intended to be operated with.

Change-Id: I352204b8d6d1a9e7857d77b6363de2bb5d5db0dd
2011-10-17 12:56:54 -07:00
Christine Chen
366396d9b0 Added exposure compensation control for the fake camera.
Change-Id: I10bc16d9d521f82e12ff335eed29465ac08b5595
2011-10-14 15:14:36 -07:00
Vladimir Chtchetkine
e466a63ab4 Include correct endian.h file
Apparently including sys/endian.h directly produces uninitialized endianness macros.
Should include target CPU-dependent header instead.

Change-Id: Ib16f0470d27baa085bf1675a403c02efa6f994c4
2011-09-27 15:41:12 -07:00
Vladimir Chtchetkine
1bc31fe7e0 Some minor polishing.
Change-Id: I2e8f2bf3671e9676f115aaa894684618087e979d
2011-09-23 14:41:46 -07:00
Vladimir Chtchetkine
55d41f8969 Sets right preview frame properties.
Don't cofuse preview window with preview frames. Preview frames are relevant only
in panoramic mode that receives frames via CAMERA_MSG_PREVIEW_FRAME callback.

Change-Id: Ibecb345e43ba452856b8ca75449264d8d354a9d5
2011-09-23 10:08:28 -07:00
Vladimir Chtchetkine
b3ea171655 Implements camera error reporting.
Change-Id: I5f4f4cd1baab60053e827e0605a92a123c7a086f
2011-09-23 08:34:08 -07:00
Vladimir Chtchetkine
4d7f7de700 Use actual JPEG quality when compressing picture
Sometimes framework chooses to override the default JPEG quality value (90), so we need to
respect that when compressing frame during picture taking.

Change-Id: Ic7ad8938d33d94d34ecd0b979e5c8c3e8246fd53
2011-09-21 15:33:18 -07:00
Vladimir Chtchetkine
68ec4ac828 Fix video format
Apparently, video pixel format expected by the camera framework is YU12, and not YV12
as it was implemented.

Change-Id: Id33d8aa7f62f6e68276774ca2a7d25c04acd71cc
2011-09-21 14:55:29 -07:00
Vladimir Chtchetkine
1f37cd45f6 Fix callback sequence on picture taking
Also fixes a bug in JPEG converter.

Change-Id: I5bbeec96ec2bb0a9a6a333a3798880bb0b837c65
2011-09-21 14:20:07 -07:00
Vladimir Chtchetkine
a88e749e29 Adds media_profiles.xml file that is required for proper framework setup
This file must be copied over to /system/etc directory inside the emulated system image.

Change-Id: Ia013ed20e1ce7a6f9a3ce162f86e0fd3c97ded31
2011-09-21 06:58:08 -07:00
Vladimir Chtchetkine
dd63895f1f Fix camera ID validation
Check for id being <0 before checking its upper boundary

Change-Id: I92ed1ac78f35b5d6bbdd24cc041b2cfb4c121c74
2011-09-20 14:16:53 -07:00
Vladimir Chtchetkine
4bc3b1f3b5 Hookup to cmdline parameters in emulator
Use boot properties, and webcam facing parameters set up by the emulator's cmdline.

Change-Id: I2189e5f67b9d79ad330b5ee275ff30d8851fc326
2011-09-17 11:28:09 -07:00
Vladimir Chtchetkine
2a532ee388 Implement "takePicture"
With this CL the camera emulator is capable of taking pictures

Change-Id: I29feea0c75a78c619aaf854a5665a24afb507ba4
2011-09-15 18:24:32 -07:00
Vladimir Chtchetkine
49842cee05 Separate actual camera device start and frame delivery
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
2011-09-14 18:35:48 -07:00
Vladimir Chtchetkine
ba78a2f1d3 Fix locking issues in the callback notifier
Holding an object lock while macking the callbacks cause deadlocks
due to reentrance to the callabck notifier.

Change-Id: I5f2780989798ebf5c5d7aab34ac233bb5952079d
2011-09-14 14:24:03 -07:00
Vladimir Chtchetkine
4756fada1a Fix typos introduced during style adjustment
Change-Id: Ia9ca4849d4a410aea9d49d2c6246d36c4c7fc8f1
2011-09-14 13:56:48 -07:00
Vladimir Chtchetkine
4d47360672 Fix capture stopping
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
2011-09-14 07:06:23 -07:00
Vladimir Chtchetkine
16232484c7 Fix build
Change-Id: Ifb5dd0b11bd616ef5a5a1e79b510b00f1d55672a
2011-09-13 16:02:51 -07:00
Vladimir Chtchetkine
5467be2eef Refactored emulated camera HAL to comply with code style
Change-Id: If57b536ae6b1f9bad4213630488591a3b3cc9fdd
2011-09-13 14:35:25 -07:00
Vladimir Chtchetkine
33bda47528 Implements connection with the emulator
Change-Id: Ie3910a98e927f7b8ea556c403f8ced27e06bcdec
2011-09-13 09:44:32 -07:00
Vladimir Chtchetkine
b97c2f0b59 Fake camera implementation
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
2011-09-12 08:37:48 -07:00
Vladimir Chtchetkine
7c61dfc286 am dc6e4e64: am af0d8ed8: am 9a528ed9: Merge "Get rid of libqemu library."
* commit 'dc6e4e64de0036021dc4491ab0760d3aeb364019':
  Get rid of libqemu library.
2011-08-03 18:16:37 -07:00
Vladimir Chtchetkine
b2b6f2f9da Get rid of libqemu library.
Its implementation has been inlined in hardware/libhardware/include/hardware/qemu_pipe.h

Change-Id: I355764f87047c915ac43b85cd18bf0f27f06ede3
2011-08-03 09:10:14 -07:00
Ying Wang
6a42c746e5 Remove simulator conditionals.
Simulator is gone.

Change-Id: Ia4454bde6d16666830b553ec42e5c19359505103
2011-07-13 10:34:21 -07:00