History

avdevice/decklink: add format_code of display mode to list_format output

Matthias Hunstock committed 9 years ago

Commit 607bffb1 parent 9365dfc1 file · +7 −4Browse files

Showing the changes to libavdevice/decklink_common.cpp (1 of 1 file). Show all

Unified · Split

libavdevice/decklink_common.cpp+7−4
@@ -33,6 +33,7 @@ extern "C" { · 32 unmodified lines
3333 #include "libavformat/avformat.h"
3434 #include "libavformat/internal.h"
3535 #include "libavutil/imgutils.h"
36+#include "libavutil/bswap.h"
3637 }
3738
3839 #include "decklink_common.h"
@@ -276,6 +277,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 237 unmodified lines
276277 struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
277278 IDeckLinkDisplayModeIterator *itermode;
278279 IDeckLinkDisplayMode *mode;
280+ uint32_t format_code;
279281 int i=0;
280282 HRESULT res;
281283
@@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 15 unmodified lines
297299 return AVERROR(EIO);
298300 }
299301
300− av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n",
302+ av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n\tmode\tformat_code\tdescription",
301303 avctx->filename);
302304 while (itermode->Next(&mode) == S_OK) {
303305 BMDTimeValue tb_num, tb_den;
304306 mode->GetFrameRate(&tb_num, &tb_den);
305− av_log(avctx, AV_LOG_INFO, "\t%d\t%ldx%ld at %d/%d fps",
306− ++i,mode->GetWidth(), mode->GetHeight(),
307+ format_code = av_bswap32(mode->GetDisplayMode());
308+ av_log(avctx, AV_LOG_INFO, "\n\t%d\t%.4s\t\t%ldx%ld at %d/%d fps",
309+ ++i, (char*) &format_code, mode->GetWidth(), mode->GetHeight(),
307310 (int) tb_den, (int) tb_num);
308311 switch (mode->GetFieldDominance()) {
309312 case bmdLowerFieldFirst:
@@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 1 unmodified line
311314 case bmdUpperFieldFirst:
312315 av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
313316 }
314− av_log(avctx, AV_LOG_INFO, "\n");
315317 mode->Release();
316318 }
319+ av_log(avctx, AV_LOG_INFO, "\n");
317320
318321 itermode->Release();
319322

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t