blob: e35a0546ba09a666f8fb03ed865fb75dd7294476 [file] [log] [blame]
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001/*
2 * Copyright (C) 2008 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_HARDWARE_CAMERA_PARAMETERS_H
18#define ANDROID_HARDWARE_CAMERA_PARAMETERS_H
19
20#include <utils/KeyedVector.h>
21#include <utils/String8.h>
22
23namespace android {
24
25class CameraParameters
26{
27public:
28 CameraParameters();
29 CameraParameters(const String8 &params) { unflatten(params); }
30 ~CameraParameters();
31
32 String8 flatten() const;
33 void unflatten(const String8 &params);
34
35 void set(const char *key, const char *value);
36 void set(const char *key, int value);
37 const char *get(const char *key) const;
38 int getInt(const char *key) const;
39
40 /* preview-size=176x144 */
41 void setPreviewSize(int width, int height);
42 void getPreviewSize(int *width, int *height) const;
43
44 /* preview-fps=15 */
45 void setPreviewFrameRate(int fps);
46 int getPreviewFrameRate() const;
47
48 /* preview-format=rgb565|yuv422 */
49 void setPreviewFormat(const char *format);
50 const char *getPreviewFormat() const;
51
52 /* picture-size=1024x768 */
53 void setPictureSize(int width, int height);
54 void getPictureSize(int *width, int *height) const;
55
56 /* picture-format=yuv422|jpeg */
57 void setPictureFormat(const char *format);
58 const char *getPictureFormat() const;
59
60 void dump() const;
61 status_t dump(int fd, const Vector<String16>& args) const;
62
63private:
64 DefaultKeyedVector<String8,String8> mMap;
65};
66
67
68}; // namespace android
69
70#endif