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         int mStreamId;
33         bool mOutput; // if false then input buffer
34         Rect mCrop;
35         uint32_t mTransform;
36         uint32_t mScalingMode;
37         int64_t mTimestamp;
38         uint64_t mFrameNumber;
39         bool mError;
40     };
41 
42     // Buffer was acquired by the HAL
43     virtual void onBufferAcquired(const BufferInfo& bufferInfo) = 0;
44     // Buffer was released by the HAL
45     virtual void onBufferReleased(const BufferInfo& bufferInfo) = 0;
46     // Notify about incoming buffer request frame number
47     virtual void onBufferRequestForFrameNumber(uint64_t frameNumber, int streamId,
48             const CameraMetadata& settings) = 0;
49 };
50 
51 }; //namespace camera3
52 }; //namespace android
53 
54 #endif
55