[NEXT,v2,4/7] libpjsip: enable ffmpeg support

Message ID 20171114160712.20086-4-aduskett@gmail.com
State Superseded, archived
Headers show
Series
  • [NEXT,v2,1/7] libpjsip: remove disable-ext-sound option
Related show

Commit Message

Adam Duskett Nov. 14, 2017, 4:07 p.m.
If FFmpeg is selected, libpjsip should depend on it.
Specifying --with-ffmpeg= is necessary because passing --enable-FFmpeg
actually disables FFmpeg when cross compiling.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
Changes v1 -> v2:
  - Remove the option to enable or disable FFmpeg support in favor of
    just depending on FFmpeg if it's selected by the user.
  - Add explination as to why with-ffmpeg is being passed to libpjsip (Arnout)

 package/libpjsip/libpjsip.mk | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Arnout Vandecappelle Nov. 19, 2017, 1:58 p.m. | #1
On 14-11-17 17:07, Adam Duskett wrote:
> If FFmpeg is selected, libpjsip should depend on it.
> Specifying --with-ffmpeg= is necessary because passing --enable-FFmpeg
> actually disables FFmpeg when cross compiling.
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
> Changes v1 -> v2:
>   - Remove the option to enable or disable FFmpeg support in favor of
>     just depending on FFmpeg if it's selected by the user.
>   - Add explination as to why with-ffmpeg is being passed to libpjsip (Arnout)
> 
>  package/libpjsip/libpjsip.mk | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/package/libpjsip/libpjsip.mk b/package/libpjsip/libpjsip.mk
> index 3c9d789..982e088 100644
> --- a/package/libpjsip/libpjsip.mk
> +++ b/package/libpjsip/libpjsip.mk
> @@ -29,7 +29,6 @@ LIBPJSIP_CONF_OPTS = \
>  	--disable-speex-codec \
>  	--disable-speex-aec \
>  	--disable-resample \
> -	--disable-video \

 This bit should have a bit more explanation in the commit message. Like:

--enable-video has no effect at all on Linux (only on Android and darwin).
--disable-video has the effect of disabling SDL, ffmpeg, v4l2, openh264 and
libyuv. Since all of these are enabled/disabled explicitly already, there is no
need to specify --disable-video. To do so correctly is non-trivial when we want
to support e.g. ffmpeg OR v4l2.

>  	--disable-opencore-amr \
>  	--disable-g7221-codec \
>  	--disable-ilbc-codec \
> @@ -41,7 +40,6 @@ LIBPJSIP_CONF_OPTS = \
>  	--disable-g722-codec \
>  	--disable-libsamplerate \
>  	--disable-sdl \
> -	--disable-ffmpeg \
>  	--disable-v4l2 \
>  	--disable-openh264 \
>  	--disable-libyuv \
> @@ -75,4 +73,13 @@ LIBPJSIP_DEPENDENCIES += portaudio
>  LIBPJSIP_CONF_OPTS += --with-external-pa
>  endif
>  
> +# Passing --enable-ffmpeg actually disables it. Instead, --with-ffmpeg
> +# must be passed to compile ffmpeg support.

 Here, I would also give the full explanation in the commit message:

When --enable-ffmpeg is given, the code to enable ffmpeg is not executed. Also,
when cross-compiling and no --with-ffmpeg option is given, ffmpeg is disbled.
Therefore, a --with-ffmpeg option needs to be given. Normally it is used to pass
the path to the directory where ffmpeg is installed, but since we install it
directly under sysroot we can pass it empty.

> +ifeq ($(BR2_PACKAGE_FFMPEG),y)
> +LIBPJSIP_DEPENDENCIES += ffmpeg
> +LIBPJSIP_CONF_OPTS += --with-ffmpeg=$(STAGING_DIR)/usr

 --with-ffmpeg without anything works as well, i.e.:

LIBPJSIP_CONF_OPTS += --with-ffmpeg

 Regards,
 Arnout

> +else
> +LIBPJSIP_CONF_OPTS += --disable-ffmpeg
> +endif
> +
>  $(eval $(autotools-package))
>

Patch

diff --git a/package/libpjsip/libpjsip.mk b/package/libpjsip/libpjsip.mk
index 3c9d789..982e088 100644
--- a/package/libpjsip/libpjsip.mk
+++ b/package/libpjsip/libpjsip.mk
@@ -29,7 +29,6 @@  LIBPJSIP_CONF_OPTS = \
 	--disable-speex-codec \
 	--disable-speex-aec \
 	--disable-resample \
-	--disable-video \
 	--disable-opencore-amr \
 	--disable-g7221-codec \
 	--disable-ilbc-codec \
@@ -41,7 +40,6 @@  LIBPJSIP_CONF_OPTS = \
 	--disable-g722-codec \
 	--disable-libsamplerate \
 	--disable-sdl \
-	--disable-ffmpeg \
 	--disable-v4l2 \
 	--disable-openh264 \
 	--disable-libyuv \
@@ -75,4 +73,13 @@  LIBPJSIP_DEPENDENCIES += portaudio
 LIBPJSIP_CONF_OPTS += --with-external-pa
 endif
 
+# Passing --enable-ffmpeg actually disables it. Instead, --with-ffmpeg
+# must be passed to compile ffmpeg support.
+ifeq ($(BR2_PACKAGE_FFMPEG),y)
+LIBPJSIP_DEPENDENCIES += ffmpeg
+LIBPJSIP_CONF_OPTS += --with-ffmpeg=$(STAGING_DIR)/usr
+else
+LIBPJSIP_CONF_OPTS += --disable-ffmpeg
+endif
+
 $(eval $(autotools-package))