From patchwork Mon Jun 7 23:03:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 28157 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp3890781iof; Mon, 7 Jun 2021 16:12:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz41QhuJv7Mr56aCV/HiH0n17vy4KZkr/GHoqVe5AjlcLyTWnVsz4INCPclUXWk7hjUr/0B X-Received: by 2002:a17:906:dbec:: with SMTP id yd12mr1173783ejb.126.1623107524503; Mon, 07 Jun 2021 16:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623107524; cv=none; d=google.com; s=arc-20160816; b=FcVHm0w7j1oku8HB5JyG6j2qgQgDcoY9WciA6/Z2S36v/zylvAqGsZV0yatB8vMu0r 9BYZ+YAuB+wuWQEmyHamHkOzeKSp3wfJcconHTEjMqGPrcJ5I3b35pPZok7EHvx5DO96 OKlO6bgQi5EOpk0Yfp6pSvzjAFXx/iZONXk/MTGLTxY79C29jWWjJeE74GbXgmqfyJ68 b5y1HI7GxZryQngI7Zo+h8wifwFuAHyC7s3dbRltT+7dG/+NgbXY4LEiv/Oua4FExV6W BBWwCG5q0bmMT8dg8oLpLC0QBV/7O7U/5Ckx076hWn72szJCiOB74DG3/9yM+Oru5Cln QfNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=dNXmsSIuHtYyW4pek8kQ1WcZF/5FObG1lIVL06PX7xM=; b=s8l8bNMgxORE0/uTyDZ/UwCNroE5uqPuvSds1dwPIEBFw4SzCMGwCdTSA++Bji1WPN IMDfy2WfXAAflvWQTQwxhPrephJw+JEMmTueRFCrjhoYpCpzsfYv2Ba9lsJqv52Qc5XB bFKTqAnPP/KHDzEQFckXRXp7dTlG4rlloZx/SUx0wqdRafMcD9SGrr1r80+TpUwjArJx 1ssO0MM86lpyz5C9juOqOi3j3n7Kzw97Sev8qxKfdADvxX3rBHiefmPgneTT7cmQDcDP Wg5tXramSuqJCYPREpF453uUhU9EHwQxy9WOawRndMULw4EWpOKIPNa9MMWibsagq549 h78g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rIFA5dGI; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c7si12975658ejz.386.2021.06.07.16.12.04; Mon, 07 Jun 2021 16:12:04 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rIFA5dGI; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 985AC688324; Tue, 8 Jun 2021 02:12:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C3991680AF3 for ; Tue, 8 Jun 2021 02:11:54 +0300 (EEST) Received: by mail-ej1-f53.google.com with SMTP id my49so12679225ejc.7 for ; Mon, 07 Jun 2021 16:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=41qKzCf9BVvhUhZ/WGQBasQuSN11e31lwRq//8NVWQA=; b=rIFA5dGIESw14D/Y9fnlnMHrlW1cNyQgcd+Hg2kHJXPHH9qDYfoR9/AHiaegTI8uWg 4yGOZygRynOpPtuQ2oTUSa/jUd3dMIFuGU2GYSULAkQjjP9usfPWuyAwHCveAkJusauV L+AEhyz1jvP12lox36lG2hXLdlj0XPpFqg97ZM7+U0MSzB4ack/18+1YmBs08G1Yv6eA 2Dw0VxJHfi86KDCiNoPQzURq0QiRsb4tqfkVQchm8Mz5VRwwTEMnUyIL7WrTvg9L0LKK 2tKodQJOAvpQtHaa0uF4ZzzcKvjJsAotCcudfy5Glfp6CziWkPO9yE0w0p7rkajUeG2i O9OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=41qKzCf9BVvhUhZ/WGQBasQuSN11e31lwRq//8NVWQA=; b=AqzrJXrbcQjkyKdxij4xxLuRUOxVeA6+uF7zyMxUT2SeRYz7U3RZ3O7nV61SIeKdTT F4sAStSLNaDGKvP5SI0YEY1beixqitK16KlWlVH0O0K+AWlUjPd2qYG+7SCKZ9BoX0De hdB/xwi8wl3sq4T32mMoBhXP8oBrD6CyhK1wNzayVwoLzZxh1bvwPz9uwgKthh6KuwSx IUCXbG/VH/UnwtMoMJ1IawQJ5KHlJamXcR3+T+RxBFuxKfqxob6fcLLL8S4i7Jv0fc/y JcNiTczOsGMbbCsuJrUO7zDnXdYHLtzrRCxt61n326b2yigwVWhSv4hk55j3b+xpQ59g Rd1A== X-Gm-Message-State: AOAM533fgPysnbd4essKKJzmh1Kq1AfrZzHlvL5KdfjOVTM6YFqGo49P 1QXRzFeCkhVRroOz4/ui1zwv+yuZQ1sV2A== X-Received: by 2002:a2e:5342:: with SMTP id t2mr16150350ljd.321.1623107077369; Mon, 07 Jun 2021 16:04:37 -0700 (PDT) Received: from localhost.localdomain (84-217-56-54.customers.ownit.se. [84.217.56.54]) by smtp.gmail.com with ESMTPSA id v9sm1999563ljv.131.2021.06.07.16.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 16:04:36 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Jun 2021 01:03:50 +0200 Message-Id: <20210607230414.612-12-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210607230414.612-1-dcnieho@gmail.com> References: <20210607230414.612-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/35] 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: KklRtlstMvcu 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 | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 4a40929007..e339cebf2d 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -53,9 +53,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 a28ac372da..adbdd712a7 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -737,6 +737,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 5de0814316..7f02e18f24 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,8 +32,8 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 59 -#define LIBAVFORMAT_VERSION_MINOR 2 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MINOR 3 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \