diff options
author | Niko Catania <> | 2009-03-24 20:55:36 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 20:55:36 -0700 |
commit | 2827560ce2c0462487ff3b9193ea5abc4a1077c4 (patch) | |
tree | dbc603d77dea242af17d6e0c5abfd43243cef897 /camera/libcameraservice/FakeCamera.h | |
parent | 10270f2b7715dbbc9fae16b8765f888e5b8a7631 (diff) | |
download | frameworks_base-2827560ce2c0462487ff3b9193ea5abc4a1077c4.zip frameworks_base-2827560ce2c0462487ff3b9193ea5abc4a1077c4.tar.gz frameworks_base-2827560ce2c0462487ff3b9193ea5abc4a1077c4.tar.bz2 |
Automated import from //branches/master/...@141784,141784
Diffstat (limited to 'camera/libcameraservice/FakeCamera.h')
-rw-r--r-- | camera/libcameraservice/FakeCamera.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/camera/libcameraservice/FakeCamera.h b/camera/libcameraservice/FakeCamera.h index 77c994c..da9e944 100644 --- a/camera/libcameraservice/FakeCamera.h +++ b/camera/libcameraservice/FakeCamera.h @@ -18,21 +18,36 @@ #ifndef ANDROID_HARDWARE_FAKECAMERA_H #define ANDROID_HARDWARE_FAKECAMERA_H -#include <ui/CameraHardwareInterface.h> +#include <sys/types.h> namespace android { +/* + * FakeCamera is used in the CameraHardwareStub to provide a fake video feed + * when the system does not have a camera in hardware. + * The fake video is a moving black and white checkerboard background with a + * bouncing gray square in the foreground. + * This class is not thread-safe. + * + * TODO: Since the major methods provides a raw/uncompressed video feed, rename + * this class to RawVideoSource. + */ + class FakeCamera { public: FakeCamera(int width, int height); ~FakeCamera(); void setSize(int width, int height); - void getNextFrameAsRgb565(uint16_t *buffer); void getNextFrameAsYuv422(uint8_t *buffer); - status_t dump(int fd, const Vector<String16>& args); + // Write to the fd a string representing the current state. + void dump(int fd) const; private: + // TODO: remove the uint16_t buffer param everywhere since it is a field of + // this class. + void getNextFrameAsRgb565(uint16_t *buffer); + void drawSquare(uint16_t *buffer, int x, int y, int size, int color, int shadow); void drawCheckerboard(uint16_t *buffer, int size); |