DeckLink cap: pretty print mode

align:
- mode indices
- FPS
- flags (color-space first, because it is always present; 3D after)
This commit is contained in:
Martin Pulec
2023-04-14 15:17:36 +02:00
parent f5de0458e3
commit d2aaef7942
2 changed files with 5 additions and 5 deletions

View File

@@ -661,11 +661,11 @@ string bmd_get_audio_connection_name(BMDAudioOutputAnalogAESSwitch audioConnecti
string bmd_get_flags_str(BMDDisplayModeFlags flags) {
bool first = true;
ostringstream oss;
map<uint32_t, const char *> map {
{ bmdDisplayModeSupports3D, "3D" },
vector<pair<uint32_t, const char *>> map {
{ bmdDisplayModeColorspaceRec601, "Rec601" },
{ bmdDisplayModeColorspaceRec709, "Rec709" },
{ bmdDisplayModeColorspaceRec2020, "Rec2020" }
{ bmdDisplayModeColorspaceRec2020, "Rec2020" },
{ bmdDisplayModeSupports3D, "3D" },
};
for (auto &f : map ) {

View File

@@ -1693,7 +1693,7 @@ static list<tuple<int, string, string, string>> get_input_modes (IDeckLink* deck
string fcc{(char *) &mode, 4};
string name{displayModeCString};
char buf[1024];
snprintf(buf, sizeof buf, "%d x %d \t %2.2f FPS %.4s, flags: %s", modeWidth, modeHeight,
snprintf(buf, sizeof buf, "%d x %d \t %6.2f FPS \t flags: %.4s, %s", modeWidth, modeHeight,
(float) ((double)frameRateScale / (double)frameRateDuration),
(char *) &field_dominance_n, flags_str.c_str());
string details{buf};
@@ -1722,7 +1722,7 @@ static void print_input_modes (IDeckLink* deckLink)
list<tuple<int, string, string, string>> ret = get_input_modes (deckLink);
printf("\tcapture modes:\n");
for (auto &i : ret) {
col() << "\t\t" << right << setw(2) << SBOLD(get<0>(i) << " (" << get<1>(i) << ")") << ") " <<
col() << "\t\t" << right << SBOLD(setw(2) << get<0>(i) << " (" << get<1>(i) << ")") << ") " <<
left << setw(20) << get<2>(i) << internal << " " <<
get<3>(i) << "\n";
}