Commit 2c68d5a4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

--enable-merge-ffmpeg: kludge to make avcodec and avformat plugins one

This is ugly, but can save a few megabytes at download-, install- and
run-time when avcodec is linked in statically.
parent ad25fa1c
......@@ -2861,6 +2861,12 @@ AS_IF([test "${enable_id3tag}" = "yes"], [
])
])
AC_ARG_ENABLE(merge-ffmpeg,
[ --enable-merged-ffmpeg merge FFMPEG-based plugins (default disabled)],, [
enable_merge_ffmpeg="no"
])
AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
dnl
dnl avcodec decoder/encoder plugin
dnl
......@@ -2921,9 +2927,14 @@ then
CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
VLC_ADD_PLUGIN([avformat])
VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS $AVUTIL_LIBS])
VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
AS_IF([test "$enable_merge_ffmpeg" = "no"], [
VLC_ADD_PLUGIN([avformat])
VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS $AVUTIL_LIBS])
VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
], [
VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
])
VLC_RESTORE_FLAGS
],[
AC_MSG_ERROR([Could not find libavformat or libavutil. Use --disable-avformat to ignore this error.])
......
......@@ -19,6 +19,16 @@ libavcodec_plugin_la_CFLAGS = $(AM_CFLAGS)
libavcodec_plugin_la_LIBADD = $(AM_LIBADD)
libavcodec_plugin_la_DEPENDENCIES =
if MERGE_FFMPEG
libavcodec_plugin_la_SOURCES += \
../../demux/avformat/demux.c
if ENABLE_SOUT
libavcodec_plugin_la_SOURCES += \
../../demux/avformat/mux.c
endif
libavcodec_plugin_la_CFLAGS += -DMERGE_FFMPEG
endif
libvlc_LTLIBRARIES += \
$(LTLIBavcodec)
......
......@@ -78,6 +78,10 @@ static const char *const enc_hq_list_text[] = {
N_("rd"), N_("bits"), N_("simple") };
#endif
#ifdef MERGE_FFMPEG
# include "../../demux/avformat/avformat.h"
#endif
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......@@ -206,6 +210,10 @@ vlc_module_begin ()
set_description( N_("FFmpeg deinterlace video filter") )
add_shortcut( "ffmpeg-deinterlace" )
#ifdef MERGE_FFMPEG
add_submodule ()
# include "../../demux/avformat/avformat.c"
#endif
vlc_module_end ()
/*****************************************************************************
......
......@@ -22,9 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef MERGE_FFMPEG
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
......@@ -34,10 +32,8 @@
#include "avformat.h"
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin ()
#endif /* MERGE_FFMPEG */
add_shortcut( "ffmpeg" )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_DEMUX )
......@@ -56,4 +52,6 @@ vlc_module_begin ()
MUX_LONGTEXT, true )
set_callbacks( OpenMux, CloseMux )
#endif
#ifndef MERGE_FFMPEG
vlc_module_end ()
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment