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 303cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass ICameraClient: public 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; 443cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; 453cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 463cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian// ---------------------------------------------------------------------------- 473cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 483cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianclass BnCameraClient: public BnInterface<ICameraClient> 493cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian{ 503cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopianpublic: 513cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian virtual status_t onTransact( uint32_t code, 523cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian const Parcel& data, 533cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian Parcel* reply, 543cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian uint32_t flags = 0); 553cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian}; 563cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 57d56db1d2bee182d1851097a9c712712fc094d117Eino-Ville Talvala} // namespace hardware 58d56db1d2bee182d1851097a9c712712fc094d117Eino-Ville Talvala} // namespace android 593cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian 603cf613507f1e2f7bd932d921a6e222e426fd3be4Mathias Agopian#endif 61