1.10 |
Capture a camera video feed directly to an output file. More...
#include <capture.h>
Public Member Functions | |
CameraCapture (CameraCapture &&)=default | |
CameraCapture (const CameraCapture &)=delete | |
CameraCapture (const std::string &output, PixelFormat format=PixelFormat::yuyv, const std::string &device="/dev/video0") | |
~CameraCapture () override | |
CameraCapture & | operator= (CameraCapture &&)=default |
CameraCapture & | operator= (const CameraCapture &)=delete |
void | set_output (const std::string &output, const Size &size, PixelFormat format=PixelFormat::yuyv) |
Set the output. | |
bool | start () |
Initialize camera pipeline to capture from the camera. | |
void | stop () |
Stop camera capture and finish the output. | |
Public Member Functions inherited from Object | |
Object () noexcept=default | |
Object (const Object &)=delete | |
Object (Object &&)=default | |
virtual | ~Object () noexcept=default |
void | clear_handlers () |
Clear all registered event handlers. | |
void | invoke_handlers (Event &event) |
Invoke all handlers with the specified event. | |
void | invoke_handlers (EventId event) |
Invoke all handlers with the specified EventId. | |
EGT_NODISCARD const std::string & | name () const |
Get the name of the Object. | |
void | name (const std::string &name) |
Set the name of the Object. | |
RegisterHandle | on_event (const EventCallback &handler, const FilterFlags &mask={}) |
Add an event handler to be called when the widget generates an event. | |
Object & | operator= (const Object &)=delete |
Object & | operator= (Object &&)=default |
void | remove_handler (RegisterHandle handle) |
Remove an event handler. | |
Public Attributes | |
SignalW< const std::string & > | on_error |
Event signal. | |
SignalW< const std::string & > | on_connect |
Generated when an USB camera connected. | |
SignalW< const std::string & > | on_disconnect |
Generated when an USB camera disconnected. | |
Protected Attributes | |
std::unique_ptr< detail::GstDecoderImpl > | m_impl |
Internal capture implementation. | |
Protected Attributes inherited from Object | |
detail::CopyOnWriteAllocate< CallbackArray > | m_callbacks |
Array of callbacks. | |
RegisterHandle | m_handle_counter {0} |
Counter used to generate unique handles for each callback registration. | |
std::string | m_name |
A user defined name for the Object. | |
Additional Inherited Members | |
Public Types inherited from Object | |
using | EventCallback = std::function< void(Event &event)> |
Event handler callback function. | |
using | FilterFlags = FlagsBase< EventId > |
Event handler EventId filter. | |
using | RegisterHandle = uint64_t |
Handle type. | |
Protected Types inherited from Object | |
using | CallbackArray = std::vector< CallbackMeta > |
Helper type for an array of callbacks. | |
Capture a camera video feed directly to an output file.
|
explicit |
[in] | output | The output file path. |
[in] | container | The output container format. |
[in] | format | The input pixel format. |
[in] | device | The camera device. |
|
delete |
|
default |
|
override |
|
default |
|
delete |
void set_output | ( | const std::string & | output, |
const Size & | size, | ||
PixelFormat | format = PixelFormat::yuyv |
||
) |
Set the output.
[in] | output | The output file path. |
[in] | container | The output container format. |
[in] | format | The input pixel format. |
bool start | ( | ) |
Initialize camera pipeline to capture from the camera.
void stop | ( | ) |
Stop camera capture and finish the output.
|
protected |
Internal capture implementation.
SignalW<const std::string&> on_connect |
Generated when an USB camera connected.
SignalW<const std::string&> on_disconnect |
Generated when an USB camera disconnected.