Panda3D
 All Classes Functions Variables Enumerations
webcamVideoV4L.h
1 // Filename: webcamVideoV4L.h
2 // Created by: rdb (11Jun2010)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef WEBCAMVIDEOV4L_H
16 #define WEBCAMVIDEOV4L_H
17 
18 #include "pandabase.h"
19 
20 #ifdef HAVE_VIDEO4LINUX
21 
22 #include "webcamVideo.h"
23 
24 class WebcamVideoCursorV4L;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : WebcamVideoV4L
28 // Description : The Video4Linux implementation of webcams.
29 ////////////////////////////////////////////////////////////////////
30 class WebcamVideoV4L : public WebcamVideo {
31 private:
32  virtual PT(MovieVideoCursor) open();
33 
34  friend class WebcamVideoCursorV4L;
35  friend void find_all_webcams_v4l();
36  static void add_options_for_size(int fd, const string &dev, const char *name,
37  unsigned width, unsigned height,
38  unsigned pixelformat);
39 
40  string _device;
41  uint32_t _pformat;
42 
43 public:
44  static TypeHandle get_class_type() {
45  return _type_handle;
46  }
47  static void init_type() {
48  WebcamVideo::init_type();
49  register_type(_type_handle, "WebcamVideoV4L",
50  WebcamVideo::get_class_type());
51  }
52  virtual TypeHandle get_type() const {
53  return get_class_type();
54  }
55  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
56 
57 private:
58  static TypeHandle _type_handle;
59 };
60 
61 #endif // HAVE_VIDEO4LINUX
62 
63 #endif
Allows you to open a webcam or other video capture device as a video stream.
Definition: webcamVideo.h:25
A MovieVideo is actually any source that provides a sequence of video frames.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85