From patchwork Fri Mar 17 00:41:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Hunstock X-Patchwork-Id: 2974 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp43506vsy; Thu, 16 Mar 2017 17:41:51 -0700 (PDT) X-Received: by 10.223.161.213 with SMTP id v21mr9635743wrv.144.1489711311294; Thu, 16 Mar 2017 17:41:51 -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 i140si863518wmd.64.2017.03.16.17.41.50; Thu, 16 Mar 2017 17:41:51 -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 27C1D68831A; Fri, 17 Mar 2017 02:41:21 +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 89F906882CD for ; Fri, 17 Mar 2017 02:41:14 +0200 (EET) Received: (qmail 4597 invoked from network); 17 Mar 2017 00:41:31 -0000 Received: from build.erfurt.vpn.annaberg6.de (10.0.8.11) by mail.annaberg6.de with ESMTPS (AES128-SHA encrypted); 17 Mar 2017 00:41:31 -0000 From: Matthias Hunstock To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Mar 2017 01:41:28 +0100 Message-Id: <1489711290-20707-2-git-send-email-atze@fem.tu-ilmenau.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489711290-20707-1-git-send-email-atze@fem.tu-ilmenau.de> References: <1489673161-18533-1-git-send-email-atze@fem.tu-ilmenau.de> <1489711290-20707-1-git-send-email-atze@fem.tu-ilmenau.de> Subject: [FFmpeg-devel] [PATCH 1/3 v2] 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..82b3a0c 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; + BMDDisplayMode 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();