1 /* 2 * atomisp_device.h - atomisp device 3 * 4 * Copyright (c) 2014-2015 Intel Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Wind Yuan <feng.yuan@intel.com> 19 */ 20 21 #ifndef XCAM_ATOMISP_DEVICE_H 22 #define XCAM_ATOMISP_DEVICE_H 23 24 #include <xcam_std.h> 25 #include "v4l2_device.h" 26 #if HAVE_LIBDRM 27 #include "drm_display.h" 28 #endif 29 30 namespace XCam { 31 32 #if HAVE_LIBDRM 33 class DrmDisplay; 34 #endif 35 36 class AtomispDevice 37 : public V4l2Device 38 { 39 friend class DrmV4l2Buffer; 40 41 public: 42 explicit AtomispDevice (const char *name = NULL); 43 ~AtomispDevice (); 44 45 #if HAVE_LIBDRM set_drm_display(SmartPtr<DrmDisplay> & drm_disp)46 void set_drm_display(SmartPtr<DrmDisplay> &drm_disp) { 47 _drm_disp = drm_disp; 48 }; 49 #endif 50 51 protected: 52 virtual XCamReturn pre_set_format (struct v4l2_format &format); 53 virtual XCamReturn allocate_buffer ( 54 SmartPtr<V4l2Buffer> &buf, 55 const struct v4l2_format &format, 56 const uint32_t index); 57 58 private: 59 XCAM_DEAD_COPY (AtomispDevice); 60 61 #if HAVE_LIBDRM 62 private: 63 SmartPtr<DrmDisplay> _drm_disp; 64 #endif 65 }; 66 67 }; 68 69 #endif //XCAM_ATOMISP_DEVICE_H 70