openshot::DecklinkReader Class Reference

This class uses the Blackmagic Decklink libraries, to open video streams on Blackmagic devices. More...

`#include <DecklinkReader.h>`

Inheritance diagram for openshot::DecklinkReader:

## Public Member Functions

void | Close ()
| Destructor. More...
| DecklinkReader (int device, int video_mode, int pixel_format, int channels, int sample_depth)
CacheMemory * | GetCache ()
| Get the cache object used by this reader (always returns NULL for this reader) More...
unsigned long | GetCurrentFrameNumber ()
std::shared_ptr< Frame > | GetFrame (int64_t requested_frame)
bool | IsOpen ()
| Determine if reader is open or closed. More...
std::string | Json () const override
| Get and Set JSON methods. More...
Json::Value | JsonValue () const
| Generate Json::Value for this object. More...
std::string | Name ()
| Return the type name of the class. More...
void | Open ()
| Open device and video stream - which is called by the constructor automatically. More...
void | SetJson (const std::string value)
| Load JSON string into this object. More...
void | SetJsonValue (const Json::Value root)
| Load Json::Value into this object. More...
| ~DecklinkReader ()
Public Member Functions inherited from openshot::ReaderBase
void | DisplayInfo ()
| Display file information in the standard output stream (stdout) More...
openshot::ClipBase * | GetClip ()
| Parent clip object of this reader (which can be unparented and NULL) More...
| ReaderBase ()
| Constructor for the base reader, where many things are initialized. More...
void | SetClip (openshot::ClipBase *clip)
| Set parent clip object of this reader. More...
virtual | ~ReaderBase ()=default

## Additional Inherited Members

Public Attributes inherited from openshot::ReaderBase
openshot::ReaderInfo | info
| Information about the current media file. More...
Protected Attributes inherited from openshot::ReaderBase
juce::CriticalSection | getFrameCriticalSection
| Section lock for multiple threads. More...
openshot::ClipBase * | parent
juce::CriticalSection | processingCriticalSection

## Detailed Description

This class uses the Blackmagic Decklink libraries, to open video streams on Blackmagic devices.

This requires special hardware manufactured by Blackmagic Designs. Once the device is acquired and connected, this reader returns openshot::Frame objects containing the image and audio data.

Definition at line 62 of file DecklinkReader.h.

## Constructor & Destructor Documentation

## DecklinkReader()

DecklinkReader::DecklinkReader | ( | int | device,
|  | int | video_mode,
|  | int | pixel_format,
|  | int | channels,
|  | int | sample_depth
| ) |  |

Constructor for DecklinkReader. This automatically opens the device and loads the first second of video, or it throws one of the following exceptions.

Definition at line 35 of file DecklinkReader.cpp.

## ~DecklinkReader()

DecklinkReader::~DecklinkReader | ( |  | ) |

Definition at line 147 of file DecklinkReader.cpp.

## Member Function Documentation

## Close()

void DecklinkReader::Close | ( |  | ) |

virtual

Destructor.

Close the device and video stream

Implements openshot::ReaderBase.

Definition at line 215 of file DecklinkReader.cpp.

Referenced by SetJsonValue().

## GetCache()

CacheMemory* openshot::DecklinkReader::GetCache | ( |  | ) |

inline virtual

Get the cache object used by this reader (always returns NULL for this reader)

Implements openshot::ReaderBase.

Definition at line 104 of file DecklinkReader.h.

## GetCurrentFrameNumber()

unsigned long DecklinkReader::GetCurrentFrameNumber | ( |  | ) |

Definition at line 231 of file DecklinkReader.cpp.

## GetFrame()

std::shared_ptr< Frame > DecklinkReader::GetFrame | ( | int64_t | requested_frame | ) |

virtual

Get an openshot::Frame object for a specific frame number of this reader. Frame number is ignored, since it always gets the latest LIVE frame.

Returns
  The requested frame (containing the image)

Parameters

  requested_frame | The frame number that is requested.

Implements openshot::ReaderBase.

Definition at line 237 of file DecklinkReader.cpp.

## IsOpen()

bool openshot::DecklinkReader::IsOpen | ( |  | ) |

inline virtual

Determine if reader is open or closed.

Implements openshot::ReaderBase.

Definition at line 115 of file DecklinkReader.h.

## Json()

std::string DecklinkReader::Json | ( |  | ) | const

override virtual

Get and Set JSON methods.

Generate JSON string of this object

Implements openshot::ReaderBase.

Definition at line 249 of file DecklinkReader.cpp.

## JsonValue()

Json::Value DecklinkReader::JsonValue | ( |  | ) | const

virtual

Generate Json::Value for this object.

Implements openshot::ReaderBase.

Definition at line 256 of file DecklinkReader.cpp.

Referenced by Json().

## Name()

std::string openshot::DecklinkReader::Name | ( |  | ) |

inline virtual

Return the type name of the class.

Implements openshot::ReaderBase.

Definition at line 118 of file DecklinkReader.h.

## Open()

void DecklinkReader::Open | ( |  | ) |

virtual

Open device and video stream - which is called by the constructor automatically.

Implements openshot::ReaderBase.

Definition at line 172 of file DecklinkReader.cpp.

Referenced by SetJsonValue().

## SetJson()

void DecklinkReader::SetJson | ( | const std::string | value | ) |

virtual

Load JSON string into this object.

Implements openshot::ReaderBase.

Definition at line 267 of file DecklinkReader.cpp.

## SetJsonValue()

void DecklinkReader::SetJsonValue | ( | const Json::Value | root | ) |

virtual

Load Json::Value into this object.

Implements openshot::ReaderBase.

Definition at line 284 of file DecklinkReader.cpp.

Referenced by SetJson().

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

- DecklinkReader.h
- DecklinkReader.cpp