avdevice/decklink: add format_code of display mode to list_format output
Signed-off-by: Matthias Hunstock <atze@fem.tu-ilmenau.de> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
9365dfcbf6
commit
607bffbed2
@ -33,6 +33,7 @@ extern "C" {
|
|||||||
#include "libavformat/avformat.h"
|
#include "libavformat/avformat.h"
|
||||||
#include "libavformat/internal.h"
|
#include "libavformat/internal.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
|
#include "libavutil/bswap.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "decklink_common.h"
|
#include "decklink_common.h"
|
||||||
@ -276,6 +277,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct
|
|||||||
struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
|
struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
|
||||||
IDeckLinkDisplayModeIterator *itermode;
|
IDeckLinkDisplayModeIterator *itermode;
|
||||||
IDeckLinkDisplayMode *mode;
|
IDeckLinkDisplayMode *mode;
|
||||||
|
uint32_t format_code;
|
||||||
int i=0;
|
int i=0;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
|
|
||||||
@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct
|
|||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n",
|
av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n\tmode\tformat_code\tdescription",
|
||||||
avctx->filename);
|
avctx->filename);
|
||||||
while (itermode->Next(&mode) == S_OK) {
|
while (itermode->Next(&mode) == S_OK) {
|
||||||
BMDTimeValue tb_num, tb_den;
|
BMDTimeValue tb_num, tb_den;
|
||||||
mode->GetFrameRate(&tb_num, &tb_den);
|
mode->GetFrameRate(&tb_num, &tb_den);
|
||||||
av_log(avctx, AV_LOG_INFO, "\t%d\t%ldx%ld at %d/%d fps",
|
format_code = av_bswap32(mode->GetDisplayMode());
|
||||||
++i,mode->GetWidth(), mode->GetHeight(),
|
av_log(avctx, AV_LOG_INFO, "\n\t%d\t%.4s\t\t%ldx%ld at %d/%d fps",
|
||||||
|
++i, (char*) &format_code, mode->GetWidth(), mode->GetHeight(),
|
||||||
(int) tb_den, (int) tb_num);
|
(int) tb_den, (int) tb_num);
|
||||||
switch (mode->GetFieldDominance()) {
|
switch (mode->GetFieldDominance()) {
|
||||||
case bmdLowerFieldFirst:
|
case bmdLowerFieldFirst:
|
||||||
@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct
|
|||||||
case bmdUpperFieldFirst:
|
case bmdUpperFieldFirst:
|
||||||
av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
|
av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
|
||||||
}
|
}
|
||||||
av_log(avctx, AV_LOG_INFO, "\n");
|
|
||||||
mode->Release();
|
mode->Release();
|
||||||
}
|
}
|
||||||
|
av_log(avctx, AV_LOG_INFO, "\n");
|
||||||
|
|
||||||
itermode->Release();
|
itermode->Release();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user