Signed-off-by: Marton Balint <cus@passwd.hu>
#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b050000
if (direction == DIRECTION_IN) {
BMDDisplayMode actualMode = ctx->bmd_mode;
#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b050000
if (direction == DIRECTION_IN) {
BMDDisplayMode actualMode = ctx->bmd_mode;
- if (ctx->dli->DoesSupportVideoMode(ctx->video_input, ctx->bmd_mode, (BMDPixelFormat) cctx->raw_format,
+ if (ctx->dli->DoesSupportVideoMode(ctx->video_input, ctx->bmd_mode, ctx->raw_format,
bmdNoVideoInputConversion, bmdSupportedVideoModeDefault,
&actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode)
return -1;
bmdNoVideoInputConversion, bmdSupportedVideoModeDefault,
&actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode)
return -1;
return 0;
#elif BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
if (direction == DIRECTION_IN) {
return 0;
#elif BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
if (direction == DIRECTION_IN) {
- if (ctx->dli->DoesSupportVideoMode(ctx->video_input, ctx->bmd_mode, (BMDPixelFormat) cctx->raw_format,
+ if (ctx->dli->DoesSupportVideoMode(ctx->video_input, ctx->bmd_mode, ctx->raw_format,
bmdSupportedVideoModeDefault,
&support) != S_OK)
return -1;
bmdSupportedVideoModeDefault,
&support) != S_OK)
return -1;
return 0;
#else
if (direction == DIRECTION_IN) {
return 0;
#else
if (direction == DIRECTION_IN) {
- if (ctx->dli->DoesSupportVideoMode(ctx->bmd_mode, (BMDPixelFormat) cctx->raw_format,
+ if (ctx->dli->DoesSupportVideoMode(ctx->bmd_mode, ctx->raw_format,
bmdVideoOutputFlagDefault,
&support, NULL) != S_OK)
return -1;
bmdVideoOutputFlagDefault,
&support, NULL) != S_OK)
return -1;
ctx->video_pts_source = cctx->video_pts_source;
ctx->draw_bars = cctx->draw_bars;
ctx->audio_depth = cctx->audio_depth;
ctx->video_pts_source = cctx->video_pts_source;
ctx->draw_bars = cctx->draw_bars;
ctx->audio_depth = cctx->audio_depth;
+ ctx->raw_format = (BMDPixelFormat)cctx->raw_format;
cctx->ctx = ctx;
/* Check audio channel option for valid values: 2, 8 or 16 */
cctx->ctx = ctx;
/* Check audio channel option for valid values: 2, 8 or 16 */
st->time_base.num = ctx->bmd_tb_num;
st->r_frame_rate = av_make_q(st->time_base.den, st->time_base.num);
st->time_base.num = ctx->bmd_tb_num;
st->r_frame_rate = av_make_q(st->time_base.den, st->time_base.num);
- switch((BMDPixelFormat)cctx->raw_format) {
+ switch(ctx->raw_format) {
case bmdFormat8BitYUV:
st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
st->codecpar->codec_tag = MKTAG('U', 'Y', 'V', 'Y');
case bmdFormat8BitYUV:
st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
st->codecpar->codec_tag = MKTAG('U', 'Y', 'V', 'Y');
st->codecpar->bits_per_coded_sample = 10;
break;
default:
st->codecpar->bits_per_coded_sample = 10;
break;
default:
- av_log(avctx, AV_LOG_ERROR, "Raw Format %.4s not supported\n", (char*) &cctx->raw_format);
+ char fourcc_str[AV_FOURCC_MAX_STRING_SIZE] = {0};
+ av_fourcc_make_string(fourcc_str, ctx->raw_format);
+ av_log(avctx, AV_LOG_ERROR, "Raw Format %s not supported\n", fourcc_str);
ret = AVERROR(EINVAL);
goto error;
}
ret = AVERROR(EINVAL);
goto error;
}
}
result = ctx->dli->EnableVideoInput(ctx->bmd_mode,
}
result = ctx->dli->EnableVideoInput(ctx->bmd_mode,
- (BMDPixelFormat) cctx->raw_format,
bmdVideoInputFlagDefault);
if (result != S_OK) {
bmdVideoInputFlagDefault);
if (result != S_OK) {