diff mbox series

[FFmpeg-devel,3/6] avfilter/internal: Uninline ff_insert_(in|out)pad()

Message ID AM7PR03MB6660221C539E9B12A727E8FC8FFE9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel,1/6] avfilter/internal: Replace AVFilterPad.needs_writable by flags | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 17, 2021, 1:53 a.m. UTC
These functions are not hot at all and future commits will make them
bigger.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/avfilter.c | 24 +++++++++++++++++++++---
 libavfilter/internal.h | 29 +++--------------------------
 2 files changed, 24 insertions(+), 29 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index af371e4fb9..c3382036d2 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -101,9 +101,17 @@  void ff_command_queue_pop(AVFilterContext *filter)
     av_free(c);
 }
 
-int ff_insert_pad(unsigned *count,
-                   AVFilterPad **pads, AVFilterLink ***links,
-                   AVFilterPad *newpad)
+/**
+ * Insert a new pad.
+ *
+ * @param count  Pointer to the number of pads in the list
+ * @param pads   Pointer to the pointer to the beginning of the list of pads
+ * @param links  Pointer to the pointer to the beginning of the list of links
+ * @param newpad The new pad to add. A copy is made when adding.
+ * @return >= 0 in case of success, a negative AVERROR code on error
+ */
+static int insert_pad(unsigned *count, AVFilterPad **pads,
+                      AVFilterLink ***links, AVFilterPad *newpad)
 {
     AVFilterLink **newlinks;
     AVFilterPad *newpads;
@@ -126,6 +134,16 @@  int ff_insert_pad(unsigned *count,
     return 0;
 }
 
+int ff_insert_inpad(AVFilterContext *f, AVFilterPad *p)
+{
+    return insert_pad(&f->nb_inputs, &f->input_pads, &f->inputs, p);
+}
+
+int ff_insert_outpad(AVFilterContext *f, AVFilterPad *p)
+{
+    return insert_pad(&f->nb_outputs, &f->output_pads, &f->outputs, p);
+}
+
 int avfilter_link(AVFilterContext *src, unsigned srcpad,
                   AVFilterContext *dst, unsigned dstpad)
 {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 13d0e2b457..8fe17a5433 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -226,33 +226,10 @@  void ff_tlog_ref(void *ctx, AVFrame *ref, int end);
 void ff_tlog_link(void *ctx, AVFilterLink *link, int end);
 
 /**
- * Insert a new pad.
- *
- * @param count Pointer to the number of pads in the list
- * @param pads Pointer to the pointer to the beginning of the list of pads
- * @param links Pointer to the pointer to the beginning of the list of links
- * @param newpad The new pad to add. A copy is made when adding.
- * @return >= 0 in case of success, a negative AVERROR code on error
+ * Append a new input/output pad to the filter's list of such pads.
  */
-int ff_insert_pad(unsigned *count,
-                   AVFilterPad **pads, AVFilterLink ***links,
-                   AVFilterPad *newpad);
-
-/** Insert a new input pad for the filter. */
-static inline int ff_insert_inpad(AVFilterContext *f,
-                                   AVFilterPad *p)
-{
-    return ff_insert_pad(&f->nb_inputs,
-                  &f->input_pads, &f->inputs, p);
-}
-
-/** Insert a new output pad for the filter. */
-static inline int ff_insert_outpad(AVFilterContext *f,
-                                    AVFilterPad *p)
-{
-    return ff_insert_pad(&f->nb_outputs,
-                  &f->output_pads, &f->outputs, p);
-}
+int ff_insert_inpad (AVFilterContext *f, AVFilterPad *p);
+int ff_insert_outpad(AVFilterContext *f, AVFilterPad *p);
 
 /**
  * Request an input frame from the filter at the other end of the link.