Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 10/10] lavfi: move AVFilterLink.graph to FilterLink
Date: Sun, 11 Aug 2024 16:42:11 +0200
Message-ID: <20240811144211.5712-10-anton@khirnov.net> (raw)
In-Reply-To: <20240811144211.5712-1-anton@khirnov.net>

---
 libavfilter/avfilter.c      | 6 +++---
 libavfilter/avfilter.h      | 5 -----
 libavfilter/avfiltergraph.c | 2 +-
 libavfilter/f_sendcmd.c     | 2 +-
 libavfilter/filters.h       | 5 +++++
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 055db01e02..43d7c9f4ab 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -185,7 +185,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
     link->srcpad  = &src->output_pads[srcpad];
     link->dstpad  = &dst->input_pads[dstpad];
     link->type    = src->output_pads[srcpad].type;
-    link->graph   = src->graph;
+    li->l.graph   = src->graph;
     av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
     link->format  = -1;
     link->colorspace = AVCOL_SPC_UNSPECIFIED;
@@ -231,8 +231,8 @@ static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
     li->l.current_pts = pts;
     li->l.current_pts_us = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);
     /* TODO use duration */
-    if (link->graph && li->age_index >= 0)
-        ff_avfilter_graph_update_heap(link->graph, li);
+    if (li->l.graph && li->age_index >= 0)
+        ff_avfilter_graph_update_heap(li->l.graph, li);
 }
 
 void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index a91b543f5e..549fe6ce3a 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -594,11 +594,6 @@ struct AVFilterLink {
      * Lists of supported formats / etc. supported by the output filter.
      */
     AVFilterFormatsConfig outcfg;
-
-    /**
-     * Graph the filter belongs to.
-     */
-    struct AVFilterGraph *graph;
 };
 
 /**
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 2d46dd7637..6bfcc42430 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -106,7 +106,7 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter
             filter->graph = NULL;
             for (j = 0; j<filter->nb_outputs; j++)
                 if (filter->outputs[j])
-                    filter->outputs[j]->graph = NULL;
+                    ff_filter_link(filter->outputs[j])->graph = NULL;
 
             return;
         }
diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
index 86f9d522e9..8ba0878e81 100644
--- a/libavfilter/f_sendcmd.c
+++ b/libavfilter/f_sendcmd.c
@@ -567,7 +567,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     av_log(ctx, AV_LOG_VERBOSE,
                            "Processing command #%d target:%s command:%s arg:%s\n",
                            cmd->index, cmd->target, cmd->command, cmd_arg);
-                    ret = avfilter_graph_send_command(inlink->graph,
+                    ret = avfilter_graph_send_command(inl->graph,
                                                       cmd->target, cmd->command, cmd_arg,
                                                       buf, sizeof(buf),
                                                       AVFILTER_CMD_FLAG_ONE);
diff --git a/libavfilter/filters.h b/libavfilter/filters.h
index 36164c171e..ab16047e12 100644
--- a/libavfilter/filters.h
+++ b/libavfilter/filters.h
@@ -42,6 +42,11 @@
 typedef struct FilterLink {
     AVFilterLink pub;
 
+    /**
+     * Graph the filter belongs to.
+     */
+    struct AVFilterGraph *graph;
+
     /**
      * Current timestamp of the link, as defined by the most recent
      * frame(s), in link time_base units.
-- 
2.43.0

_______________________________________________
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".

      parent reply	other threads:[~2024-08-11 14:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 14:42 [FFmpeg-devel] [PATCH 01/10] lavfi: set AVFilterLink.graph on link creation Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 02/10] lavfi: add a new struct for private link properties Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 03/10] lavfi: move AVFilterLink.m{ax, in}_samples to FilterLink Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 04/10] lavfi/vf_*_cuda: do not access hw contexts before checking they exist Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 05/10] lavfi: move AVFilterLink.hw_frames_ctx to FilterLink Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 06/10] lavfi: move AVFilterLink.current_pts(_us) " Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 07/10] lavfi: move AVFilterLink.frame_rate " Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 08/10] lavfi: move AVFilterLink.{frame, sample}_count_{in, out} " Anton Khirnov
2024-08-12 20:19   ` Michael Niedermayer
2024-08-13  8:28     ` Anton Khirnov
2024-08-11 14:42 ` [FFmpeg-devel] [PATCH 09/10] lavfi: move AVFilterLink.frame_wanted_out to FilterLinkInternal Anton Khirnov
2024-08-11 14:42 ` Anton Khirnov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240811144211.5712-10-anton@khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git