| 1 | #include <cvd/Linux/v4lbuffer.h> |
| 2 | #include <cvd/videosource.h> |
| 3 | namespace CVD |
| 4 | { |
| 5 | |
| 6 | template <> |
| 7 | VideoBuffer<byte>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 8 | { |
| 9 | return new V4LBuffer<byte>(dev, size, input, interlaced, 0, verbose); |
| 10 | } |
| 11 | |
| 12 | template <> |
| 13 | VideoBuffer<bayer_grbg>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 14 | { |
| 15 | #ifdef V4L2_PIX_FMT_SBGGR8 |
| 16 | return new V4LBuffer<bayer_grbg>(dev, size, input, interlaced, 0, verbose); |
| 17 | #else |
| 18 | throw VideoSourceException("Bayer video grabbing is not available in this kernel version."); |
| 19 | #endif |
| 20 | } |
| 21 | |
| 22 | template <> |
| 23 | VideoBuffer<yuv422>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 24 | { |
| 25 | return new V4LBuffer<yuv422>(dev, size, input, interlaced, 0, verbose); |
| 26 | } |
| 27 | template <> |
| 28 | VideoBuffer<vuy422>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 29 | { |
| 30 | return new V4LBuffer<vuy422>(dev, size, input, interlaced, 0, verbose); |
| 31 | } |
| 32 | template <> |
| 33 | VideoBuffer<Rgb<byte>>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 34 | { |
| 35 | return new V4LBuffer<Rgb<byte>>(dev, size, input, interlaced, 0, verbose); |
| 36 | } |
| 37 | |
| 38 | template <> |
| 39 | VideoBuffer<Rgb8>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 40 | { |
| 41 | return new V4LBuffer<Rgb8>(dev, size, input, interlaced, 0, verbose); |
| 42 | } |
| 43 | |
| 44 | template <> |
| 45 | VideoBuffer<yuv420p>* makeV4LBuffer(const std::string& dev, const ImageRef& size, int input, bool interlaced, bool verbose) |
| 46 | { |
| 47 | return new V4LBuffer<yuv420p>(dev, size, input, interlaced, 0, verbose); |
| 48 | } |
| 49 | } |