1.10
capture.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_CAPTURE_H
7#define EGT_CAPTURE_H
8
14#include <egt/object.h>
15#include <egt/signal.h>
16#include <egt/types.h>
17#include <memory>
18#include <string>
19
20namespace egt
21{
22inline namespace v1
23{
24
25namespace detail
26{
27class GstDecoderImpl;
28}
29
40class EGT_API CameraCapture : public Object
41{
42protected:
43
45 std::unique_ptr<detail::GstDecoderImpl> m_impl;
46
47public:
48
57
62
75 explicit CameraCapture(const std::string& output,
76 PixelFormat format = PixelFormat::yuyv,
77 const std::string& device = "/dev/video0");
78
79 CameraCapture(const CameraCapture&) = delete;
83
94 void set_output(const std::string& output,
95 const Size& size,
96 PixelFormat format = PixelFormat::yuyv);
97
103 bool start();
104
108 void stop();
109
110 ~CameraCapture() override;
111
112};
113
114}
115}
116
117#endif
Capture a camera video feed directly to an output file.
Definition capture.h:41
SignalW< const std::string & > on_error
Event signal.
Definition capture.h:56
std::unique_ptr< detail::GstDecoderImpl > m_impl
Internal capture implementation.
Definition capture.h:45
void set_output(const std::string &output, const Size &size, PixelFormat format=PixelFormat::yuyv)
Set the output.
CameraCapture & operator=(CameraCapture &&)=default
CameraCapture & operator=(const CameraCapture &)=delete
CameraCapture(const CameraCapture &)=delete
void stop()
Stop camera capture and finish the output.
SignalW< const std::string & > on_disconnect
Generated when an USB camera disconnected.
Definition capture.h:66
CameraCapture(CameraCapture &&)=default
bool start()
Initialize camera pipeline to capture from the camera.
SignalW< const std::string & > on_connect
Generated when an USB camera connected.
Definition capture.h:61
CameraCapture(const std::string &output, PixelFormat format=PixelFormat::yuyv, const std::string &device="/dev/video0")
Base object class with fundamental properties.
Definition object.h:32
Definition signal.h:184
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24