OpenShot Library | libopenshot 1.1.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
openshot::CameraCaptureReader Class Reference

#include <CameraCaptureReader.h>

Inheritance diagram for openshot::CameraCaptureReader:
openshot::ReaderBase

Public Member Functions

 CameraCaptureReader (const CameraCaptureSettings &settings)
 
void Close () override
 Close the reader (and any resources it was consuming)
 
CacheBase * GetCache () override
 Get the cache object used by this reader (note: not all readers use cache)
 
std::shared_ptr< openshot::Frame > GetFrame (int64_t number) override
 
CameraCaptureSettings GetSettings () const
 
openshot::CaptureReaderStats GetStats () const
 
bool IsOpen () override
 Determine if reader is open or closed.
 
std::string Json () const override
 Generate JSON string of this object.
 
Json::Value JsonValue () const override
 Generate Json::Value for this object.
 
std::string Name () override
 Return the type name of the class.
 
void Open () override
 Open the reader (and start consuming resources, such as images or video files)
 
void RequestClose ()
 Request cancellation without releasing camera resources on the caller's thread.
 
void SetJson (const std::string value) override
 Load JSON string into this object.
 
void SetJsonValue (const Json::Value root) override
 Load Json::Value into this object.
 
 ~CameraCaptureReader () override
 
- Public Member Functions inherited from openshot::ReaderBase
bool ApplyOrientationMetadata () const
 Return whether readers apply source orientation metadata to returned frames.
 
void ApplyOrientationMetadata (bool value)
 Set whether readers should apply source orientation metadata to returned frames.
 
void DisplayInfo (std::ostream *out=&std::cout)
 Display file information in the standard output stream (stdout)
 
virtual bool HardwareDecodeSuccessful () const
 
bool HasMaxDecodeSize () const
 Return true when a maximum decoded frame size is active.
 
int MaxDecodeHeight () const
 Return the current maximum decoded frame height (0 when unlimited).
 
int MaxDecodeWidth () const
 Return the current maximum decoded frame width (0 when unlimited).
 
openshot::ClipBase * ParentClip ()
 Parent clip object of this reader (which can be unparented and NULL)
 
void ParentClip (openshot::ClipBase *new_clip)
 Set parent clip object of this reader.
 
 ReaderBase ()
 Constructor for the base reader, where many things are initialized.
 
void SetMaxDecodeSize (int width, int height)
 
virtual ~ReaderBase ()=default
 

Static Public Member Functions

static CameraCaptureBackend DefaultBackend ()
 
static std::vector< CameraCaptureMode > GetDeviceModes (const std::string &device, CameraCaptureBackend backend=CAMERA_CAPTURE_AUTO)
 
static AudioDeviceList GetDeviceNames (CameraCaptureBackend backend=CAMERA_CAPTURE_AUTO)
 
static bool IsBackendSupported (CameraCaptureBackend backend)
 

Additional Inherited Members

- Public Attributes inherited from openshot::ReaderBase
openshot::ReaderInfo info
 Information about the current media file.
 
- Protected Attributes inherited from openshot::ReaderBase
bool apply_orientation_metadata
 Apply source orientation metadata while reading frames.
 
openshot::ClipBase * clip
 Pointer to the parent clip instance (if any)
 
std::recursive_mutex getFrameMutex
 Mutex for multiple threads.
 
int max_decode_height
 Optional maximum decoded frame height (0 disables the limit)
 
int max_decode_width
 Optional maximum decoded frame width (0 disables the limit)
 

Detailed Description

Definition at line 51 of file CameraCaptureReader.h.

Constructor & Destructor Documentation

◆ CameraCaptureReader()

CameraCaptureReader::CameraCaptureReader ( const CameraCaptureSettings &  settings)
explicit

Definition at line 129 of file CameraCaptureReader.cpp.

◆ ~CameraCaptureReader()

CameraCaptureReader::~CameraCaptureReader ( )
override

Definition at line 140 of file CameraCaptureReader.cpp.

Member Function Documentation

◆ Close()

void CameraCaptureReader::Close ( )
overridevirtual

Close the reader (and any resources it was consuming)

Implements openshot::ReaderBase.

Definition at line 309 of file CameraCaptureReader.cpp.

Referenced by ~CameraCaptureReader().

◆ DefaultBackend()

CameraCaptureBackend CameraCaptureReader::DefaultBackend ( )
static

◆ GetCache()

CacheBase * openshot::CameraCaptureReader::GetCache ( )
inlineoverridevirtual

Get the cache object used by this reader (note: not all readers use cache)

Implements openshot::ReaderBase.

Definition at line 60 of file CameraCaptureReader.h.

◆ GetDeviceModes()

std::vector< CameraCaptureMode > CameraCaptureReader::GetDeviceModes ( const std::string &  device,
CameraCaptureBackend  backend = CAMERA_CAPTURE_AUTO 
)
static

Query Linux V4L2 modes without starting capture. Discrete modes are exhaustive; continuous/stepwise ranges report their endpoints. Unknown formats are omitted. Other backends return an empty list. Device access/query errors throw.

Definition at line 227 of file CameraCaptureReader.cpp.

◆ GetDeviceNames()

AudioDeviceList CameraCaptureReader::GetDeviceNames ( CameraCaptureBackend  backend = CAMERA_CAPTURE_AUTO)
static

Definition at line 172 of file CameraCaptureReader.cpp.

◆ GetFrame()

std::shared_ptr< Frame > CameraCaptureReader::GetFrame ( int64_t  number)
overridevirtual

This method is required for all derived classes of ReaderBase, and returns the openshot::Frame object, which contains the image and audio information for that frame of video.

Returns
The requested frame of video
Parameters
[in]numberThe frame number that is requested.

Implements openshot::ReaderBase.

Definition at line 328 of file CameraCaptureReader.cpp.

◆ GetSettings()

CameraCaptureSettings openshot::CameraCaptureReader::GetSettings ( ) const
inline

Definition at line 71 of file CameraCaptureReader.h.

◆ GetStats()

openshot::CaptureReaderStats CameraCaptureReader::GetStats ( ) const

Definition at line 323 of file CameraCaptureReader.cpp.

◆ IsBackendSupported()

bool CameraCaptureReader::IsBackendSupported ( CameraCaptureBackend  backend)
static

Definition at line 145 of file CameraCaptureReader.cpp.

◆ IsOpen()

bool openshot::CameraCaptureReader::IsOpen ( )
inlineoverridevirtual

Determine if reader is open or closed.

Implements openshot::ReaderBase.

Definition at line 62 of file CameraCaptureReader.h.

◆ Json()

std::string CameraCaptureReader::Json ( ) const
overridevirtual

Generate JSON string of this object.

Implements openshot::ReaderBase.

Definition at line 333 of file CameraCaptureReader.cpp.

◆ JsonValue()

Json::Value CameraCaptureReader::JsonValue ( ) const
overridevirtual

Generate Json::Value for this object.

Implements openshot::ReaderBase.

Definition at line 338 of file CameraCaptureReader.cpp.

Referenced by Json().

◆ Name()

std::string openshot::CameraCaptureReader::Name ( )
inlineoverridevirtual

Return the type name of the class.

Implements openshot::ReaderBase.

Definition at line 63 of file CameraCaptureReader.h.

◆ Open()

void CameraCaptureReader::Open ( )
overridevirtual

Open the reader (and start consuming resources, such as images or video files)

Implements openshot::ReaderBase.

Definition at line 302 of file CameraCaptureReader.cpp.

◆ RequestClose()

void CameraCaptureReader::RequestClose ( )

Request cancellation without releasing camera resources on the caller's thread.

Definition at line 316 of file CameraCaptureReader.cpp.

◆ SetJson()

void CameraCaptureReader::SetJson ( const std::string  value)
overridevirtual

Load JSON string into this object.

Implements openshot::ReaderBase.

Definition at line 355 of file CameraCaptureReader.cpp.

◆ SetJsonValue()

void CameraCaptureReader::SetJsonValue ( const Json::Value  root)
overridevirtual

Load Json::Value into this object.

Implements openshot::ReaderBase.

Definition at line 364 of file CameraCaptureReader.cpp.

Referenced by SetJson().


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