• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * uvc_device.h - uvc 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: Sameer Kibey <sameer.kibey@intel.com>
19  */
20 
21 #ifndef XCAM_UVC_DEVICE_H
22 #define XCAM_UVC_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 UVCDevice
37     : public V4l2Device
38 {
39     friend class DrmV4l2Buffer;
40 
41 public:
42     explicit UVCDevice (const char *name = NULL);
43     ~UVCDevice ();
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 allocate_buffer (
53         SmartPtr<V4l2Buffer> &buf,
54         const struct v4l2_format &format,
55         const uint32_t index);
56 
57 private:
58     XCAM_DEAD_COPY (UVCDevice);
59 
60 #if HAVE_LIBDRM
61 private:
62     SmartPtr<DrmDisplay> _drm_disp;
63 #endif
64 };
65 
66 };
67 
68 #endif //XCAM_UVC_DEVICE_H
69