13cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian/* 23cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Copyright (C) 2008 The Android Open Source Project 33cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * 43cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License"); 53cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * you may not use this file except in compliance with the License. 63cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * You may obtain a copy of the License at 73cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * 83cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * http://www.apache.org/licenses/LICENSE-2.0 93cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * 103cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * Unless required by applicable law or agreed to in writing, software 113cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS, 123cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * See the License for the specific language governing permissions and 143cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian * limitations under the License. 153cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian */ 163cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 173cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#ifndef ANDROID_HARDWARE_ICAMERA_APP_H 183cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#define ANDROID_HARDWARE_ICAMERA_APP_H 193cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 203cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <utils/RefBase.h> 213cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <binder/IInterface.h> 223cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <binder/Parcel.h> 233cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <binder/IMemory.h> 243cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#include <utils/Timers.h> 2557c86189bc07d9ccb0fd044e66df736d0bf19639Wu-cheng Li#include <system/camera.h> 263cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 273cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopiannamespace android { 28d56db1d2bee182d1851097a9c712712fc094d117Eino-Ville Talvalanamespace hardware { 293cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 30f51fca277eb5b86bd0b2e3fc90ecb2b63089de29Eino-Ville Talvalaclass ICameraClient: public android::IInterface 313cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{ 323cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic: 333cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian DECLARE_META_INTERFACE(CameraClient); 343cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 353cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian virtual void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) = 0; 3657c86189bc07d9ccb0fd044e66df736d0bf19639Wu-cheng Li virtual void dataCallback(int32_t msgType, const sp<IMemory>& data, 3757c86189bc07d9ccb0fd044e66df736d0bf19639Wu-cheng Li camera_frame_metadata_t *metadata) = 0; 383cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian virtual void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& data) = 0; 392d13b1d3eeaba31d8c15acc6037fd68b150a9a66Chien-Yu Chen 402d13b1d3eeaba31d8c15acc6037fd68b150a9a66Chien-Yu Chen // Invoked to send a recording frame handle with a timestamp. Call 412d13b1d3eeaba31d8c15acc6037fd68b150a9a66Chien-Yu Chen // ICamera::releaseRecordingFrameHandle to release the frame handle. 422d13b1d3eeaba31d8c15acc6037fd68b150a9a66Chien-Yu Chen virtual void recordingFrameHandleCallbackTimestamp(nsecs_t timestamp, 432d13b1d3eeaba31d8c15acc6037fd68b150a9a66Chien-Yu Chen native_handle_t* handle) = 0; 44b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh 45b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh // Invoked to send a batch of recording frame handles with timestamp. Call 46b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh // ICamera::releaseRecordingFrameHandleBatch to release the frame handles. 47b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh // Size of timestamps and handles must match 48b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh virtual void recordingFrameHandleCallbackTimestampBatch( 49b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh const std::vector<nsecs_t>& timestamps, 50b5df547bce900fa5764d735bee304e79c001d60dYin-Chia Yeh const std::vector<native_handle_t*>& handles) = 0; 513cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; 523cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 533cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian// ---------------------------------------------------------------------------- 543cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 55f51fca277eb5b86bd0b2e3fc90ecb2b63089de29Eino-Ville Talvalaclass BnCameraClient: public android::BnInterface<ICameraClient> 563cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{ 573cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic: 583cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian virtual status_t onTransact( uint32_t code, 593cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian const Parcel& data, 603cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian Parcel* reply, 613cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian uint32_t flags = 0); 623cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; 633cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 64d56db1d2bee182d1851097a9c712712fc094d117Eino-Ville Talvala} // namespace hardware 65d56db1d2bee182d1851097a9c712712fc094d117Eino-Ville Talvala} // namespace android 663cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 673cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#endif 68