From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5A47A40E10 for ; Fri, 25 Mar 2022 14:11:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6C91668B246; Fri, 25 Mar 2022 16:11:32 +0200 (EET) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69C1168B236 for ; Fri, 25 Mar 2022 16:11:26 +0200 (EET) Received: by mail-lj1-f170.google.com with SMTP id bn33so10486658ljb.6 for ; Fri, 25 Mar 2022 07:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LW/EbX2KWXbhPhbIjpmltDxDeHXCpAZI7M1lQWdynps=; b=Vse7ufvyttyK/axHRNxVICPe6wxeg71batPrzDHCwtTHJwVuBWtaTdgcy4RCeGSSil XPU/hde07KDfmlG9nGSKv/j8uGsJuPdTalBX4FH0bv6dMrhVFi+1eVGqN1CNi7K3RfsQ fND9O8Hyx2vgJD8WLFJ8Xqwnv28/vaeN4dnB1YABLABGqFVrfplmj1/4cP3NR2vbobb4 Eio4PUS2iooglLnRspw8ZNceATKDoap/m7YkeHG+u4oGVBxCi0yU6h55cDLyXfoGkgcn ob4EzdAG4HqC7NGnvfcsTjFKbKmOJAw2XiluTy+rSqiQqax5z832yVaimR3KbhkrrP0f D68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LW/EbX2KWXbhPhbIjpmltDxDeHXCpAZI7M1lQWdynps=; b=yK70zlmdcQk5DdfXMcb5FaMXVSylzrTQY+Gq0xjrj4Jm9iSPSQqQ28J7hxLbctuyeR Z7xDS7dxX4tCf50QCdrA40n0Q4hs3xqbBu4Mp/LZhtx7JJqzdyWK9NfIUObeQHh9W5/U TJLWHhMoPs1tHid9LOMks7mxeD7DwU8v8goM+k88nc6E1MlIaA5RG69CrzAKCi6LO48x JpIfLrdHnQOCYNC1lAfgsuqHweH6FBpa2oAV7dKcp+KFllSbyem1FabfOYxK3iMstCmB OpzS9AuqMKF7RnkR+yMB0rfDBw/7vuscqeaO+p4+KJqn67lNgdGlKd6XP2s7Bagv3xKA l9Ow== X-Gm-Message-State: AOAM530Q31C5pMeZpbNoF3sOluUVGCyAg/27HJLpPSRr4B1PPVn5WA13 O9A9RFJbe9/x5JzFRmpsxE0X/tlQ0D4= X-Google-Smtp-Source: ABdhPJwDycJgUp0vrZ9PoqpsHWEhoYZtHuX0QiEPJeRAOVZGvmO/5QJ7UzunRlOL7Y6Rr9rpkfLMMQ== X-Received: by 2002:a2e:81cc:0:b0:247:ea38:28e7 with SMTP id s12-20020a2e81cc000000b00247ea3828e7mr8356025ljg.203.1648217485426; Fri, 25 Mar 2022 07:11:25 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id f25-20020a056512323900b0044a39b6e1adsm719797lfe.171.2022.03.25.07.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 07:11:24 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Mar 2022 15:10:22 +0100 Message-Id: <20220325141041.1748-4-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220325141041.1748-1-dcnieho@gmail.com> References: <20220325141041.1748-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 03/22] avformat: add control_message function to AVInputFormat X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Diederick Niehorster Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Control messages are useful for programmatic control of not only outdevs but also indevs. Bumping avformat version. Signed-off-by: Diederick Niehorster --- libavdevice/avdevice.c | 8 +++++--- libavformat/avformat.h | 6 ++++++ libavformat/version.h | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 9b684251aa..617c28d725 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -66,9 +66,11 @@ const char * avdevice_license(void) int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type, void *data, size_t data_size) { - if (!s->oformat || !s->oformat->control_message) - return AVERROR(ENOSYS); - return s->oformat->control_message(s, type, data, data_size); + if (s->oformat && s->oformat->control_message) + return s->oformat->control_message(s, type, data, data_size); + if (s->iformat && s->iformat->control_message) + return s->iformat->control_message(s, type, data, data_size); + return AVERROR(ENOSYS); } int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 350912e272..06db024559 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -785,6 +785,12 @@ typedef struct AVInputFormat { */ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + /** + * Allows sending messages from application to device. + */ + int (*control_message)(struct AVFormatContext *s, int type, + void *data, size_t data_size); + /** * Returns device list with it properties. * @see avdevice_list_devices() for more details. diff --git a/libavformat/version.h b/libavformat/version.h index ac14f8eb37..af5e2c496c 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,7 +32,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 21 +#define LIBAVFORMAT_VERSION_MINOR 22 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ -- 2.28.0.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".