blob: 1ff6c619c2232d61178ff729cf13cff47f7b9cf1 [file] [log] [blame]
Eddie James21b177e2018-12-11 13:14:46 -06001#pragma once
2
3#include "ikvm_input.hpp"
4
5#include <string>
6
7namespace ikvm
8{
9
10/*
11 * @class Video
12 * @brief Sets up the V4L2 video device and performs read operations
13 */
14class Video
15{
16 public:
17 /*
18 * @brief Constructs Video object
19 *
20 * @param[in] p - Path to the V4L2 video device
21 * @param[in] input - Reference to the Input object
22 * @param[in] fr - desired frame rate of the video
23 */
24 Video(const std::string& p, Input& input, int fr = 30);
25 ~Video();
26 Video(const Video&) = default;
27 Video& operator=(const Video&) = default;
28 Video(Video&&) = default;
29 Video& operator=(Video&&) = default;
30
31 /*
32 * @brief Gets the height of the video frame
33 *
34 * @return Value of the height of video frame in pixels
35 */
36 inline size_t getHeight() const
37 {
38 return height;
39 }
40 /*
41 * @brief Gets the width of the video frame
42 *
43 * @return Value of the width of video frame in pixels
44 */
45 inline size_t getWidth() const
46 {
47 return width;
48 }
49
50 private:
51 /* @brief Height in pixels of the video frame */
52 size_t height;
53 /* @brief Width in pixels of the video frame */
54 size_t width;
55 /* @brief Reference to the Input object */
56 Input& input;
57 /* @brief Path to the V4L2 video device */
58 const std::string path;
59};
60
61} // namespace ikvm