![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include "DeckLinkAPI.h"#include <cctype>#include <cstdbool>#include <cstdint>#include <map>#include <memory>#include <tuple>#include <vector>#include <string>#include <type_traits>#include <utility>#include "utils/macros.h"#include "video.h"

Go to the source code of this file.
Classes | |
| struct | bmd_option |
Macros | |
| #define | BMD_BOOL bool |
| #define | BMD_CHECK(cmd, name, action) |
| #define | BMD_FALSE false |
| #define | BMD_NAT_SORT "bmd-sort-natural" |
| #define | BMD_STR const char * |
| #define | BMD_TRUE true |
| #define | R10K_FULL_OPT "bmd-r10k-full-range" |
Typedefs | |
| using | bmd_dev |
Enumerations | |
| enum | { BMD_MAX_AUD_CH = 64 } |
Functions | |
| bool | blackmagic_api_version_check () |
| bool | bmd_check_stereo_profile (IDeckLink *deckLink) |
| std::string | bmd_get_audio_connection_name (BMDAudioOutputAnalogAESSwitch audioConnection) |
| std::string | bmd_get_device_name (IDeckLink *decklink) |
| std::string | bmd_get_flags_str (BMDDisplayModeFlags flags) |
| std::vector< bmd_dev > | bmd_get_sorted_devices (bool *com_initialized, bool verbose=true, bool natural_sort=false) |
| std::string | bmd_hresult_to_string (HRESULT res) |
| bool | bmd_parse_audio_levels (const char *opt) noexcept(false) |
| TOREMOVE (implicit "aacl" option is preferred) | |
| uint32_t | bmd_read_fourcc (const char *) |
| IDeckLinkIterator * | create_decklink_iterator (bool *com_initialized, bool verbose=true) |
| bool | decklink_set_profile (IDeckLink *deckLink, bmd_option const &req_profile, bool stereo) |
| template<typename T > | |
| bool | decklink_supports_codec (T *deckLink, BMDPixelFormat pf) |
| template bool | decklink_supports_codec< IDeckLinkInput > (IDeckLinkInput *deckLink, BMDPixelFormat pf) |
| template bool | decklink_supports_codec< IDeckLinkOutput > (IDeckLinkOutput *deckLink, BMDPixelFormat pf) |
| void | decklink_uninitialize (bool *com_initialized) |
| BMD_STR | get_bmd_api_str_from_cstr (const char *cstr) |
| const std::map< BMDVideoConnection, std::string > & | get_connection_string_map () |
| char * | get_cstr_from_bmd_api_str (BMD_STR string) |
| std::string | get_str_from_bmd_api_str (BMD_STR string) |
| std::ostream & | operator<< (std::ostream &output, const bmd_option &b) |
| std::ostream & | operator<< (std::ostream &output, REFIID iid) |
| void | print_bmd_attribute (IDeckLinkProfileAttributes *deckLinkAttributes, const char *query_prop_fcc) |
| void | print_bmd_device_profiles (const char *line_prefix) |
| void | print_decklink_version (void) |
| void | r10k_full_to_limited (const char *in, char *out, size_t len) |
| void | r10k_limited_to_full (const char *in, char *out, size_t len) |
| void | release_bmd_api_str (BMD_STR string) |
Variables | |
| static std::vector< std::pair< codec_t, BMDPixelFormat > > | uv_to_bmd_codec_map |
Definition in file blackmagic_common.hpp.
| #define BMD_BOOL bool |
Definition at line 81 of file blackmagic_common.hpp.
Referenced by decklink_get_active_profile_id(), decklink_supports_codec(), display_decklink_init(), display_decklink_reconfigure(), device_state::init(), print_bmd_attribute(), and ProfileCallback::WaitForProfileActivation().
| #define BMD_CHECK | ( | cmd, | |
| name, | |||
| action ) |
Definition at line 157 of file blackmagic_common.hpp.
Referenced by decklink_set_profile(), and device_state::init().
| #define BMD_FALSE false |
Definition at line 83 of file blackmagic_common.hpp.
Referenced by decklink_get_active_profile_id(), display_decklink_init(), display_decklink_reconfigure(), device_state::init(), and ProfileCallback::WaitForProfileActivation().
| #define BMD_NAT_SORT "bmd-sort-natural" |
Definition at line 168 of file blackmagic_common.hpp.
Referenced by decklink_help(), and show_help().
| #define BMD_STR const char * |
Definition at line 128 of file blackmagic_common.hpp.
Referenced by bmd_get_device_name(), bmd_option::device_write(), get_bmd_api_str_from_cstr(), get_input_modes(), get_mode(), device_state::init(), print_bmd_attribute(), print_decklink_version(), print_output_modes(), and set_display_mode_properties().
| #define BMD_TRUE true |
Definition at line 82 of file blackmagic_common.hpp.
Referenced by display_decklink_init(), and display_decklink_reconfigure().
| #define R10K_FULL_OPT "bmd-r10k-full-range" |
Definition at line 167 of file blackmagic_common.hpp.
Referenced by display_decklink_putf(), display_decklink_reconfigure(), postprocess_frame(), and vidcap_decklink_state::set_codec().
| using bmd_dev |
parameters:
Definition at line 189 of file blackmagic_common.hpp.
| anonymous enum |
| Enumerator | |
|---|---|
| BMD_MAX_AUD_CH | |
Definition at line 86 of file blackmagic_common.hpp.
| bool blackmagic_api_version_check | ( | ) |
Definition at line 202 of file blackmagic_common.cpp.
References cleanup(), com_initialize(), decklink_uninitialize(), FAILED, LOG_LEVEL_ERROR, log_msg(), and print_decklink_version().
Referenced by display_decklink_init(), and vidcap_decklink_init().

| bool bmd_check_stereo_profile | ( | IDeckLink * | deckLink | ) |
Definition at line 509 of file blackmagic_common.cpp.
References decklink_get_active_profile_id(), LOG_LEVEL_ERROR, LOG_LEVEL_INFO, log_msg(), and MOD_NAME.
Referenced by device_state::check_attributes(), and display_decklink_reconfigure().

| std::string bmd_get_audio_connection_name | ( | BMDAudioOutputAnalogAESSwitch | audioConnection | ) |
Definition at line 903 of file blackmagic_common.cpp.
| std::string bmd_get_device_name | ( | IDeckLink * | decklink | ) |
Definition at line 522 of file blackmagic_common.cpp.
References BMD_STR, get_cstr_from_bmd_api_str(), and release_bmd_api_str().
Referenced by decklink_help(), display_decklink_init(), display_decklink_probe(), device_state::init(), show_help(), and vidcap_decklink_probe().

| std::string bmd_get_flags_str | ( | BMDDisplayModeFlags | flags | ) |
Definition at line 914 of file blackmagic_common.cpp.
Referenced by get_input_modes(), and print_output_modes().
| std::vector< bmd_dev > bmd_get_sorted_devices | ( | bool * | com_initialized, |
| bool | verbose, | ||
| bool | natural_sort ) |
| verbose | - print errors |
| natural_sort | - use the (old) natural sort as given by the iterator |
Definition at line 1106 of file blackmagic_common.cpp.
References create_decklink_iterator().
Referenced by decklink_help(), display_decklink_init(), display_decklink_probe(), device_state::init(), show_help(), and vidcap_decklink_probe().

| std::string bmd_hresult_to_string | ( | HRESULT | res | ) |
Definition at line 85 of file blackmagic_common.cpp.
References HRESULT_GET_ERROR_COMMON.
Referenced by decklink_get_active_profile_id(), decklink_set_profile(), decklink_supports_codec(), bmd_option::device_write(), display_decklink_init(), display_decklink_reconfigure(), get_input_modes(), GetDeckLinkProfileID(), device_state::init(), print_bmd_attribute(), set_audio_props(), set_display_mode_properties(), vidcap_decklink_done(), and VideoDelegate::VideoInputFormatChanged().
| bool bmd_parse_audio_levels | ( | const char * | opt | ) |
TOREMOVE (implicit "aacl" option is preferred)
Definition at line 1020 of file blackmagic_common.cpp.
References MSG.
Referenced by parse_option(), and settings_init().
| uint32_t bmd_read_fourcc | ( | const char * | str | ) |
Definition at line 537 of file blackmagic_common.cpp.
Referenced by device_state::init(), bmd_option::parse(), parse_option(), and settings_init().
| IDeckLinkIterator * create_decklink_iterator | ( | bool * | com_initialized, |
| bool | verbose ) |
| [out] | com_initialized | pointer to be passed to decklnk_uninitialize (keeps information if COM needs to be unintialized) |
Definition at line 171 of file blackmagic_common.cpp.
References com_initialize(), decklink_uninitialize(), FAILED, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, and log_msg().
Referenced by bmd_get_sorted_devices().

| bool decklink_set_profile | ( | IDeckLink * | deckLink, |
| bmd_option const & | req_profile, | ||
| bool | stereo ) |
| a | value from BMDProfileID or bmdDuplexHalf (maximize number of IOs) |
Definition at line 399 of file blackmagic_common.cpp.
References BMD_CHECK, bmd_hresult_to_string(), cleanup(), EXIT_IF_FAILED, bmd_option::get_int(), bmd_option::is_default(), bmd_option::is_help(), LOG, LOG_LEVEL_ERROR, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNING, MOD_NAME, print_bmd_device_profiles(), RELEASE_IF_NOT_NULL, and ProfileCallback::WaitForProfileActivation().
Referenced by display_decklink_init(), display_decklink_reconfigure(), and device_state::init().

| bool decklink_supports_codec | ( | T * | deckLink, |
| BMDPixelFormat | pf ) |
This function returns true if any display mode and any output supports the codec. The codec, however, may not be supported with actual video mode.
Definition at line 979 of file blackmagic_common.cpp.
References BMD_BOOL, bmd_hresult_to_string(), FAILED, and MSG.
Referenced by display_decklink_get_property(), print_output_modes(), and vidcap_decklink_print_card_info().

|
extern |
|
extern |
| void decklink_uninitialize | ( | bool * | com_initialized | ) |
| com_initialized | - pointer passed to create_decklink_iterator |
Definition at line 197 of file blackmagic_common.cpp.
References com_uninitialize().
Referenced by blackmagic_api_version_check(), create_decklink_iterator(), decklink_help(), display_decklink_done(), display_decklink_probe(), show_help(), and vidcap_decklink_probe().

| BMD_STR get_bmd_api_str_from_cstr | ( | const char * | cstr | ) |
Definition at line 125 of file blackmagic_common.cpp.
References BMD_STR.
Referenced by bmd_option::device_write().
| const std::map< BMDVideoConnection, std::string > & get_connection_string_map | ( | ) |
Definition at line 948 of file blackmagic_common.cpp.
Referenced by bmd_option::device_write(), parse_option(), vidcap_decklink_print_card_info(), and vidcap_decklink_probe().
| char * get_cstr_from_bmd_api_str | ( | BMD_STR | bmd_string | ) |
returned c-sring needs to be freed when not used
Definition at line 104 of file blackmagic_common.cpp.
References len.
Referenced by bmd_get_device_name(), get_str_from_bmd_api_str(), and print_decklink_version().
| std::string get_str_from_bmd_api_str | ( | BMD_STR | string | ) |
Definition at line 155 of file blackmagic_common.cpp.
References get_cstr_from_bmd_api_str().
Referenced by get_input_modes(), get_mode(), device_state::init(), print_bmd_attribute(), print_output_modes(), and set_display_mode_properties().

| std::ostream & operator<< | ( | std::ostream & | output, |
| const bmd_option & | b ) |
Definition at line 100 of file blackmagic_common.cpp.
| std::ostream & operator<< | ( | std::ostream & | output, |
| REFIID | iid ) |
Definition at line 547 of file blackmagic_common.cpp.
References flags.
| void print_bmd_attribute | ( | IDeckLinkProfileAttributes * | deckLinkAttributes, |
| const char * | query_prop_fcc ) |
Definition at line 1036 of file blackmagic_common.cpp.
References BMD_BOOL, bmd_hresult_to_string(), BMD_STR, get_str_from_bmd_api_str(), key, LOG, LOG_LEVEL_ERROR, min, MOD_NAME, release_bmd_api_str(), and SBOLD.
Referenced by print_output_modes(), and vidcap_decklink_print_card_info().

| void print_bmd_device_profiles | ( | const char * | line_prefix | ) |
Definition at line 939 of file blackmagic_common.cpp.
References color_printf(), kDeviceProfiles, and TBOLD.
Referenced by decklink_help(), decklink_set_profile(), and show_help().

| void print_decklink_version | ( | void | ) |
Definition at line 249 of file blackmagic_common.cpp.
References BMD_STR, cleanup(), com_initialize(), com_uninitialize(), FAILED, get_cstr_from_bmd_api_str(), and release_bmd_api_str().
Referenced by blackmagic_api_version_check(), decklink_help(), and show_help().

| void r10k_full_to_limited | ( | const char * | in, |
| char * | out, | ||
| size_t | len ) |
converts from full range (4-1019) to 64-960
in and out pointers can point to the same address
Definition at line 892 of file blackmagic_common.cpp.
References apply_r10k_lut(), DEBUG_TIMER_START, DEBUG_TIMER_STOP, fill_full_to_limited_lut(), len, r10k_limited_to_full(), and respawn_parallel().
Referenced by display_decklink_putf().

| void r10k_limited_to_full | ( | const char * | in, |
| char * | out, | ||
| size_t | len ) |
converts from range 64-960 to 4-1019
in and out pointers can point to the same address
Definition at line 869 of file blackmagic_common.cpp.
References apply_r10k_lut(), DEBUG_TIMER_START, DEBUG_TIMER_STOP, fill_limited_to_full_lut(), len, r10k_limited_to_full(), and respawn_parallel().
Referenced by postprocess_frame(), r10k_full_to_limited(), and r10k_limited_to_full().

| void release_bmd_api_str | ( | BMD_STR | string | ) |
Definition at line 141 of file blackmagic_common.cpp.
Referenced by bmd_get_device_name(), bmd_option::device_write(), get_input_modes(), get_mode(), device_state::init(), print_bmd_attribute(), print_decklink_version(), print_output_modes(), and set_display_mode_properties().
|
static |
Definition at line 68 of file blackmagic_common.hpp.
Referenced by decklink_help(), display_decklink_get_property(), display_decklink_reconfigure(), device_state::init(), print_output_modes(), set_display_mode_properties(), show_help(), and vidcap_decklink_print_card_info().