MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decklink_select_input

Function decklink_select_input

libavdevice/decklink_common.cpp:127–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static int decklink_select_input(AVFormatContext *avctx, BMDDeckLinkConfigurationID cfg_id)
128{
129 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
130 struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
131 BMDDeckLinkAttributeID attr_id = (cfg_id == bmdDeckLinkConfigAudioInputConnection) ? BMDDeckLinkAudioInputConnections : BMDDeckLinkVideoInputConnections;
132 int64_t bmd_input = (cfg_id == bmdDeckLinkConfigAudioInputConnection) ? (int64_t)ctx->audio_input : (int64_t)ctx->video_input;
133 const char *type_name = (cfg_id == bmdDeckLinkConfigAudioInputConnection) ? "audio" : "video";
134 int64_t supported_connections = 0;
135 HRESULT res;
136
137 if (bmd_input) {
138 res = ctx->attr->GetInt(attr_id, &supported_connections);
139 if (res != S_OK) {
140 av_log(avctx, AV_LOG_ERROR, "Failed to query supported %s inputs.\n", type_name);
141 return AVERROR_EXTERNAL;
142 }
143 if ((supported_connections & bmd_input) != bmd_input) {
144 av_log(avctx, AV_LOG_ERROR, "Device does not support selected %s input.\n", type_name);
145 return AVERROR(ENOSYS);
146 }
147 res = ctx->cfg->SetInt(cfg_id, bmd_input);
148 if (res != S_OK) {
149 av_log(avctx, AV_LOG_ERROR, "Failed to select %s input.\n", type_name);
150 return AVERROR_EXTERNAL;
151 }
152 }
153 return 0;
154}
155
156static DECKLINK_BOOL field_order_eq(enum AVFieldOrder field_order, BMDFieldDominance bmd_field_order)
157{

Callers 2

ff_decklink_set_configsFunction · 0.85
ff_decklink_list_formatsFunction · 0.85

Calls 1

av_logFunction · 0.85

Tested by

no test coverage detected