Skip to content

Commit

Permalink
initial work on ffmpeg 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Apr 9, 2021
1 parent a2d6eec commit 0515d62
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ffmpeg/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ALSA_VERSION=1.2.4
FREETYPE_VERSION=2.10.4
MFX_VERSION=1.34
NVCODEC_VERSION=11.0.10.0
FFMPEG_VERSION=4.3.2
FFMPEG_VERSION=4.4
download https://download.videolan.org/contrib/nasm/nasm-$NASM_VERSION.tar.gz nasm-$NASM_VERSION.tar.gz
download http://zlib.net/$ZLIB.tar.gz $ZLIB.tar.gz
download http://downloads.sourceforge.net/project/lame/lame/3.100/$LAME.tar.gz $LAME.tar.gz
Expand Down
23 changes: 11 additions & 12 deletions ffmpeg/ffmpeg.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
diff --git a/configure b/configure
index 8569a60bf8..0ca4f4ea77 100755
--- a/configure
+++ b/configure
@@ -6306,7 +6306,7 @@ flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lfl
@@ -6364,7 +6364,7 @@
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
enabled fontconfig && enable libfontconfig
enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
-enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
+enabled libfreetype && add_cppflags -I ../include/freetype2/ && require libfreetype "ft2build.h FT_FREETYPE_H" FT_Init_FreeType -lfreetype
enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
enabled libglslang && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h "glslang::TIntermediate*" -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++
enabled libglslang && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h "glslang::TIntermediate*" -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++
enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
@@ -6324,8 +6324,7 @@ enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_
@@ -6382,8 +6382,7 @@
# Media SDK or Intel Media Server Studio, these don't come with
# pkg-config support. Instead, users should make sure that the build
# can find the libraries and headers through other means.
Expand All @@ -21,7 +19,7 @@ index 8569a60bf8..0ca4f4ea77 100755
if enabled libmfx; then
check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
fi
@@ -6343,18 +6342,11 @@ enabled libopencv && { check_headers opencv2/core/core_c.h &&
@@ -6401,19 +6400,12 @@
{ check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
Expand All @@ -30,6 +28,7 @@ index 8569a60bf8..0ca4f4ea77 100755
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
enabled libopenvino && require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api
-enabled libopus && {
- enabled libopus_decoder && {
- require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
Expand All @@ -41,17 +40,17 @@ index 8569a60bf8..0ca4f4ea77 100755
+enabled libopus && add_cppflags -I ../include/opus/ && require libopus opus_multistream.h opus_multistream_decoder_create -lopus
enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.1.0" rav1e.h rav1e_context_new
@@ -6367,7 +6359,7 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.4.0" rav1e.h rav1e_context_new
@@ -6427,7 +6419,7 @@
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
-enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
+enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.8.4" EbSvtAv1Enc.h svt_av1_enc_init_handle
enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
@@ -6385,19 +6377,15 @@ enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h
@@ -6447,19 +6439,15 @@

enabled libvpx && {
enabled libvpx_vp8_decoder && {
Expand All @@ -71,7 +70,7 @@ index 8569a60bf8..0ca4f4ea77 100755
check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
}
if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
@@ -6409,12 +6397,12 @@ enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFil
@@ -6470,12 +6458,12 @@
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
Expand All @@ -86,7 +85,7 @@ index 8569a60bf8..0ca4f4ea77 100755
require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
@@ -6465,9 +6453,9 @@ enabled omx && require_headers OMX_Core.h
@@ -6526,9 +6514,9 @@
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
Expand Down
5 changes: 4 additions & 1 deletion ffmpeg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg</artifactId>
<version>4.3.2-${project.parent.version}</version>
<version>4.4.0-${project.parent.version}</version>
<name>JavaCPP Presets for FFmpeg</name>

<dependencies>
Expand Down Expand Up @@ -48,6 +48,9 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>8</source>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void map(InfoMap infoMap) {
infoMap.put(new Info("!FF_API_LOWRES", "!FF_API_DEBUG_MV").define(false))
.put(new Info("CODEC_FLAG_CLOSED_GOP").translate().cppTypes("long"))
.put(new Info("AVCodecHWConfigInternal").cast().pointerTypes("Pointer"))
.put(new Info("AVCodec::hw_configs").skip())
.putFirst(new Info("AVPanScan").pointerTypes("AVPanScan"))
.putFirst(new Info("AVCodecContext").pointerTypes("AVCodecContext"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public void map(InfoMap infoMap) {
infoMap.put(new Info("AVDeviceInfoList", "AVDeviceCapabilitiesQuery", "AVBPrint", "URLContext", "FFFrac").cast().pointerTypes("Pointer"))
.put(new Info("AVPROBE_SCORE_RETRY", "AVPROBE_SCORE_STREAM_RETRY").translate(false))
.put(new Info("LIBAVFORMAT_VERSION_MAJOR <= 54", "FF_API_ALLOC_OUTPUT_CONTEXT", "FF_API_FORMAT_PARAMETERS",
"FF_API_READ_PACKET", "FF_API_CLOSE_INPUT_FILE", "FF_API_NEW_STREAM", "FF_API_SET_PTS_INFO").define(false));
"FF_API_READ_PACKET", "FF_API_CLOSE_INPUT_FILE", "FF_API_NEW_STREAM", "FF_API_SET_PTS_INFO", "LIBAVFORMAT_VERSION_MAJOR < 59").define(false));
}
}
3 changes: 2 additions & 1 deletion ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avutil.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
global = "org.bytedeco.ffmpeg.global.avutil",
value = {
@Platform(define = {"__STDC_CONSTANT_MACROS", "__STDC_FORMAT_MACROS"},
cinclude = {"<libavutil/avutil.h>", "<libavutil/error.h>", "<libavutil/mem.h>", "<libavutil/time.h>",
cinclude = {"<libavutil/avutil.h>", "<libavutil/error.h>", "<libavutil/mem.h>", "<libavutil/time.h>",
"<libavutil/mathematics.h>", "<libavutil/rational.h>", "<libavutil/log.h>", "<libavutil/buffer.h>", "<libavutil/pixfmt.h>",
"<libavutil/frame.h>", "<libavutil/samplefmt.h>", "<libavutil/channel_layout.h>", "<libavutil/cpu.h>", "<libavutil/dict.h>",
"<libavutil/opt.h>", "<libavutil/pixdesc.h>", "<libavutil/imgutils.h>", "<libavutil/downmix_info.h>", "<libavutil/stereo3d.h>",
Expand Down Expand Up @@ -87,6 +87,7 @@ public void map(InfoMap infoMap) {
.put(new Info("FF_API_VAAPI").define())
.put(new Info("AV_PIX_FMT_ABI_GIT_MASTER", "AV_HAVE_INCOMPATIBLE_LIBAV_ABI", "!FF_API_XVMC",
"FF_API_GET_BITS_PER_SAMPLE_FMT", "FF_API_FIND_OPT").define(false))
.put(new Info("FF_API_BUFFER_SIZE_T", "FF_API_CRYPTO_SIZE_T").define(true))
.put(new Info("ff_check_pixfmt_descriptors").skip())
.put(new Info("AV_CH_FRONT_LEFT",
"AV_CH_FRONT_RIGHT",
Expand Down

0 comments on commit 0515d62

Please sign in to comment.