Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial work on ffmpeg 4.4.0 #1030

Merged
merged 5 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Map `std::vector<cv::Range>` to `RangeVector` in `opencv_core.Mat` for convenience ([issue bytedeco/javacv#1607](https://github.com/bytedeco/javacv/issues/1607))
* Include `genericaliasobject.h`, `context.h`, `tracemalloc.h`, and `datetime.h` for CPython ([issue #1017](https://github.com/bytedeco/javacpp-presets/issues/1017))
* Add samples using LLVM modules to deal with bitcode and object files ([pull #1016](https://github.com/bytedeco/javacpp-presets/pull/1016))
* Upgrade presets for OpenCV 4.5.2, MKL 2021.2, OpenBLAS 0.3.14, DNNL 2.2, NumPy 1.20.2, SciPy 1.6.2, CUDA 11.2.2
* Upgrade presets for OpenCV 4.5.2, FFmpeg 4.4 ([pull #1030](https://github.com/bytedeco/javacpp-presets/pull/1030)), MKL 2021.2, OpenBLAS 0.3.14, DNNL 2.2, NumPy 1.20.2, SciPy 1.6.2, CUDA 11.2.2

### March 8, 2021 version 1.5.5
* Bundle LLD executable in presets for LLVM as required by TVM on Windows
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ The JavaCPP Presets depend on Maven, a powerful build system for Java, so before
Each child module in turn relies by default on the included [`cppbuild.sh` scripts](#the-cppbuildsh-scripts), explained below, to install its corresponding native libraries in the `cppbuild` subdirectory. To use native libraries already installed somewhere else on the system, other installation directories than `cppbuild` can also be specified either in the `pom.xml` files or in the `.java` configuration files. The following versions are supported:

* OpenCV 4.5.2 https://opencv.org/releases.html
* FFmpeg 4.3.x http://ffmpeg.org/download.html
* FFmpeg 4.4.x http://ffmpeg.org/download.html
* FlyCapture 2.13.x https://www.flir.com/products/flycapture-sdk
* Spinnaker 1.27.x https://www.flir.com/products/spinnaker-sdk
* libdc1394 2.2.6 http://sourceforge.net/projects/libdc1394/files/
Expand Down
8 changes: 4 additions & 4 deletions ffmpeg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* FFmpeg 4.3.2 http://ffmpeg.org/
* FFmpeg 4.4 http://ffmpeg.org/

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand Down Expand Up @@ -38,22 +38,22 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.ffmpeg</groupId>
<artifactId>readfewframe</artifactId>
<version>1.5.5</version>
<version>1.5.6-SNAPSHOT</version>
<properties>
<exec.mainClass>ReadFewFrame</exec.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>4.3.2-1.5.5</version>
<version>4.4-1.5.6-SNAPSHOT</version>
</dependency>

<!-- Optional GPL builds with (almost) everything enabled -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>4.3.2-1.5.5</version>
<version>4.4-1.5.6-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
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
2 changes: 1 addition & 1 deletion ffmpeg/platform/gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>4.3.2-${project.parent.version}</version>
<version>4.4-${project.parent.version}</version>
<name>JavaCPP Presets Platform for FFmpeg (GPL enabled)</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

<properties>
Expand Down
2 changes: 1 addition & 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-${project.parent.version}</version>
<name>JavaCPP Presets for FFmpeg</name>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions ffmpeg/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.ffmpeg</groupId>
<artifactId>readfewframe</artifactId>
<version>1.5.5</version>
<version>1.5.6-SNAPSHOT</version>
<properties>
<exec.mainClass>ReadFewFrame</exec.mainClass>
<maven.compiler.source>1.7</maven.compiler.source>
Expand All @@ -12,14 +12,14 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>4.3.2-1.5.5</version>
<version>4.4-1.5.6-SNAPSHOT</version>
</dependency>

<!-- Optional GPL builds with (almost) everything enabled -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>4.3.2-1.5.5</version>
<version>4.4-1.5.6-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down
44 changes: 23 additions & 21 deletions ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodec.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.6-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.ffmpeg.avcodec;

Expand Down Expand Up @@ -92,7 +92,9 @@ public class AVCodec extends Pointer {
*****************************************************************
*/
public native int priv_data_size(); public native AVCodec priv_data_size(int setter);
// #if FF_API_NEXT
public native AVCodec next(); public native AVCodec next(AVCodec setter);
// #endif
/**
* \name Frame-level threading support functions
* \{
Expand Down Expand Up @@ -121,7 +123,7 @@ public static class Update_thread_context_AVCodecContext_AVCodecContext extends
public native @Const AVCodecDefault defaults(); public native AVCodec defaults(AVCodecDefault setter);

/**
* Initialize codec static data, called from avcodec_register().
* Initialize codec static data, called from av_codec_iterate().
*
* This is not intended for time consuming operations as it is
* run for every codec regardless of that codec being used.
Expand Down Expand Up @@ -159,7 +161,7 @@ public native int call(AVCodecContext arg0, @Cast("uint8_t*") BytePointer buf, i
* Encode data to an AVPacket.
*
* @param avctx codec context
* @param avpkt output AVPacket (may contain a user-provided buffer)
* @param avpkt output AVPacket
* @param frame [in] AVFrame containing the raw data to be encoded
* @param got_packet_ptr [out] encoder sets to 0 or 1 to indicate that a
* non-empty packet was returned in avpkt.
Expand All @@ -175,13 +177,26 @@ public native int call(AVCodecContext avctx, AVPacket avpkt,
@Const AVFrame frame, IntPointer got_packet_ptr);
}
public native Encode2_AVCodecContext_AVPacket_AVFrame_IntPointer encode2(); public native AVCodec encode2(Encode2_AVCodecContext_AVPacket_AVFrame_IntPointer setter);
/**
* Decode picture or subtitle data.
*
* @param avctx codec context
* @param outdata codec type dependent output struct
* @param got_frame_ptr [out] decoder sets to 0 or 1 to indicate that a
* non-empty frame or subtitle was returned in
* outdata.
* @param avpkt [in] AVPacket containing the data to be decoded
* @return amount of bytes read from the packet on success, negative error
* code on failure
*/
public static class Decode_AVCodecContext_Pointer_IntPointer_AVPacket extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Decode_AVCodecContext_Pointer_IntPointer_AVPacket(Pointer p) { super(p); }
protected Decode_AVCodecContext_Pointer_IntPointer_AVPacket() { allocate(); }
private native void allocate();
public native int call(AVCodecContext arg0, Pointer outdata, IntPointer outdata_size, AVPacket avpkt);
public native int call(AVCodecContext avctx, Pointer outdata,
IntPointer got_frame_ptr, AVPacket avpkt);
}
public native Decode_AVCodecContext_Pointer_IntPointer_AVPacket decode(); public native AVCodec decode(Decode_AVCodecContext_Pointer_IntPointer_AVPacket setter);
public static class Close_AVCodecContext extends FunctionPointer {
Expand All @@ -194,22 +209,10 @@ public static class Close_AVCodecContext extends FunctionPointer {
}
public native @Name("close") Close_AVCodecContext _close(); public native AVCodec _close(Close_AVCodecContext setter);
/**
* Encode API with decoupled packet/frame dataflow. The API is the
* same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except
* that:
* - never called if the codec is closed or the wrong type,
* - if AV_CODEC_CAP_DELAY is not set, drain frames are never sent,
* - only one drain frame is ever passed down,
* Encode API with decoupled frame/packet dataflow. This function is called
* to get one output packet. It should call ff_encode_get_frame() to obtain
* input data.
*/
public static class Send_frame_AVCodecContext_AVFrame extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Send_frame_AVCodecContext_AVFrame(Pointer p) { super(p); }
protected Send_frame_AVCodecContext_AVFrame() { allocate(); }
private native void allocate();
public native int call(AVCodecContext avctx, @Const AVFrame frame);
}
public native Send_frame_AVCodecContext_AVFrame send_frame(); public native AVCodec send_frame(Send_frame_AVCodecContext_AVFrame setter);
public static class Receive_packet_AVCodecContext_AVPacket extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
Expand Down Expand Up @@ -266,8 +269,7 @@ public static class Flush_AVCodecContext extends FunctionPointer {
*
* The user can only access this field via avcodec_get_hw_config().
*/
public native @Cast("const AVCodecHWConfigInternal*") Pointer hw_configs(int i); public native AVCodec hw_configs(int i, Pointer setter);
@MemberGetter public native @Cast("const AVCodecHWConfigInternal**") PointerPointer hw_configs();


/**
* List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
Expand Down
Loading