mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 01:40:28 +00:00
DeckLink cap.: default audio BPS is 2 (originally 4)
When uncompressed it requires less bandwidth and it is more suitable for compression and/or further processing. + fail if audio BPS or sample rate is invalid rather than displaying only a warning + removed unused FRAME_TIMEOUT
This commit is contained in:
@@ -75,7 +75,7 @@
|
|||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "video_capture.h"
|
#include "video_capture.h"
|
||||||
|
|
||||||
#define FRAME_TIMEOUT 60000000 // 30000000 // in nanoseconds
|
constexpr const int DEFAULT_AUDIO_BPS = 2;
|
||||||
constexpr const size_t MAX_AUDIO_PACKETS = 10;
|
constexpr const size_t MAX_AUDIO_PACKETS = 10;
|
||||||
#define MOD_NAME "[DeckLink capture] "
|
#define MOD_NAME "[DeckLink capture] "
|
||||||
|
|
||||||
@@ -1088,16 +1088,16 @@ vidcap_decklink_init(struct vidcap_params *params, void **state)
|
|||||||
fprintf(stderr, "[Decklink capture] Unexpected audio flag encountered.\n");
|
fprintf(stderr, "[Decklink capture] Unexpected audio flag encountered.\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
if (audio_capture_bps == 2) {
|
s->audio.bps = audio_capture_bps == 0 ? DEFAULT_AUDIO_BPS : audio_capture_bps;
|
||||||
s->audio.bps = 2;
|
if (s->audio.bps != 2 && s->audio.bps != 4) {
|
||||||
} else {
|
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Unsupported audio Bps " << audio_capture_bps << "! Supported is 2 or 4 bytes only!\n";
|
||||||
if (audio_capture_bps != 4 && audio_capture_bps != 0) {
|
delete s;
|
||||||
log_msg(LOG_LEVEL_WARNING, "[Decklink] Ignoring unsupported Bps!\n");
|
return VIDCAP_INIT_FAIL;
|
||||||
}
|
|
||||||
s->audio.bps = 4;
|
|
||||||
}
|
}
|
||||||
if (audio_capture_sample_rate != 0 && audio_capture_sample_rate != 48000) {
|
if (audio_capture_sample_rate != 0 && audio_capture_sample_rate != 48000) {
|
||||||
log_msg(LOG_LEVEL_WARNING, "[Decklink] Ignoring unsupported sample rate!\n");
|
LOG(LOG_LEVEL_ERROR) << MOD_NAME "Unsupported sample rate " << audio_capture_sample_rate << "! Only 48000 is supported.\n";
|
||||||
|
delete s;
|
||||||
|
return VIDCAP_INIT_FAIL;
|
||||||
}
|
}
|
||||||
s->audio.sample_rate = 48000;
|
s->audio.sample_rate = 48000;
|
||||||
s->audio.ch_count = audio_capture_channels > 0 ? audio_capture_channels : DEFAULT_AUDIO_CAPTURE_CHANNELS;
|
s->audio.ch_count = audio_capture_channels > 0 ? audio_capture_channels : DEFAULT_AUDIO_CAPTURE_CHANNELS;
|
||||||
|
|||||||
Reference in New Issue
Block a user