00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WEBCAMVIDEOCURSORV4L_H
00016 #define WEBCAMVIDEOCURSORV4L_H
00017
00018 #include "pandabase.h"
00019
00020 #ifdef HAVE_VIDEO4LINUX
00021
00022 #include "webcamVideo.h"
00023
00024 struct v4l2_format;
00025
00026 #if defined(HAVE_JPEG)
00027 struct jpeg_decompress_struct;
00028 #endif
00029
00030 class WebcamVideoV4L;
00031
00032
00033
00034
00035
00036 class WebcamVideoCursorV4L : public MovieVideoCursor {
00037 public:
00038 WebcamVideoCursorV4L(WebcamVideoV4L *src);
00039 virtual ~WebcamVideoCursorV4L();
00040 virtual PT(Buffer) fetch_buffer();
00041
00042 private:
00043 int _fd;
00044 void **_buffers;
00045 size_t *_buflens;
00046 size_t _bufcount;
00047 struct v4l2_format *_format;
00048 #ifdef HAVE_JPEG
00049 struct jpeg_decompress_struct *_cinfo;
00050 #endif
00051
00052 public:
00053 static TypeHandle get_class_type() {
00054 return _type_handle;
00055 }
00056 static void init_type() {
00057 MovieVideoCursor::init_type();
00058 register_type(_type_handle, "WebcamVideoCursorV4L",
00059 MovieVideoCursor::get_class_type());
00060 }
00061 virtual TypeHandle get_type() const {
00062 return get_class_type();
00063 }
00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00065
00066 private:
00067 static TypeHandle _type_handle;
00068 };
00069
00070 #endif // HAVE_VIDEO4LINUX
00071
00072 #endif