diff mbox series

[FFmpeg-devel,1/4] tests/Makefile: Add auxiliary functions for transcode and stream_remux

Message ID AS8PR01MB79447ED3BE11ABB97707BCD18FED9@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 7297b17a84ec83a4b56ecd6b5d2020a14c10b1bf
Headers show
Series [FFmpeg-devel,1/4] tests/Makefile: Add auxiliary functions for transcode and stream_remux | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 12, 2022, 1:50 a.m. UTC
Tests using the transcode and stream_remux functions have some common
requirements (namely the file and pipe protocols as well as the framecrc
muxer) and also other commonalities: The create a file and read it
immediately afterwards, so that they typically rely on a corresponding
muxer+demuxer pair which typically shares the same name; for transcode
(if it does not use stream copy) the same is true for encoders and
decoders. This means that using special Makefile-functions instead
of the general ALLYES is worthwhile. This commit adds such functions.

These functions allow to add arbitrary CONFIG-checks on top of the
aforementioned ones in order to satisfy special needs (for e.g. parsers,
filters) that several intended users have.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 tests/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Martin Storsjö April 13, 2022, 8:15 a.m. UTC | #1
On Tue, 12 Apr 2022, Andreas Rheinhardt wrote:

> Tests using the transcode and stream_remux functions have some common
> requirements (namely the file and pipe protocols as well as the framecrc
> muxer) and also other commonalities: The create a file and read it
> immediately afterwards, so that they typically rely on a corresponding
> muxer+demuxer pair which typically shares the same name; for transcode
> (if it does not use stream copy) the same is true for encoders and
> decoders. This means that using special Makefile-functions instead
> of the general ALLYES is worthwhile. This commit adds such functions.
>
> These functions allow to add arbitrary CONFIG-checks on top of the
> aforementioned ones in order to satisfy special needs (for e.g. parsers,
> filters) that several intended users have.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> tests/Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tests/Makefile b/tests/Makefile
> index e3b41a4f7b..5e4da2c42f 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -74,6 +74,16 @@ ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
>                          $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
>                          $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)
>
> +# RAWVIDEO_ENCODER and PCM_S16LE_ENCODER corresponds to the default codecs
> +# for framecrc. These requirements are not always necessary.
> +TRANSCODE = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
> +                           $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER \
> +                           $(3) FILE_PROTOCOL PIPE_PROTOCOL RAWVIDEO_ENCODER  \
> +                           PCM_S16LE_ENCODER FRAMECRC_MUXER)
> +
> +REMUX = $(call ALLYES, $(firstword $(1))_MUXER $(lastword $(1))_DEMUXER \
> +                       $(2) FILE_PROTOCOL PIPE_PROTOCOL FRAMECRC_MUXER)
> +
> DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
> ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)

This looks good to me (provided that the rest of the patches using it end 
up sensible).

// Martin
diff mbox series

Patch

diff --git a/tests/Makefile b/tests/Makefile
index e3b41a4f7b..5e4da2c42f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -74,6 +74,16 @@  ENCDEC2 = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER  \
                          $(firstword $(2))_ENCODER $(lastword $(2))_DECODER  \
                          $(firstword $(3))_MUXER   $(lastword $(3))_DEMUXER)
 
+# RAWVIDEO_ENCODER and PCM_S16LE_ENCODER corresponds to the default codecs
+# for framecrc. These requirements are not always necessary.
+TRANSCODE = $(call ALLYES, $(firstword $(1))_ENCODER $(lastword $(1))_DECODER \
+                           $(firstword $(2))_MUXER   $(lastword $(2))_DEMUXER \
+                           $(3) FILE_PROTOCOL PIPE_PROTOCOL RAWVIDEO_ENCODER  \
+                           PCM_S16LE_ENCODER FRAMECRC_MUXER)
+
+REMUX = $(call ALLYES, $(firstword $(1))_MUXER $(lastword $(1))_DEMUXER \
+                       $(2) FILE_PROTOCOL PIPE_PROTOCOL FRAMECRC_MUXER)
+
 DEMDEC  = $(call ALLYES, $(1)_DEMUXER $(2:%=%_DECODER))
 ENCMUX  = $(call ALLYES, $(1:%=%_ENCODER) $(2)_MUXER)