38#ifndef BLACKMAGIC_COMMON_HPP
39#define BLACKMAGIC_COMMON_HPP
45#include "DeckLinkAPI_h.h"
47#include "DeckLinkAPI.h"
69 {
R12L, bmdFormat12BitRGBLE },
70 {
R10k, bmdFormat10BitRGBX },
71 {
v210, bmdFormat10BitYUV },
72 {
RGBA, bmdFormat8BitBGRA },
73 {
UYVY, bmdFormat8BitYUV },
79#define BMD_FALSE FALSE
83#define BMD_FALSE false
106 [[nodiscard]]
bool is_help()
const;
113 void parse(
const char *);
118 bool device_write(IDeckLinkConfiguration *deckLinkConfiguration, BMDDeckLinkConfigurationID opt, std::string
const &log_prefix =
"[DeckLink] ")
const;
124#define BMD_STR CFStringRef
128#define BMD_STR const char *
155std::ostream &
operator<<(std::ostream &output, REFIID iid);
157#define BMD_CHECK(cmd, name, action) \
159 HRESULT result = cmd;\
160 if (FAILED(result)) {;\
161 LOG(LOG_LEVEL_ERROR) << MOD_NAME << name << ": " << bmd_hresult_to_string(result) << "\n";\
167#define R10K_FULL_OPT "bmd-r10k-full-range"
168#define BMD_NAT_SORT "bmd-sort-natural"
180 const char *query_prop_fcc);
189using bmd_dev = std::tuple<std::unique_ptr<IDeckLink, void (*)(IDeckLink *)>,
190 unsigned,
int,
char>;
193 bool natural_sort =
false);
const char unsigned int flags
std::string bmd_get_audio_connection_name(BMDAudioOutputAnalogAESSwitch audioConnection)
bool bmd_parse_audio_levels(const char *opt) noexcept(false)
TOREMOVE (implicit "aacl" option is preferred)
BMD_STR get_bmd_api_str_from_cstr(const char *cstr)
template bool decklink_supports_codec< IDeckLinkOutput >(IDeckLinkOutput *deckLink, BMDPixelFormat pf)
bool blackmagic_api_version_check()
IDeckLinkIterator * create_decklink_iterator(bool *com_initialized, bool verbose=true)
const std::map< BMDVideoConnection, std::string > & get_connection_string_map()
void print_bmd_device_profiles(const char *line_prefix)
std::ostream & operator<<(std::ostream &output, const bmd_option &b)
std::string bmd_hresult_to_string(HRESULT res)
static std::vector< std::pair< codec_t, BMDPixelFormat > > uv_to_bmd_codec_map
void release_bmd_api_str(BMD_STR string)
void print_bmd_attribute(IDeckLinkProfileAttributes *deckLinkAttributes, const char *query_prop_fcc)
std::tuple< std::unique_ptr< IDeckLink, void(*)(IDeckLink *)>, unsigned, int, char > bmd_dev
std::string bmd_get_device_name(IDeckLink *decklink)
void print_decklink_version(void)
std::vector< bmd_dev > bmd_get_sorted_devices(bool *com_initialized, bool verbose=true, bool natural_sort=false)
void decklink_uninitialize(bool *com_initialized)
bool decklink_set_profile(IDeckLink *deckLink, bmd_option const &req_profile, bool stereo)
std::string get_str_from_bmd_api_str(BMD_STR string)
void r10k_full_to_limited(const char *in, char *out, size_t len)
bool bmd_check_stereo_profile(IDeckLink *deckLink)
template bool decklink_supports_codec< IDeckLinkInput >(IDeckLinkInput *deckLink, BMDPixelFormat pf)
char * get_cstr_from_bmd_api_str(BMD_STR string)
std::string bmd_get_flags_str(BMDDisplayModeFlags flags)
bool decklink_supports_codec(T *deckLink, BMDPixelFormat pf)
uint32_t bmd_read_fourcc(const char *)
void r10k_limited_to_full(const char *in, char *out, size_t len)
const char * get_string() const
void set_string(const char *val_)
enum bmd_option::type_tag m_type
bool m_user_specified
ignore errors if set to false
void set_int(int64_t val_)
friend std::ostream & operator<<(std::ostream &output, const bmd_option &b)
bool device_write(IDeckLinkConfiguration *deckLinkConfiguration, BMDDeckLinkConfigurationID opt, std::string const &log_prefix="[DeckLink] ") const
union bmd_option::@11 m_val
void set_float(double val_)
@ R10k
RGB 10-bit packed - RGBX, big-endian (2 bit padding)
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
@ R12L
RGB 12-bit packed, little-endian.
@ RGBA
RGBA 8-bit, big-endian.
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
This is an umbrella header for video functions.