1 /*
2  * Copyright (C) 2013 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_SERVERS_CAMERA3_STREAMBUFFERLISTENER_H
18 #define ANDROID_SERVERS_CAMERA3_STREAMBUFFERLISTENER_H
19 
20 #include <camera/CameraMetadata.h>
21 #include <gui/Surface.h>
22 #include <utils/RefBase.h>
23 
24 namespace android {
25 
26 namespace camera3 {
27 
28 class Camera3StreamBufferListener : public virtual RefBase {
29 public:
30 
31     struct BufferInfo {
32         bool mOutput; // if false then input buffer
33         Rect mCrop;
34         uint32_t mTransform;
35         uint32_t mScalingMode;
36         int64_t mTimestamp;
37         uint64_t mFrameNumber;
38         bool mError;
39     };
40 
41     // Buffer was acquired by the HAL
42     virtual void onBufferAcquired(const BufferInfo& bufferInfo) = 0;
43     // Buffer was released by the HAL
44     virtual void onBufferReleased(const BufferInfo& bufferInfo) = 0;
45     // Notify about incoming buffer request frame number
46     virtual void onBufferRequestForFrameNumber(uint64_t frameNumber, int streamId,
47             const CameraMetadata& settings) = 0;
48 };
49 
50 }; //namespace camera3
51 }; //namespace android
52 
53 #endif
54