Unified · Split
| @@ -33,6 +33,7 @@ extern "C" { · 32 unmodified lines | |||
| 33 | #include "libavformat/avformat.h" | 33 | #include "libavformat/avformat.h" |
| 34 | #include "libavformat/internal.h" | 34 | #include "libavformat/internal.h" |
| 35 | #include "libavutil/imgutils.h" | 35 | #include "libavutil/imgutils.h" |
| 36 | #include "libavutil/bswap.h" | ||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | #include "decklink_common.h" | 39 | #include "decklink_common.h" |
| @@ -276,6 +277,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 237 unmodified lines | |||
| 276 | struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; | 277 | struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; |
| 277 | IDeckLinkDisplayModeIterator *itermode; | 278 | IDeckLinkDisplayModeIterator *itermode; |
| 278 | IDeckLinkDisplayMode *mode; | 279 | IDeckLinkDisplayMode *mode; |
| 280 | uint32_t format_code; | ||
| 279 | int i=0; | 281 | int i=0; |
| 280 | HRESULT res; | 282 | HRESULT res; |
| 281 | 283 | ||
| @@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 15 unmodified lines | |||
| 297 | return AVERROR(EIO); | 299 | return AVERROR(EIO); |
| 298 | } | 300 | } |
| 299 | 301 | ||
| 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", |
| 301 | avctx->filename); | 303 | avctx->filename); |
| 302 | while (itermode->Next(&mode) == S_OK) { | 304 | while (itermode->Next(&mode) == S_OK) { |
| 303 | BMDTimeValue tb_num, tb_den; | 305 | BMDTimeValue tb_num, tb_den; |
| 304 | mode->GetFrameRate(&tb_num, &tb_den); | 306 | mode->GetFrameRate(&tb_num, &tb_den); |
| 305 | av_log(avctx, AV_LOG_INFO, "\t%d\t%ldx%ld at %d/%d fps", | 307 | format_code = av_bswap32(mode->GetDisplayMode()); |
| 306 | ++i,mode->GetWidth(), mode->GetHeight(), | 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(), | ||
| 307 | (int) tb_den, (int) tb_num); | 310 | (int) tb_den, (int) tb_num); |
| 308 | switch (mode->GetFieldDominance()) { | 311 | switch (mode->GetFieldDominance()) { |
| 309 | case bmdLowerFieldFirst: | 312 | case bmdLowerFieldFirst: |
| @@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct · 1 unmodified line | |||
| 311 | case bmdUpperFieldFirst: | 314 | case bmdUpperFieldFirst: |
| 312 | av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break; | 315 | av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break; |
| 313 | } | 316 | } |
| 314 | av_log(avctx, AV_LOG_INFO, "\n"); | ||
| 315 | mode->Release(); | 317 | mode->Release(); |
| 316 | } | 318 | } |
| 319 | av_log(avctx, AV_LOG_INFO, "\n"); | ||
| 317 | 320 | ||
| 318 | itermode->Release(); | 321 | itermode->Release(); |
| 319 | 322 | ||