Banuba SDK
Loading...
Searching...
No Matches
bnb::camera_base Class Referenceabstract
Inheritance diagram for bnb::camera_base:
bnb::camera_base_mocker bnb::camera_ocv bnb::camera_video_mocker

Public Types

enum class  camera_format { RGBA , YUV }
 
using push_frame_cb_t = std::function<void(bnb::full_image_t image)>
 

Public Member Functions

 camera_base (push_frame_cb_t cb)
 
virtual void set_device_by_index (uint32_t index)=0
 
virtual void set_device_by_id (const std::string &device_id)=0
 
virtual void start ()=0
 
const std::vector< camera_device_descriptionget_connected_devices () const
 
size_t get_current_device_index () const
 

Static Public Attributes

static camera_format current_format = camera_format::RGBA
 

Protected Member Functions

virtual void abort ()
 

Protected Attributes

push_frame_cb_t m_push_frame_cb
 
std::atomic_bool m_is_abort_requested
 
std::vector< camera_device_descriptionm_connected_devices
 
size_t m_device_index
 

Detailed Description

Definition at line 23 of file base.hpp.

Member Typedef Documentation

◆ push_frame_cb_t

using bnb::camera_base::push_frame_cb_t = std::function<void(bnb::full_image_t image)>

Definition at line 26 of file base.hpp.

Member Enumeration Documentation

◆ camera_format

enum class bnb::camera_base::camera_format
strong

Definition at line 28 of file base.hpp.

29 {
30 RGBA,
31 YUV
32 };

Constructor & Destructor Documentation

◆ camera_base()

bnb::camera_base::camera_base ( push_frame_cb_t cb)
inlineexplicit

Definition at line 38 of file base.hpp.

39 : m_push_frame_cb(std::move(cb))
40 , m_is_abort_requested(false)
41 , m_device_index(0)
42 {
43 }

Member Function Documentation

◆ abort()

virtual void bnb::camera_base::abort ( )
inlineprotectedvirtual

Definition at line 63 of file base.hpp.

64 {
65 m_is_abort_requested = true;
66 }

◆ get_connected_devices()

const std::vector< camera_device_description > bnb::camera_base::get_connected_devices ( ) const
inline

Definition at line 48 of file base.hpp.

49 {
50 return m_connected_devices;
51 }

◆ get_current_device_index()

size_t bnb::camera_base::get_current_device_index ( ) const
inline

Definition at line 52 of file base.hpp.

53 {
54 return m_device_index;
55 }

Member Data Documentation

◆ current_format

camera_format bnb::camera_base::current_format = camera_format::RGBA
inlinestatic

Definition at line 33 of file base.hpp.

◆ m_connected_devices

std::vector<camera_device_description> bnb::camera_base::m_connected_devices
protected

Definition at line 71 of file base.hpp.

◆ m_device_index

size_t bnb::camera_base::m_device_index
protected

Definition at line 72 of file base.hpp.

◆ m_is_abort_requested

std::atomic_bool bnb::camera_base::m_is_abort_requested
protected

Definition at line 70 of file base.hpp.

◆ m_push_frame_cb

push_frame_cb_t bnb::camera_base::m_push_frame_cb
protected

Definition at line 69 of file base.hpp.


The documentation for this class was generated from the following file: