Skip to content

Commit

Permalink
Update presets to match latest changes in JavaCPP
Browse files Browse the repository at this point in the history
* Upgrade presets for FFmpeg 2.4.2, LLVM 3.5.0
  • Loading branch information
saudet committed Oct 5, 2014
1 parent 0b9f1d1 commit 8e66bb0
Show file tree
Hide file tree
Showing 32 changed files with 830 additions and 342 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

* Fix `java.lang.UnsatisfiedLinkError` when allocating `opencv_core.Mat`, among others ([issue javacv:9](https://github.com/bytedeco/javacv/issues/9) and [issue javacv:28](https://github.com/bytedeco/javacv/issues/28))
* Force OpenCV to build with GCC 4.6, as newer versions are known to hang on Android 2.2 ([issue android:43819](https://code.google.com/p/android/issues/detail?id=43819))
* Upgrade presets for videoInput, where the latest code got merged into the master branch
* Upgrade presets for FFmpeg 2.4.2, LLVM 3.5.0, videoInput, where the latest code got merged into the master branch
* Add callbacks for Tesseract according to new functionality in JavaCPP
* Fix missing dependency of `opencv_contrib` on `opencv_nonfree`
* Skip functions that are not actually implemented in `avdevice`, causing load failures on Android
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ We can also have everything downloaded and installed automatically with:

* SBT (inside the `build.sbt` file)
```scala
classpathTypes += "maven-plugin"
libraryDependencies += "org.bytedeco.javacpp-presets" % moduleName % moduleVersion + "-0.9"
```

Expand Down Expand Up @@ -65,16 +66,16 @@ To rebuild the source code on the Java side, please note that the project files
Each child module in turn relies on its corresponding native libraries being already installed in the `cppbuild` subdirectory created by a prior execution of the included [CPPBuild Scripts](#cppbuild-scripts), explained below. To use native libraries already installed somewhere else on the system, other installation directories than `cppbuild` can also be specified in the `.java` configuration files directly. The following versions are supported:

* OpenCV 2.4.9 http://opencv.org/downloads.html
* FFmpeg 2.3.x http://ffmpeg.org/download.html
* FFmpeg 2.4.x http://ffmpeg.org/download.html
* FlyCapture 2.6.x http://ww2.ptgrey.com/sdk/flycap
* libdc1394 2.1.x or 2.2.x http://sourceforge.net/projects/libdc1394/files/
* libfreenect 0.5 https://github.com/OpenKinect/libfreenect
* videoInput 0.200 https://github.com/ofTheo/videoInput/tree/update2013
* videoInput 0.200 https://github.com/ofTheo/videoInput/
* ARToolKitPlus 2.3.0 https://launchpad.net/artoolkitplus
* flandmark 1.07 http://cmp.felk.cvut.cz/~uricamic/flandmark/#download
* FFTW 3.3.4 http://www.fftw.org/download.html
* GSL 1.16 http://www.gnu.org/software/gsl/#downloading
* LLVM 3.4.2 http://llvm.org/releases/download.html
* LLVM 3.5.0 http://llvm.org/releases/download.html
* Leptonica 1.71 http://www.leptonica.org/download.html
* Tesseract 3.03-rc1 https://code.google.com/p/tesseract-ocr/

Expand Down
6 changes: 3 additions & 3 deletions ffmpeg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* FFmpeg 2.3 http://ffmpeg.org/
* FFmpeg 2.4.2 http://ffmpeg.org/

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

Expand Down Expand Up @@ -35,12 +35,12 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.javacpp-presets.ffmpeg</groupId>
<artifactId>tutorial01</artifactId>
<version>0.9</version>
<version>0.9.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>ffmpeg</artifactId>
<version>2.3-0.9</version>
<version>2.4.2-0.9.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Expand Down
26 changes: 13 additions & 13 deletions ffmpeg/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ -z "$PLATFORM" ]]; then
fi

if [[ $PLATFORM == windows* ]]; then
FFMPEG_VERSION=20140716-git-faafd1e
FFMPEG_VERSION=20141005-git-e079d43
[[ $PLATFORM == *64 ]] && BITS=64 || BITS=32
download http://ffmpeg.zeranoe.com/builds/win$BITS/dev/ffmpeg-$FFMPEG_VERSION-win$BITS-dev.7z ffmpeg-$FFMPEG_VERSION-win$BITS-dev.7z
download http://ffmpeg.zeranoe.com/builds/win$BITS/shared/ffmpeg-$FFMPEG_VERSION-win$BITS-shared.7z ffmpeg-$FFMPEG_VERSION-win$BITS-shared.7z
Expand All @@ -20,7 +20,7 @@ if [[ $PLATFORM == windows* ]]; then
7za x -y ../ffmpeg-$FFMPEG_VERSION-win$BITS-shared.7z
patch -Np1 -d ffmpeg-$FFMPEG_VERSION-win$BITS-dev/ < ../../ffmpeg-$FFMPEG_VERSION-windows.patch
else
FFMPEG_VERSION=2.3
FFMPEG_VERSION=2.4.2
download http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz lame-3.99.5.tar.gz
download ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2 last_stable_x264.tar.bz2
download http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 ffmpeg-$FFMPEG_VERSION.tar.bz2
Expand Down Expand Up @@ -108,21 +108,21 @@ case $PLATFORM in
make -j4
make install
BADPATH=../lib
LIBS="libavcodec.55.dylib libavdevice.55.dylib libavfilter.4.dylib libavformat.55.dylib libavutil.52.dylib libpostproc.52.dylib libswresample.0.dylib libswscale.2.dylib"
LIBS="libavcodec.56.dylib libavdevice.56.dylib libavfilter.5.dylib libavformat.56.dylib libavutil.54.dylib libpostproc.53.dylib libswresample.1.dylib libswscale.3.dylib"
for f in $LIBS; do install_name_tool $BADPATH/$f -id @rpath/$f \
-add_rpath /usr/local/lib/ -add_rpath /opt/local/lib/ -add_rpath @loader_path/. \
-change $BADPATH/libavcodec.55.dylib @rpath/libavcodec.55.dylib \
-change $BADPATH/libavdevice.55.dylib @rpath/libavdevice.55.dylib \
-change $BADPATH/libavfilter.4.dylib @rpath/libavfilter.4.dylib \
-change $BADPATH/libavformat.55.dylib @rpath/libavformat.55.dylib \
-change $BADPATH/libavutil.52.dylib @rpath/libavutil.52.dylib \
-change $BADPATH/libpostproc.52.dylib @rpath/libpostproc.52.dylib \
-change $BADPATH/libswresample.0.dylib @rpath/libswresample.0.dylib \
-change $BADPATH/libswscale.2.dylib @rpath/libswscale.2.dylib; done
-change $BADPATH/libavcodec.56.dylib @rpath/libavcodec.56.dylib \
-change $BADPATH/libavdevice.56.dylib @rpath/libavdevice.56.dylib \
-change $BADPATH/libavfilter.5.dylib @rpath/libavfilter.5.dylib \
-change $BADPATH/libavformat.56.dylib @rpath/libavformat.56.dylib \
-change $BADPATH/libavutil.54.dylib @rpath/libavutil.54.dylib \
-change $BADPATH/libpostproc.53.dylib @rpath/libpostproc.53.dylib \
-change $BADPATH/libswresample.1.dylib @rpath/libswresample.1.dylib \
-change $BADPATH/libswscale.3.dylib @rpath/libswscale.3.dylib; done
;;
windows-x86)
# http://ffmpeg.org/platform.html#Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b
LIBS=(avcodec-55 avdevice-55 avfilter-4 avformat-55 avutil-52 postproc-52 swresample-0 swscale-2)
LIBS=(avcodec-56 avdevice-56 avfilter-5 avformat-56 avutil-54 postproc-53 swresample-1 swscale-3)
for LIB in ${LIBS[@]}; do
lib /def:ffmpeg-$FFMPEG_VERSION-win32-dev/lib/$LIB.def /out:ffmpeg-$FFMPEG_VERSION-win32-dev/lib/$LIB.lib /machine:x86
done
Expand All @@ -134,7 +134,7 @@ case $PLATFORM in
;;
windows-x86_64)
# http://ffmpeg.org/platform.html#Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b
LIBS=(avcodec-55 avdevice-55 avfilter-4 avformat-55 avutil-52 postproc-52 swresample-0 swscale-2)
LIBS=(avcodec-56 avdevice-56 avfilter-5 avformat-56 avutil-54 postproc-53 swresample-1 swscale-3)
for LIB in ${LIBS[@]}; do
lib /def:ffmpeg-$FFMPEG_VERSION-win64-dev/lib/$LIB.def /out:ffmpeg-$FFMPEG_VERSION-win64-dev/lib/$LIB.lib /machine:x64
done
Expand Down
File renamed without changes.
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.javacpp-presets</groupId>
<artifactId>ffmpeg</artifactId>
<version>2.3-${project.parent.version}</version>
<version>2.4.2-${project.parent.version}</version>
<packaging>jar</packaging>
<name>JavaCPP Presets for FFmpeg</name>

Expand Down
47 changes: 40 additions & 7 deletions ffmpeg/src/main/java/org/bytedeco/javacpp/avcodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,16 @@ public static class AVCodecDescriptor extends Pointer {
* Codec supports lossless compression. Audio and video codecs only.
*/
public static final int AV_CODEC_PROP_LOSSLESS = (1 << 2);
/**
* Codec supports frame reordering. That is, the coded order (the order in which
* the encoded packets are output by the encoders / stored / input to the
* decoders) may be different from the presentation order of the corresponding
* frames.
*
* For codecs that do not have this property set, PTS and DTS should always be
* equal.
*/
public static final int AV_CODEC_PROP_REORDER = (1 << 3);
/**
* Subtitle codec is bitmap based
* Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
Expand Down Expand Up @@ -981,6 +991,8 @@ public static class RcOverride extends Pointer {
public static final int CODEC_FLAG2_CHUNKS = 0x00008000;
/** Show all frames before the first keyframe */
public static final int CODEC_FLAG2_SHOW_ALL = 0x00400000;
/** Export motion vectors through frame side data */
public static final int CODEC_FLAG2_EXPORT_MVS = 0x10000000;

/* Unsupported options :
* Syntax Arithmetic coding (SAC)
Expand Down Expand Up @@ -1256,6 +1268,12 @@ public static class AVPanScan extends Pointer {
*/
AV_PKT_DATA_DISPLAYMATRIX = 5,

/**
* This side data should be associated with a video stream and contains
* Stereoscopic 3D information in form of the AVStereo3D struct.
*/
AV_PKT_DATA_STEREO3D = 6,

/**
* Recommmends skipping the specified number of samples
* @code
Expand Down Expand Up @@ -1976,22 +1994,25 @@ public static class Get_format_AVCodecContext_IntPointer extends FunctionPointer
*/
public native int me_subpel_quality(); public native AVCodecContext me_subpel_quality(int me_subpel_quality);

// #if FF_API_AFD
/**
* DTG active format information (additional aspect ratio
* information only used in DVB MPEG-2 transport streams)
* 0 if not set.
*
* - encoding: unused
* - decoding: Set by decoder.
* @deprecated Deprecated in favor of AVSideData
*/
public native int dtg_active_format(); public native AVCodecContext dtg_active_format(int dtg_active_format);
public native @Deprecated int dtg_active_format(); public native AVCodecContext dtg_active_format(int dtg_active_format);
public static final int FF_DTG_AFD_SAME = 8;
public static final int FF_DTG_AFD_4_3 = 9;
public static final int FF_DTG_AFD_16_9 = 10;
public static final int FF_DTG_AFD_14_9 = 11;
public static final int FF_DTG_AFD_4_3_SP_14_9 = 13;
public static final int FF_DTG_AFD_16_9_SP_14_9 = 14;
public static final int FF_DTG_AFD_SP_4_3 = 15;
// #endif /* FF_API_AFD */

/**
* maximum motion estimation search range in subpel units
Expand Down Expand Up @@ -2183,12 +2204,14 @@ public static class Get_format_AVCodecContext_IntPointer extends FunctionPointer
*/
public native int chromaoffset(); public native AVCodecContext chromaoffset(int chromaoffset);

// #if FF_API_UNUSED_MEMBERS
/**
* Multiplied by qscale for each frame and added to scene_change_score.
* - encoding: Set by user.
* - decoding: unused
*/
public native int scenechange_factor(); public native AVCodecContext scenechange_factor(int scenechange_factor);
public native @Deprecated int scenechange_factor(); public native AVCodecContext scenechange_factor(int scenechange_factor);
// #endif

/**
*
Expand Down Expand Up @@ -2668,7 +2691,9 @@ public static class Get_buffer2_AVCodecContext_AVFrame_int extends FunctionPoint
public static final int FF_CODER_TYPE_AC = 1;
public static final int FF_CODER_TYPE_RAW = 2;
public static final int FF_CODER_TYPE_RLE = 3;
// #if FF_API_UNUSED_MEMBERS
public static final int FF_CODER_TYPE_DEFLATE = 4;
// #endif /* FF_API_UNUSED_MEMBERS */
/**
* coder type
* - encoding: Set by user.
Expand Down Expand Up @@ -2888,7 +2913,9 @@ public static class Rtp_callback_AVCodecContext_Pointer_int_int extends Function
public static final int FF_DEBUG_DCT_COEFF = 0x00000040;
public static final int FF_DEBUG_SKIP = 0x00000080;
public static final int FF_DEBUG_STARTCODE = 0x00000100;
// #if FF_API_UNUSED_MEMBERS
public static final int FF_DEBUG_PTS = 0x00000200;
// #endif /* FF_API_UNUSED_MEMBERS */
public static final int FF_DEBUG_ER = 0x00000400;
public static final int FF_DEBUG_MMCO = 0x00000800;
public static final int FF_DEBUG_BUGS = 0x00001000;
Expand Down Expand Up @@ -2949,7 +2976,6 @@ public static class Rtp_callback_AVCodecContext_Pointer_int_int extends Function
/**
* opaque 64bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
* @deprecated in favor of pkt_pts
* - encoding: unused
* - decoding: Set by user.
*/
Expand Down Expand Up @@ -2990,7 +3016,9 @@ public static class Rtp_callback_AVCodecContext_Pointer_int_int extends Function
public native int dct_algo(); public native AVCodecContext dct_algo(int dct_algo);
public static final int FF_DCT_AUTO = 0;
public static final int FF_DCT_FASTINT = 1;
// #if FF_API_UNUSED_MEMBERS
public static final int FF_DCT_INT = 2;
// #endif /* FF_API_UNUSED_MEMBERS */
public static final int FF_DCT_MMX = 3;
public static final int FF_DCT_ALTIVEC = 5;
public static final int FF_DCT_FAAN = 6;
Expand All @@ -3011,8 +3039,13 @@ public static class Rtp_callback_AVCodecContext_Pointer_int_int extends Function
public static final int FF_IDCT_SH4 = 9;
// #endif
public static final int FF_IDCT_SIMPLEARM = 10;
// #if FF_API_UNUSED_MEMBERS
public static final int FF_IDCT_IPP = 13;
// #endif /* FF_API_UNUSED_MEMBERS */
public static final int FF_IDCT_XVID = 14;
// #if FF_API_IDCT_XVIDMMX
public static final int FF_IDCT_XVIDMMX = 14;
// #endif /* FF_API_IDCT_XVIDMMX */
public static final int FF_IDCT_SIMPLEARMV5TE = 16;
public static final int FF_IDCT_SIMPLEARMV6 = 17;
// #if FF_API_ARCH_SPARC
Expand Down Expand Up @@ -3786,7 +3819,7 @@ public static class End_frame_AVCodecContext extends FunctionPointer {
/**
* Called for every Macroblock in a slice.
*
* XvMC uses it to replace the ff_MPV_decode_mb().
* XvMC uses it to replace the ff_mpv_decode_mb().
* Instead of decoding to raw picture, MB parameters are
* stored in an array provided by the video driver.
*
Expand Down Expand Up @@ -4940,7 +4973,7 @@ public static class Split_AVCodecContext_BytePointer_int extends FunctionPointer
public native AVCodecParser next(); public native AVCodecParser next(AVCodecParser next);
}

public static native AVCodecParser av_parser_next(AVCodecParser c);
public static native AVCodecParser av_parser_next(@Const AVCodecParser c);

public static native void av_register_codec_parser(AVCodecParser parser);
public static native AVCodecParserContext av_parser_init(int codec_id);
Expand Down Expand Up @@ -5830,7 +5863,7 @@ public static native int av_bitstream_filter_filter(AVBitStreamFilterContext bsf
* This function can be used to iterate over all registered bitstream
* filters.
*/
public static native AVBitStreamFilter av_bitstream_filter_next(AVBitStreamFilter f);
public static native AVBitStreamFilter av_bitstream_filter_next(@Const AVBitStreamFilter f);

/* memory */

Expand Down Expand Up @@ -5904,7 +5937,7 @@ public static native int av_bitstream_filter_filter(AVBitStreamFilterContext bsf
* if hwaccel is non-NULL, returns the next registered hardware accelerator
* after hwaccel, or NULL if hwaccel is the last one.
*/
public static native AVHWAccel av_hwaccel_next(AVHWAccel hwaccel);
public static native AVHWAccel av_hwaccel_next(@Const AVHWAccel hwaccel);


/**
Expand Down
33 changes: 17 additions & 16 deletions ffmpeg/src/main/java/org/bytedeco/javacpp/avfilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1761,30 +1761,31 @@ public static class AVFilterInOut extends Pointer {
public static native void avfilter_inout_free(@ByPtrPtr AVFilterInOut inout);

// #if AV_HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
// #else
/**
* Add a graph described by a string to a graph.
*
* @note The caller must provide the lists of inputs and outputs,
* which therefore must be known before calling the function.
*
* @note The inputs parameter describes inputs of the already existing
* part of the graph; i.e. from the point of view of the newly created
* part, they are outputs. Similarly the outputs parameter describes
* outputs of the already existing filters, which are provided as
* inputs to the parsed filters.
*
* @param graph the filter graph where to link the parsed graph context
* @param filters string to be parsed
* @param inputs pointer to a linked list to the inputs of the graph, may be NULL.
* If non-NULL, *inputs is updated to contain the list of open inputs
* after the parsing, should be freed with avfilter_inout_free().
* @param outputs pointer to a linked list to the outputs of the graph, may be NULL.
* If non-NULL, *outputs is updated to contain the list of open outputs
* after the parsing, should be freed with avfilter_inout_free().
* @return non negative on success, a negative AVERROR code on error
* @deprecated Use avfilter_graph_parse_ptr() instead.
* @param inputs linked list to the inputs of the graph
* @param outputs linked list to the outputs of the graph
* @return zero on success, a negative AVERROR code on error
*/
public static native @Deprecated int avfilter_graph_parse(AVFilterGraph graph, @Cast("const char*") BytePointer filters,
@Cast("AVFilterInOut**") PointerPointer inputs, @Cast("AVFilterInOut**") PointerPointer outputs,
Pointer log_ctx);
public static native @Deprecated int avfilter_graph_parse(AVFilterGraph graph, @Cast("const char*") BytePointer filters,
@ByPtrPtr AVFilterInOut inputs, @ByPtrPtr AVFilterInOut outputs,
public static native int avfilter_graph_parse(AVFilterGraph graph, @Cast("const char*") BytePointer filters,
AVFilterInOut inputs, AVFilterInOut outputs,
Pointer log_ctx);
public static native @Deprecated int avfilter_graph_parse(AVFilterGraph graph, String filters,
@ByPtrPtr AVFilterInOut inputs, @ByPtrPtr AVFilterInOut outputs,
public static native int avfilter_graph_parse(AVFilterGraph graph, String filters,
AVFilterInOut inputs, AVFilterInOut outputs,
Pointer log_ctx);
// #else
// #endif

/**
Expand Down
Loading

0 comments on commit 8e66bb0

Please sign in to comment.