Panda3D
webcamVideoV4L.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file webcamVideoV4L.h
10  * @author rdb
11  * @date 2010-06-11
12  */
13 
14 #ifndef WEBCAMVIDEOV4L_H
15 #define WEBCAMVIDEOV4L_H
16 
17 #include "pandabase.h"
18 
19 #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER)
20 
21 #include "webcamVideo.h"
22 
23 class WebcamVideoCursorV4L;
24 
25 /**
26  * The Video4Linux implementation of webcams.
27  */
28 class WebcamVideoV4L : public WebcamVideo {
29 private:
30  virtual PT(MovieVideoCursor) open();
31 
32  friend class WebcamVideoCursorV4L;
33  friend void find_all_webcams_v4l();
34  static void add_options_for_size(int fd, const std::string &dev, const char *name,
35  unsigned width, unsigned height,
36  unsigned pixelformat);
37 
38  std::string _device;
39  uint32_t _pformat;
40 
41 public:
42  static TypeHandle get_class_type() {
43  return _type_handle;
44  }
45  static void init_type() {
46  WebcamVideo::init_type();
47  register_type(_type_handle, "WebcamVideoV4L",
48  WebcamVideo::get_class_type());
49  }
50  virtual TypeHandle get_type() const {
51  return get_class_type();
52  }
53  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
54 
55 private:
56  static TypeHandle _type_handle;
57 };
58 
59 #endif // HAVE_VIDEO4LINUX
60 
61 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Allows you to open a webcam or other video capture device as a video stream.
Definition: webcamVideo.h:23
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:81