mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 19:40:24 +00:00
decklink disp.: implemented timeout
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#define IF_NOT_NULL_ELSE(val, default_val) ((val) ? (val) : (default_val))
|
||||
#define UNDEF -1
|
||||
#define IF_NOT_UNDEF_ELSE(val, default_val) ((val) != UNDEF ? (val) : (default_val))
|
||||
#define DIV_ROUNDED_UP(value, div) ((((value) % (div)) != 0) ? ((value) / (div) + 1) : ((value) / (div)))
|
||||
|
||||
/**
|
||||
* @brief Creates FourCC word
|
||||
|
||||
@@ -576,7 +576,7 @@ static void update_timecode(DeckLinkTimecode *tc, double fps)
|
||||
tc->SetBCD(bcd);
|
||||
}
|
||||
|
||||
static int display_decklink_putf(void *state, struct video_frame *frame, long long flag)
|
||||
static int display_decklink_putf(void *state, struct video_frame *frame, long long timeout_ns)
|
||||
{
|
||||
struct state_decklink *s = (struct state_decklink *)state;
|
||||
|
||||
@@ -587,8 +587,9 @@ static int display_decklink_putf(void *state, struct video_frame *frame, long lo
|
||||
|
||||
uint32_t i;
|
||||
s->state.at(0).deckLinkOutput->GetBufferedVideoFrameCount(&i);
|
||||
if ((flag == PUTF_NONBLOCK && i > 2) || flag == PUTF_DISCARD) {
|
||||
if (flag == PUTF_NONBLOCK) {
|
||||
long long max_frames = DIV_ROUNDED_UP(timeout_ns, (long long)(NS_IN_SEC / frame->fps));
|
||||
if (timeout_ns == PUTF_DISCARD || i > max_frames) {
|
||||
if (timeout_ns != PUTF_DISCARD) {
|
||||
log_msg(LOG_LEVEL_WARNING, MOD_NAME "Frame dropped!\n");
|
||||
}
|
||||
for (int j = 0; j < s->devices_cnt; ++j) {
|
||||
|
||||
Reference in New Issue
Block a user