From patchwork Sun Mar 19 23:16:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Hunstock X-Patchwork-Id: 3021 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp1166515vsy; Sun, 19 Mar 2017 16:16:49 -0700 (PDT) X-Received: by 10.223.157.37 with SMTP id k37mr22212013wre.148.1489965409068; Sun, 19 Mar 2017 16:16:49 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f141si12521582wme.164.2017.03.19.16.16.48; Sun, 19 Mar 2017 16:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E944688312; Mon, 20 Mar 2017 01:16:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.annaberg6.de (mail.annaberg6.de [89.238.64.82]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D72A96882E5 for ; Mon, 20 Mar 2017 01:16:20 +0200 (EET) Received: (qmail 22279 invoked from network); 19 Mar 2017 23:16:38 -0000 Received: from build.erfurt.vpn.annaberg6.de (10.0.8.11) by mail.annaberg6.de with ESMTPS (AES128-SHA encrypted); 19 Mar 2017 23:16:38 -0000 From: Matthias Hunstock To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Mar 2017 00:16:36 +0100 Message-Id: <1489965397-19419-1-git-send-email-atze@fem.tu-ilmenau.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489673161-18533-1-git-send-email-atze@fem.tu-ilmenau.de> References: <1489673161-18533-1-git-send-email-atze@fem.tu-ilmenau.de> Subject: [FFmpeg-devel] [PATCH 1/2 v3] decklink: add format_code of display mode to list_format output X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Matthias Hunstock --- libavdevice/decklink_common.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp index 8b499c5..26c0776 100644 --- a/libavdevice/decklink_common.cpp +++ b/libavdevice/decklink_common.cpp @@ -33,6 +33,7 @@ extern "C" { #include "libavformat/avformat.h" #include "libavformat/internal.h" #include "libavutil/imgutils.h" +#include "libavutil/bswap.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; IDeckLinkDisplayModeIterator *itermode; IDeckLinkDisplayMode *mode; + uint32_t format_code; int i=0; HRESULT res; @@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct 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); while (itermode->Next(&mode) == S_OK) { BMDTimeValue 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", - ++i,mode->GetWidth(), mode->GetHeight(), + format_code = av_bswap32(mode->GetDisplayMode()); + 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); switch (mode->GetFieldDominance()) { case bmdLowerFieldFirst: @@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct case bmdUpperFieldFirst: av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break; } - av_log(avctx, AV_LOG_INFO, "\n"); mode->Release(); } + av_log(avctx, AV_LOG_INFO, "\n"); itermode->Release();