camera-common.h revision 4ed09fd35085c96ae8edbda87757187f75eeac8d
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_CAMERA_CAMERA_COMMON_H_
18#define ANDROID_CAMERA_CAMERA_COMMON_H_
19
20/*
21 * Contains declarations of platform-independent the stuff that is used in
22 * camera emulation.
23 */
24
25#ifdef _WIN32
26/* Include declarations that are missing in Windows SDK headers. */
27#include "android/camera/camera-win.h"
28#endif  /* _WIN32 */
29
30/* Describes a connected camera device.
31 * This is a pratform-independent camera device descriptor that is used in
32 * the camera API. This descriptor also contains some essential camera
33 * properties, so the client of this API can use them to properly prepare to
34 * handle frame capturing.
35 */
36typedef struct CameraDevice {
37    /* Opaque pointer used by the camera capturing API. */
38    void*       opaque;
39    /* Frame's width in number of pixels. */
40    int         width;
41    /* Frame's height in number of pixels. */
42    int         height;
43    /* Number of bytes encoding each pixel. */
44    uint32_t    bpp;
45    /* Number of bytes encoding each line. */
46    uint32_t    bpl;
47    /* Pixel format of the frame captured from the camera device. */
48    uint32_t    pixel_format;
49    /* Total size in bytes of the framebuffer. */
50    size_t      framebuffer_size;
51} CameraDevice;
52
53#endif  /* ANDROID_CAMERA_CAMERA_COMMON_H_ */
54