1 /* 2 * fake_v4l2_device.h - fake v4l2 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: Jia Meng <jia.meng@intel.com> 19 */ 20 21 #ifndef XCAM_FAKE_V4L2_DEVICE_H 22 #define XCAM_FAKE_V4L2_DEVICE_H 23 24 #include <v4l2_device.h> 25 26 namespace XCam { 27 28 class FakeV4l2Device 29 : public V4l2Device 30 { 31 public: FakeV4l2Device()32 FakeV4l2Device () 33 : V4l2Device ("/dev/null") 34 {} 35 io_control(int cmd,void * arg)36 int io_control (int cmd, void *arg) 37 { 38 XCAM_UNUSED (arg); 39 40 int ret = 0; 41 switch (cmd) { 42 case VIDIOC_ENUM_FMT: 43 ret = -1; 44 break; 45 default: 46 break; 47 } 48 return ret; 49 } 50 }; 51 52 }; 53 #endif // XCAM_FAKE_V4L2_DEVICE_H 54