blob: 5bcbe153fcfa4e001779cbbac8d6ab1177f0a8c0 [file] [log] [blame]
Yin-Chia Yehb97babb2015-03-12 13:42:44 -07001/*
2 * Copyright (C) 2015 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_CAMERA2_OUTPUTCONFIGURATION_H
18#define ANDROID_HARDWARE_CAMERA2_OUTPUTCONFIGURATION_H
19
20#include <utils/RefBase.h>
21#include <gui/IGraphicBufferProducer.h>
22
23namespace android {
24
25class Surface;
26
27class OutputConfiguration : public virtual RefBase {
28public:
29
30 static const int INVALID_ROTATION;
31 sp<IGraphicBufferProducer> getGraphicBufferProducer() const;
32 int getRotation() const;
33
34 /**
35 * Keep impl up-to-date with OutputConfiguration.java in frameworks/base
36 */
37 status_t writeToParcel(Parcel& parcel) const;
38 // getGraphicBufferProducer will be NULL if error occurred
39 // getRotation will be INVALID_ROTATION if error occurred
40 OutputConfiguration(const Parcel& parcel);
41
Ruben Brunk3450ba72015-06-16 11:00:37 -070042 OutputConfiguration(sp<IGraphicBufferProducer>& gbp, int rotation);
43
Yin-Chia Yehb97babb2015-03-12 13:42:44 -070044private:
45 sp<IGraphicBufferProducer> mGbp;
46 int mRotation;
47
48 // helper function
49 static String16 readMaybeEmptyString16(const Parcel& parcel);
50};
51}; // namespace android
52
53#endif