diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-11-14 21:36:59 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-11-14 21:36:59 +0000 |
commit | b1a7aac2d55ad76f737fb3e1cb0aafd3fe935262 (patch) | |
tree | aaa7ab950523ccba0901f9df31172c515d1fe23d /src/native | |
parent | 4c2b22b629b340cfe67adc1fe57a83eb956452ee (diff) | |
download | jitsi-b1a7aac2d55ad76f737fb3e1cb0aafd3fe935262.zip jitsi-b1a7aac2d55ad76f737fb3e1cb0aafd3fe935262.tar.gz jitsi-b1a7aac2d55ad76f737fb3e1cb0aafd3fe935262.tar.bz2 |
- Fixes multiple crashes in PortAudio.
- Removes the DirectSound support from PortAudio in order to prevent issues with bad audio quality.
- Attempts to recognize USB PortAudio devices on Windows as such, ignores the virtual Microsoft Sound Mapper devices to avoid user confusion. Contributed by Vincent Lucas.
Diffstat (limited to 'src/native')
7 files changed, 0 insertions, 1852 deletions
diff --git a/src/native/ffmpeg/README b/src/native/ffmpeg/README deleted file mode 100644 index 7fc54d4..0000000 --- a/src/native/ffmpeg/README +++ /dev/null @@ -1,91 +0,0 @@ -1. lame
-
-./configure \
- --disable-shared --enable-static \
- --enable-nasm \
- --disable-analyzer-hooks --disable-brhist --disable-decoder --disable-frontend \
- --with-pic
-
-FFmpeg looks for lame.h as lame/lame.h but the uninstalled lame-3.98.4 does not
-have the lame directory so go into lame-3.98.4/include and "ln -s . lame" on
-Linux and Mac OS X or "mklink /d lame ." on Windows.
-
-Windows notes:
- - As an alternative to configure and a subsequent make, use:
- make -f Makefile.unix HAVE_NASM=YES NOUNIXCMD=NO UNAME=MSDOS
- Unfortunately, it may not work.
- - Before make, open Makefile, libmp3lame/Makefile and
- libmp3lame/i386/Makefile and make sure that the path to nasm.exe is
- correct (e.g. have NASM=nasm and nasm.exe on the PATH);
- - When building the x64 library on Windows x64, add
- --build=x86_64-w64-mingw32 to the configure line. When building the x64
- library on Windows x86, add --build=i686-pc-mingw32 and
- --host=x86_64-w64-mingw32.
- - If a script outputs errors mentioning \r, it may need dos2unix conversion.
-
-2. x264
-
-- Windows
-
-Download yasm for Windows (32-bit or 64-bit) at
-http://www.tortall.net/projects/yasm/wiki/Download and make it available in the
-PATH.
-
-When building the x64 library on Windows x86, add --host=x86_64-w64-mingw32 to
-the configure line.
-
-./configure --enable-win32thread
-
-- FreeBSD
-
-patch -Np1 -i x264-01-freebsd.patch
-./configure --enable-pic
-
-- Linux, Mac OS X
-
-./configure --enable-pic
-
-3. ffmpeg
-
-patch -Np1 -i ffmpeg-01-libavcodec_libx264.c-zero_latency.patch
-patch -Np1 -i ffmpeg-02-libavcodec_libx264.c-rtp_payload_size.patch
-
-./configure \
- --enable-static --disable-shared --shlibdir=. \
- --disable-debug \
- --disable-everything --disable-network \
- --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver \
- --enable-libmp3lame --enable-encoder=libmp3lame \
- --enable-decoder=h263 --enable-encoder=h263p --enable-parser=h263 \
- --enable-libx264 --enable-gpl \
- --enable-decoder=h264 --enable-encoder=libx264 --enable-parser=h264 \
- --enable-filter=buffer --enable-filter=hflip --enable-filter=scale --enable-filter=nullsink \
- --extra-cflags="-I$MP3LAME_HOME/include -I$X264_HOME" \
- --extra-ldflags="-L$MP3LAME_HOME/libmp3lame -L$MP3LAME_HOME/libmp3lame/.libs -L$X264_HOME"
-
-- Windows
-
-x86:
-Add the following to the configure line:
---target-os=mingw32 --enable-memalign-hack --disable-pthreads --enable-w32threads
-
-x64:
-Add the following to the configure line used for x86:
---arch=amd64 --enable-cross-compile
-
-- FreeBSD, Linux
-
-Add the following to the configure line:
---enable-pic --enable-pthreads --enable-decoder=mjpeg --enable-parser=mjpeg
-
-- Mac OS X
-
-Add the following to the configure line:
---enable-pic --enable-pthreads --enable-memalign-hack
-
-4. jnffmpeg
-
-Define the environment variable JAVA_HOME so that the JNI headers can be found.
-Change the current directory to src\native and run "ant ffmpeg" passing it
-values for the ffmpeg, lame and x264 properties which specify the paths to the
-homes of the development trees of the respective libraries.
diff --git a/src/native/ffmpeg/ffmpeg-01-libavcodec_libx264.c-zero_latency.patch b/src/native/ffmpeg/ffmpeg-01-libavcodec_libx264.c-zero_latency.patch deleted file mode 100644 index da20a32..0000000 --- a/src/native/ffmpeg/ffmpeg-01-libavcodec_libx264.c-zero_latency.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/libavcodec/libx264.c 2011-04-30 17:06:44.304599700 +0300 -+++ b/libavcodec/libx264.c 2011-04-16 05:01:34.391924200 +0300 -@@ -303,6 +303,13 @@ - if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) - x4->params.b_repeat_headers = 0; - -+ /* zero latency */ -+ x4->params.rc.i_lookahead = 0; -+ x4->params.i_sync_lookahead = 0; -+ x4->params.i_bframe = 0; -+ x4->params.b_sliced_threads = 1; -+ x4->params.b_vfr_input = 0; -+ - x4->enc = x264_encoder_open(&x4->params); - if (!x4->enc) - return -1; diff --git a/src/native/ffmpeg/ffmpeg-02-libavcodec_libx264.c-rtp_payload_size.patch b/src/native/ffmpeg/ffmpeg-02-libavcodec_libx264.c-rtp_payload_size.patch deleted file mode 100644 index 0c249ee..0000000 --- a/src/native/ffmpeg/ffmpeg-02-libavcodec_libx264.c-rtp_payload_size.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libavcodec/libx264.c 2011-04-30 17:06:44.304599700 +0300 -+++ b/libavcodec/libx264.c 2011-04-16 05:01:34.391924200 +0300 -@@ -312,6 +312,8 @@ - x4->params.b_sliced_threads = 1; - x4->params.b_vfr_input = 0; - -+ x4->params.i_slice_max_size = avctx->rtp_payload_size; -+ - x4->enc = x264_encoder_open(&x4->params); - if (!x4->enc) - return -1; diff --git a/src/native/ffmpeg/ffmpeg-03-libavcodec_libx264.c-profile.patch b/src/native/ffmpeg/ffmpeg-03-libavcodec_libx264.c-profile.patch deleted file mode 100644 index 5e0b6a9..0000000 --- a/src/native/ffmpeg/ffmpeg-03-libavcodec_libx264.c-profile.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/libavcodec/libx264.c 2011-05-08 14:03:51.000000000 +0300 -+++ b/libavcodec/libx264.c 2011-06-15 14:31:23.000000000 +0300 -@@ -340,6 +340,18 @@ - if (x4->fastfirstpass) - x264_param_apply_fastfirstpass(&x4->params); - -+ if (!x4->profile) -+ switch (avctx->profile) -+ { -+ case FF_PROFILE_H264_BASELINE: -+ x4->profile = "baseline"; -+ break; -+ case FF_PROFILE_H264_MAIN: -+ x4->profile = "main"; -+ break; -+ default: -+ break; -+ } - if (x4->profile) - if (x264_param_apply_profile(&x4->params, x4->profile) < 0) - return -1; diff --git a/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.c b/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.c deleted file mode 100644 index 161bdb8..0000000 --- a/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.c +++ /dev/null @@ -1,774 +0,0 @@ -/*
- * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-#include "net_java_sip_communicator_impl_neomedia_codec_FFmpeg.h"
-
-#include <string.h>
-
-#include <libavutil/avutil.h>
-#include <libavcodec/avcodec.h>
-#include <libavformat/avformat.h>
-#include <libavfilter/avfilter.h>
-#include <libavfilter/avfiltergraph.h>
-#include <libavfilter/vsrc_buffer.h>
-#include <libswscale/swscale.h>
-
-#define DEFINE_AVCODECCONTEXT_F_PROPERTY_SETTER(name, property) \
- JNIEXPORT void JNICALL \
- Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1##name \
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jfloat property) \
- { \
- ((AVCodecContext *) avctx)->property = (float) property; \
- }
-#define DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(name, property) \
- JNIEXPORT void JNICALL \
- Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1##name \
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint property) \
- { \
- ((AVCodecContext *) avctx)->property = (int) property; \
- }
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1free
- (JNIEnv *jniEnv, jclass clazz, jlong ptr)
-{
- av_free ((void *) ptr);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1malloc
- (JNIEnv *jniEnv, jclass clazz, jint size)
-{
- return (jlong) av_malloc ((unsigned int) size);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1register_1all
- (JNIEnv *jniEnv, jclass clazz)
-{
- av_register_all ();
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1alloc_1context
- (JNIEnv *jniEnv, jclass clazz)
-{
- return (jlong) avcodec_alloc_context ();
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1alloc_1frame
- (JNIEnv *jniEnv, jclass clazz)
-{
- return (jlong) avcodec_alloc_frame ();
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1close
- (JNIEnv *jniEnv, jclass clazz, jlong avctx)
-{
- return (jint) avcodec_close ((AVCodecContext *) avctx);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1decode_1video__JJ_3Z_3BI
- (JNIEnv *jniEnv, jclass clazz,
- jlong avctx,
- jlong frame, jbooleanArray got_picture, jbyteArray buf, jint buf_size)
-{
- jint ret;
- int n_got_picture;
-
- if (buf) {
- jbyte *buf_ptr = (*jniEnv)->GetByteArrayElements (jniEnv, buf, NULL);
-
- if (buf_ptr) {
- AVPacket avpkt;
-
- av_init_packet(&avpkt);
- avpkt.data = (uint8_t *) buf_ptr;
- avpkt.size = (int) buf_size;
-
- ret
- = avcodec_decode_video2(
- (AVCodecContext *) avctx,
- (AVFrame *) frame,
- &n_got_picture,
- &avpkt);
-
- (*jniEnv)->ReleaseByteArrayElements (jniEnv, buf, buf_ptr, 0);
-
- if (got_picture) {
- jboolean j_got_picture = n_got_picture ? JNI_TRUE : JNI_FALSE;
-
- (*jniEnv)->SetBooleanArrayRegion (jniEnv, got_picture, 0, 1,
- &j_got_picture);
- }
- } else
- ret = -1;
- } else
- ret = -1;
- return ret;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1decode_1video__JJJI
- (JNIEnv *jniEnv, jclass clazz,
- jlong avctx, jlong avframe, jlong src, jint src_length)
-{
- AVPacket avpkt;
- int got_picture = 0;
- int ret = -1;
-
- av_init_packet(&avpkt);
- avpkt.data = (uint8_t*)src;
- avpkt.size = (int)src_length;
-
- ret
- = avcodec_decode_video2(
- (AVCodecContext *) avctx,
- (AVFrame *)avframe, &got_picture, &avpkt);
-
- return got_picture ? ret : -1;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1encode_1audio
- (JNIEnv *jniEnv, jclass clazz,
- jlong avctx,
- jbyteArray buf, jint buf_offset, jint buf_size,
- jbyteArray samples, jint samples_offset)
-{
- jint ret;
-
- if (buf) {
- jbyte *buf_ptr = (*jniEnv)->GetByteArrayElements (jniEnv, buf, NULL);
-
- if (buf_ptr) {
- jbyte *samples_ptr
- = (*jniEnv)->GetByteArrayElements (jniEnv, samples, NULL);
-
- if (samples_ptr) {
- ret = (jint) avcodec_encode_audio(
- (AVCodecContext *) avctx,
- (uint8_t *) (buf_ptr + buf_offset), (int) buf_size,
- (const short *) (samples_ptr + samples_offset));
- (*jniEnv)->ReleaseByteArrayElements(
- jniEnv,
- samples, samples_ptr,
- JNI_ABORT);
- } else
- ret = -1;
- (*jniEnv)->ReleaseByteArrayElements (jniEnv, buf, buf_ptr, 0);
- } else
- ret = -1;
- } else
- ret = -1;
- return ret;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1encode_1video
- (JNIEnv *jniEnv, jclass clazz,
- jlong avctx, jbyteArray buf, jint buf_size, jlong frame)
-{
- jint ret;
-
- if (buf) {
- jbyte *buf_ptr = (*jniEnv)->GetByteArrayElements (jniEnv, buf, NULL);
-
- if (buf_ptr) {
- ret = (jint)
- avcodec_encode_video ((AVCodecContext *) avctx,
- (uint8_t *) buf_ptr, (int) buf_size,
- (const AVFrame *) frame);
- (*jniEnv)->ReleaseByteArrayElements (jniEnv, buf, buf_ptr, 0);
- } else
- ret = -1;
- } else
- ret = -1;
- return ret;
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1find_1decoder
- (JNIEnv *jniEnv, jclass clazz, jint id)
-{
- return (jlong) avcodec_find_decoder ((enum CodecID) id);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1find_1encoder
- (JNIEnv *jniEnv, jclass clazz, jint id)
-{
- return (jlong) avcodec_find_encoder ((enum CodecID) id);
-}
-
-/**
- * Implements a log callback that does not log anything in order to prevent logs
- * from appearing on stdout and/or stderr.
- */
-static void
-null_log_callback(void* ptr, int level, const char* fmt, va_list vl)
-{
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1init
- (JNIEnv *jniEnv, jclass clazz)
-{
- avcodec_init ();
- av_log_set_callback(null_log_callback);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1open
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jlong codec)
-{
- return (jint) avcodec_open ((AVCodecContext *) avctx, (AVCodec *) codec);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1flags
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint flags)
-{
- ((AVCodecContext *) avctx)->flags |= (int) flags;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1flags2
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint flags2)
-{
- ((AVCodecContext *) avctx)->flags2 |= (int) flags2;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1partitions
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint partitions)
-{
- ((AVCodecContext *) avctx)->partitions |= (int) partitions;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1frame_1size
- (JNIEnv *jniEnv, jclass clazz, jlong avctx)
-{
- return (jint) (((AVCodecContext *) avctx)->frame_size);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1height
- (JNIEnv *jniEnv, jclass clazz, jlong avctx)
-{
- return (jint) (((AVCodecContext *) avctx)->height);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1pix_1fmt
- (JNIEnv *jniEnv, jclass clazz, jlong avctx)
-{
- return (jint) (((AVCodecContext *) avctx)->pix_fmt);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1width
- (JNIEnv *jniEnv, jclass clazz, jlong avctx)
-{
- return (jint) (((AVCodecContext *) avctx)->width);
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(b_1frame_1strategy, b_frame_strategy)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(bit_1rate, bit_rate)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(bit_1rate_1tolerance, bit_rate_tolerance)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(channels, channels)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(chromaoffset, chromaoffset)
-
-DEFINE_AVCODECCONTEXT_F_PROPERTY_SETTER(crf, crf)
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(deblockbeta, deblockbeta)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(gop_1size, gop_size)
-
-DEFINE_AVCODECCONTEXT_F_PROPERTY_SETTER(i_1quant_1factor, i_quant_factor)
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(keyint_1min, keyint_min)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(max_1b_1frames, max_b_frames)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(mb_1decision, mb_decision)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(me_1cmp, me_cmp)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(me_1method, me_method)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(me_1range, me_range)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(me_1subpel_1quality, me_subpel_quality)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(pix_1fmt, pix_fmt)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(profile, profile)
-
-DEFINE_AVCODECCONTEXT_F_PROPERTY_SETTER(qcompress, qcompress)
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1quantizer
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint qmin, jint qmax,
- jint max_qdiff)
-{
- AVCodecContext *n_avctx = (AVCodecContext *) avctx;
-
- n_avctx->qmin = (int) qmin;
- n_avctx->qmax = (int) qmax;
- n_avctx->max_qdiff = (int) max_qdiff;
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(rc_1buffer_1size, rc_buffer_size)
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1rc_1eq
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jstring rc_eq)
-{
- char *n_rc_eq;
-
- if (rc_eq) {
- const char * j_rc_eq =
- (*jniEnv)->GetStringUTFChars (jniEnv, rc_eq, NULL);
-
- if (j_rc_eq) {
- n_rc_eq = strdup (j_rc_eq);
- (*jniEnv)->ReleaseStringUTFChars (jniEnv, rc_eq, j_rc_eq);
- } else
- n_rc_eq = NULL;
- } else
- n_rc_eq = NULL;
- ((AVCodecContext *) avctx)->rc_eq = n_rc_eq;
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(rc_1max_1rate, rc_max_rate)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(refs, refs)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(rtp_1payload_1size, rtp_payload_size)
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1sample_1aspect_1ratio
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint num, jint den)
-{
- AVRational *sample_aspect_ratio =
- &(((AVCodecContext *) avctx)->sample_aspect_ratio);
-
- sample_aspect_ratio->num = (int) num;
- sample_aspect_ratio->den = (int) den;
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(sample_1fmt, sample_fmt)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(sample_1rate, sample_rate)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(scenechange_1threshold, scenechange_threshold)
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1size
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint width, jint height)
-{
- AVCodecContext *n_avctx = (AVCodecContext *) avctx;
-
- n_avctx->width = (int) width;
- n_avctx->height = (int) height;
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(thread_1count, thread_count)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(ticks_1per_1frame, ticks_per_frame)
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1time_1base
- (JNIEnv *jniEnv, jclass clazz, jlong avctx, jint num, jint den)
-{
- AVRational *time_base = &(((AVCodecContext *) avctx)->time_base);
-
- time_base->num = (int) num;
- time_base->den = (int) den;
-}
-
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(trellis, trellis)
-DEFINE_AVCODECCONTEXT_I_PROPERTY_SETTER(workaround_1bugs, workaround_bugs)
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1get_1pts
- (JNIEnv *jniEnv, jclass clazz, jlong frame)
-{
- return (jlong) (((AVFrame *) frame)->pts);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1data
- (JNIEnv *jniEnv, jclass clazz, jlong frame, jlong data0, jlong offset1,
- jlong offset2)
-{
- AVFrame *n_frame = (AVFrame *) frame;
-
- n_frame->data[0] = (uint8_t *) data0;
- n_frame->data[1] = n_frame->data[0] + offset1;
- n_frame->data[2] = n_frame->data[1] + offset2;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1key_1frame
- (JNIEnv *jniEnv, jclass clazz, jlong frame, jboolean key_frame)
-{
- ((AVFrame *) frame)->key_frame = (JNI_TRUE == key_frame) ? 1 : 0;
- ((AVFrame *) frame)->pict_type = (JNI_TRUE == key_frame) ? FF_I_TYPE : 0;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1linesize
- (JNIEnv *jniEnv, jclass clazz, jlong frame, jint linesize0,
- jint linesize1, jint linesize2)
-{
- AVFrame *n_frame = (AVFrame *) frame;
-
- n_frame->linesize[0] = (int) linesize0;
- n_frame->linesize[1] = (int) linesize1;
- n_frame->linesize[2] = (int) linesize2;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1fill
- (JNIEnv *jniEnv, jclass clazz, jlong picture, jlong ptr, jint pix_fmt,
- jint width, jint height)
-{
- return (jint)
- avpicture_fill ((AVPicture *) picture, (uint8_t *) ptr, (int) pix_fmt,
- (int) width, (int) height);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1get_1data0
- (JNIEnv *jniEnv, jclass clazz, jlong picture)
-{
- return (jlong) (((AVPicture *) picture)->data[0]);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1get_1size
- (JNIEnv *jniEnv, jclass clazz, jint pix_fmt, jint width, jint height)
-{
- return (jint) avpicture_get_size ((int) pix_fmt, (int) width, (int) height);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_memcpy___3IIIJ
- (JNIEnv *jniEnv, jclass clazz, jintArray dst, jint dst_offset,
- jint dst_length, jlong src)
-{
- (*jniEnv)
- ->SetIntArrayRegion (jniEnv, dst, dst_offset, dst_length, (jint *) src);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_memcpy__J_3BII
- (JNIEnv *jniEnv, jclass clazz, jlong dst, jbyteArray src,
- jint src_offset, jint src_length)
-{
- (*jniEnv)->GetByteArrayRegion (jniEnv, src, src_offset, src_length,
- (jbyte *) dst);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1BGR32
- (JNIEnv *env, jclass clazz)
-{
- return PIX_FMT_BGR32;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1BGR32_11
- (JNIEnv *env, jclass clazz)
-{
- return PIX_FMT_BGR32_1;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB24
- (JNIEnv *jniEnv, jclass clazz)
-{
- uint32_t test = 1;
- int little_endian = *((uint8_t*)&test);
-
- return little_endian ? PIX_FMT_BGR24 : PIX_FMT_RGB24;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB32
- (JNIEnv *env, jclass clazz)
-{
- return PIX_FMT_RGB32;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB32_11
- (JNIEnv *env, jclass clazz)
-{
- return PIX_FMT_RGB32_1;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1freeContext
- (JNIEnv *jniEnv, jclass clazz, jlong context)
-{
- sws_freeContext ((struct SwsContext *) context);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1getCachedContext
- (JNIEnv *jniEnv, jclass clazz, jlong context, jint srcW, jint srcH,
- jint srcFormat, jint dstW, jint dstH, jint dstFormat, jint flags)
-{
- return
- (jlong)
- sws_getCachedContext(
- (struct SwsContext *) context,
- (int) srcW, (int) srcH, (enum PixelFormat) srcFormat,
- (int) dstW, (int) dstH, (enum PixelFormat) dstFormat,
- (int) flags,
- NULL, NULL, NULL);
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1scale__JJIILjava_lang_Object_2III
- (JNIEnv *jniEnv, jclass clazz, jlong context, jlong src, jint srcSliceY,
- jint srcSliceH, jobject dst, jint dstFormat, jint dstW, jint dstH)
-{
- AVPicture *srcPicture;
- uint8_t *dstPtr;
- int ret;
-
- srcPicture = (AVPicture *) src;
- dstPtr = (*jniEnv)->GetPrimitiveArrayCritical (jniEnv, dst, NULL);
- if (dstPtr) {
- AVPicture dstPicture;
-
- /* Turn the bytes into an AVPicture. */
- avpicture_fill(
- &dstPicture, dstPtr, (int) dstFormat, (int) dstW, (int) dstH);
- ret
- = sws_scale(
- (struct SwsContext *) context,
- (const uint8_t * const *) srcPicture->data, (int *) srcPicture->linesize,
- (int) srcSliceY, (int) srcSliceH,
- (uint8_t **) dstPicture.data,
- (int *) dstPicture.linesize);
- (*jniEnv)->ReleasePrimitiveArrayCritical (jniEnv, dst, dstPtr, 0);
- }
- else
- ret = -1;
- return (jint) ret;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1scale__JLjava_lang_Object_2IIIIILjava_lang_Object_2III
- (JNIEnv *jniEnv, jclass class, jlong context, jobject src,
- jint srcFormat, jint srcW, jint srcH, jint srcSliceY, jint srcSliceH,
- jobject dst, jint dstFormat, jint dstW, jint dstH)
-{
- uint8_t *srcPtr;
- jint ret;
-
- srcPtr = (*jniEnv)->GetPrimitiveArrayCritical (jniEnv, src, NULL);
- if (srcPtr) {
- AVPicture srcPicture;
-
- avpicture_fill(
- &srcPicture, srcPtr, (int) srcFormat, (int) srcW, (int) srcH);
- ret
- = Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1scale__JJIILjava_lang_Object_2III(
- jniEnv, class,
- context,
- (jlong) &srcPicture, srcSliceY, srcSliceH,
- dst, dstFormat, dstW, dstH);
- (*jniEnv)->ReleasePrimitiveArrayCritical (jniEnv, src, srcPtr, 0);
- }
- else
- ret = -1;
- return ret;
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1alloc
- (JNIEnv *jniEnv, jclass clazz)
-{
- return (jlong) avfilter_graph_alloc();
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1config
- (JNIEnv *jniEnv, jclass clazz, jlong graph, jlong log_ctx)
-{
- return
- (jint)
- avfilter_graph_config((AVFilterGraph *) graph, (AVClass *) log_ctx);
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1free
- (JNIEnv *jniEnv, jclass clazz, jlong graph)
-{
- AVFilterGraph *graph_ = (AVFilterGraph *) graph;
-
- avfilter_graph_free(&graph_);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1get_1filter
- (JNIEnv *jniEnv, jclass clazz, jlong graph, jstring name)
-{
- const char *name_ = (*jniEnv)->GetStringUTFChars(jniEnv, name, NULL);
- AVFilterContext *filter;
-
- if (name_)
- {
- filter = avfilter_graph_get_filter((AVFilterGraph *) graph, name_);
- (*jniEnv)->ReleaseStringUTFChars(jniEnv, name, name_);
- }
- else
- filter = NULL;
- return (jlong) filter;
-}
-
-static int
-ffsink_query_formats(AVFilterContext *ctx)
-{
- int err;
-
- /* Make ffsink output in the format in which buffer inputs. */
- if (ctx->priv)
- {
- AVFilterContext *src = ctx->priv;
- const int pix_fmts[] = { src->outputs[0]->in_formats->formats[0], -1 };
-
- avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
- err = 0;
- }
- else
- err = avfilter_default_query_formats(ctx);
- return err;
-}
-
-static void
-ffsink_uninit(AVFilterContext *ctx)
-{
- /*
- * Do not let FFmpeg libavfilter erroneously free the buffer video source
- * thinking that it is the priv allocated to this ffsink video sink via
- * priv_size.
- */
- ctx->priv = NULL;
-}
-
-JNIEXPORT jint JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1parse
- (JNIEnv *jniEnv, jclass clazz,
- jlong graph, jstring filters, jlong inputs, jlong outputs, jlong log_ctx)
-{
- const char *filters_ = (*jniEnv)->GetStringUTFChars(jniEnv, filters, NULL);
- int ret;
-
- if (filters_)
- {
- AVFilterGraph *graph_ = (AVFilterGraph *) graph;
-
- ret
- = avfilter_graph_parse(
- graph_,
- filters_,
- (AVFilterInOut *) inputs, (AVFilterInOut *) outputs,
- (AVClass *) log_ctx);
-
- /*
- * FIXME The implementation at the time of this writing presumes that
- * the first filter is buffer, the last filter is nullsink meant to be
- * ffsink and the ffsink is expected to output in the format in which
- * the buffer inputs.
- */
- if (0 == ret)
- {
- /* Turn nullsink into ffsink. */
- unsigned filterCount = graph_->filter_count;
-
- if (filterCount)
- {
- AVFilterContext *ffsink = (graph_->filters)[filterCount - 1];
- AVFilterContext *buffer = (graph_->filters)[0];
-
- /*
- * Make sure query_format of ffsink outputs in the format in
- * which buffer inputs. Otherwise, the output format may end up
- * different on the C and Java sides.
- */
- ffsink->filter->uninit = ffsink_uninit;
- ffsink->priv = buffer;
- ffsink->filter->query_formats = ffsink_query_formats;
-
- ffsink->input_pads->min_perms = AV_PERM_READ;
- ffsink->input_pads->start_frame = NULL;
- }
- }
-
- (*jniEnv)->ReleaseStringUTFChars(jniEnv, filters, filters_);
- }
- else
- ret = AVERROR(ENOMEM);
- return (jint) ret;
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1register_1all
- (JNIEnv *jniEnv, jclass clazz)
-{
- avfilter_register_all();
-}
-
-JNIEXPORT void JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1unref_1buffer
- (JNIEnv *jniEnv, jclass clazz, jlong ref)
-{
- avfilter_unref_buffer((AVFilterBufferRef *) ref);
-}
-
-JNIEXPORT jlong JNICALL
-Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_get_1filtered_1video_1frame
- (JNIEnv *jniEnv, jclass clazz,
- jlong input, jint width, jint height, jint pixFmt,
- jlong buffer, jlong ffsink, jlong output)
-{
- AVFrame *input_ = (AVFrame *) input;
- AVFilterContext *buffer_ = (AVFilterContext *) buffer;
- AVFilterBufferRef *ref = NULL;
-
- input_->width = width;
- input_->height = height;
- input_->format = pixFmt;
- if (av_vsrc_buffer_add_frame(buffer_, input_) == 0)
- {
- AVFilterContext *ffsink_ = (AVFilterContext *) ffsink;
- AVFilterLink *ffsinkLink = (ffsink_->inputs)[0];
-
- if (avfilter_request_frame(ffsinkLink) == 0)
- {
- ref = ffsinkLink->cur_buf;
- if (ref)
- {
- AVFrame *output_ = (AVFrame *) output;
-
- /*
- * The data of cur_buf will be returned into output so it needs
- * to exist at least while output needs it. So take ownership of
- * cur_buf and the user of output will unref it when they are
- * done with output.
- */
- ffsinkLink->cur_buf = NULL;
-
- memcpy(output_->data, ref->data, sizeof(output_->data));
- memcpy(
- output_->linesize,
- ref->linesize,
- sizeof(output_->linesize));
- output_->interlaced_frame = ref->video->interlaced;
- output_->top_field_first = ref->video->top_field_first;
- }
- }
- }
- return (jlong) ref;
-}
diff --git a/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.h b/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.h deleted file mode 100644 index 1823d73..0000000 --- a/src/native/ffmpeg/net_java_sip_communicator_impl_neomedia_codec_FFmpeg.h +++ /dev/null @@ -1,669 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class net_java_sip_communicator_impl_neomedia_codec_FFmpeg */
-
-#ifndef _Included_net_java_sip_communicator_impl_neomedia_codec_FFmpeg
-#define _Included_net_java_sip_communicator_impl_neomedia_codec_FFmpeg
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: av_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: av_malloc
- * Signature: (I)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1malloc
- (JNIEnv *, jclass, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: av_register_all
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_av_1register_1all
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_alloc_context
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1alloc_1context
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_alloc_frame
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1alloc_1frame
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_close
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1close
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_decode_video
- * Signature: (JJ[Z[BI)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1decode_1video__JJ_3Z_3BI
- (JNIEnv *, jclass, jlong, jlong, jbooleanArray, jbyteArray, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_decode_video
- * Signature: (JJJI)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1decode_1video__JJJI
- (JNIEnv *, jclass, jlong, jlong, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_encode_audio
- * Signature: (J[BII[BI)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1encode_1audio
- (JNIEnv *, jclass, jlong, jbyteArray, jint, jint, jbyteArray, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_encode_video
- * Signature: (J[BIJ)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1encode_1video
- (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_find_decoder
- * Signature: (I)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1find_1decoder
- (JNIEnv *, jclass, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_find_encoder
- * Signature: (I)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1find_1encoder
- (JNIEnv *, jclass, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1init
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodec_open
- * Signature: (JJ)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodec_1open
- (JNIEnv *, jclass, jlong, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_add_flags
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1flags
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_add_flags2
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1flags2
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_add_partitions
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1add_1partitions
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_get_frame_size
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1frame_1size
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_get_height
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1height
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_get_pix_fmt
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1pix_1fmt
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_get_width
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1get_1width
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_b_frame_strategy
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1b_1frame_1strategy
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_bit_rate
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1bit_1rate
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_bit_rate_tolerance
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1bit_1rate_1tolerance
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_channels
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1channels
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_chromaoffset
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1chromaoffset
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_crf
- * Signature: (JF)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1crf
- (JNIEnv *, jclass, jlong, jfloat);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_deblockbeta
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1deblockbeta
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_gop_size
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1gop_1size
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_i_quant_factor
- * Signature: (JF)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1i_1quant_1factor
- (JNIEnv *, jclass, jlong, jfloat);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_keyint_min
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1keyint_1min
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_max_b_frames
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1max_1b_1frames
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_mb_decision
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1mb_1decision
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_me_cmp
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1me_1cmp
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_me_method
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1me_1method
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_me_range
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1me_1range
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_me_subpel_quality
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1me_1subpel_1quality
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_pix_fmt
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1pix_1fmt
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_profile
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1profile
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_qcompress
- * Signature: (JF)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1qcompress
- (JNIEnv *, jclass, jlong, jfloat);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_quantizer
- * Signature: (JIII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1quantizer
- (JNIEnv *, jclass, jlong, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_rc_buffer_size
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1rc_1buffer_1size
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_rc_eq
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1rc_1eq
- (JNIEnv *, jclass, jlong, jstring);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_rc_max_rate
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1rc_1max_1rate
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_refs
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1refs
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_rtp_payload_size
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1rtp_1payload_1size
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_sample_aspect_ratio
- * Signature: (JII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1sample_1aspect_1ratio
- (JNIEnv *, jclass, jlong, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_sample_fmt
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1sample_1fmt
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_sample_rate
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1sample_1rate
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_scenechange_threshold
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1scenechange_1threshold
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_size
- * Signature: (JII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1size
- (JNIEnv *, jclass, jlong, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_thread_count
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1thread_1count
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_ticks_per_frame
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1ticks_1per_1frame
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_time_base
- * Signature: (JII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1time_1base
- (JNIEnv *, jclass, jlong, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_trellis
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1trellis
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avcodeccontext_set_workaround_bugs
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avcodeccontext_1set_1workaround_1bugs
- (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avframe_get_pts
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1get_1pts
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avframe_set_data
- * Signature: (JJJJ)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1data
- (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avframe_set_key_frame
- * Signature: (JZ)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1key_1frame
- (JNIEnv *, jclass, jlong, jboolean);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avframe_set_linesize
- * Signature: (JIII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avframe_1set_1linesize
- (JNIEnv *, jclass, jlong, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avpicture_fill
- * Signature: (JJIII)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1fill
- (JNIEnv *, jclass, jlong, jlong, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avpicture_get_data0
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1get_1data0
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avpicture_get_size
- * Signature: (III)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avpicture_1get_1size
- (JNIEnv *, jclass, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: memcpy
- * Signature: ([IIIJ)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_memcpy___3IIIJ
- (JNIEnv *, jclass, jintArray, jint, jint, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: memcpy
- * Signature: (J[BII)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_memcpy__J_3BII
- (JNIEnv *, jclass, jlong, jbyteArray, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: PIX_FMT_BGR32
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1BGR32
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: PIX_FMT_BGR32_1
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1BGR32_11
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: PIX_FMT_RGB24
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB24
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: PIX_FMT_RGB32
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB32
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: PIX_FMT_RGB32_1
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_PIX_1FMT_1RGB32_11
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: sws_freeContext
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1freeContext
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: sws_getCachedContext
- * Signature: (JIIIIIII)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1getCachedContext
- (JNIEnv *, jclass, jlong, jint, jint, jint, jint, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: sws_scale
- * Signature: (JJIILjava/lang/Object;III)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1scale__JJIILjava_lang_Object_2III
- (JNIEnv *, jclass, jlong, jlong, jint, jint, jobject, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: sws_scale
- * Signature: (JLjava/lang/Object;IIIIILjava/lang/Object;III)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_sws_1scale__JLjava_lang_Object_2IIIIILjava_lang_Object_2III
- (JNIEnv *, jclass, jlong, jobject, jint, jint, jint, jint, jint, jobject, jint, jint, jint);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_graph_alloc
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1alloc
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_graph_config
- * Signature: (JJ)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1config
- (JNIEnv *, jclass, jlong, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_graph_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_graph_get_filter
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1get_1filter
- (JNIEnv *, jclass, jlong, jstring);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_graph_parse
- * Signature: (JLjava/lang/String;JJJ)I
- */
-JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1graph_1parse
- (JNIEnv *, jclass, jlong, jstring, jlong, jlong, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_register_all
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1register_1all
- (JNIEnv *, jclass);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: avfilter_unref_buffer
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_avfilter_1unref_1buffer
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: net_java_sip_communicator_impl_neomedia_codec_FFmpeg
- * Method: get_filtered_video_frame
- * Signature: (JIIIJJJ)J
- */
-JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_FFmpeg_get_1filtered_1video_1frame
- (JNIEnv *, jclass, jlong, jint, jint, jint, jlong, jlong, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/native/ffmpeg/x264-01-freebsd.patch b/src/native/ffmpeg/x264-01-freebsd.patch deleted file mode 100644 index f02d603..0000000 --- a/src/native/ffmpeg/x264-01-freebsd.patch +++ /dev/null @@ -1,270 +0,0 @@ -diff -Nru a/version.sh b/version.sh ---- a/version.sh 2009-12-08 22:45:08.000000000 +0100 -+++ b/version.sh 2010-01-19 19:10:23.000000000 +0100 -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - git rev-list HEAD | sort > config.git-hash - LOCALVER=`wc -l config.git-hash | awk '{print $1}'` - if [ $LOCALVER \> 1 ] ; then -diff -Nru a/Makefile b/Makefile ---- a/Makefile 2009-12-08 22:45:08.000000000 +0100 -+++ b/Makefile 2010-01-19 19:10:40.000000000 +0100 -@@ -10,7 +10,8 @@ - common/quant.c common/vlc.c \ - encoder/analyse.c encoder/me.c encoder/ratecontrol.c \ - encoder/set.c encoder/macroblock.c encoder/cabac.c \ -- encoder/cavlc.c encoder/encoder.c encoder/lookahead.c -+ encoder/cavlc.c encoder/encoder.c encoder/lookahead.c \ -+ bsdlogf.c - - SRCCLI = x264.c input/yuv.c input/y4m.c output/raw.c \ - output/matroska.c output/matroska_ebml.c \ -diff -Nru a/bsdlog.h b/bsdlog.h ---- a/bsdlog.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/bsdlog.h 2010-01-19 19:08:07.000000000 +0100 -@@ -0,0 +1,143 @@ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunSoft, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ */ -+ -+#ifndef bsdlog_headerfile -+#define bsdlog_headerfile -+ -+#include <math.h> -+#include <sys/types.h> -+ -+ -+//float log2f(float); -+ -+ -+ -+ -+#if (__BYTE_ORDER == __LITTLE_ENDIAN) && !defined(__arm__) -+ -+typedef union -+{ -+double value; -+struct -+{ -+u_int32_t lsw; -+u_int32_t msw; -+} parts; -+} ieee_double_shape_type; -+ -+#endif -+ -+ -+ -+ -+#if (__BYTE_ORDER == __BIG_ENDIAN) || defined(__arm__) -+ -+/* this should be on a BIG ENDIAN platform instead of the previous code */ -+/* I commented this because my compiler have a mess with macros *_ENDIAN */ -+ -+/* -+typedef union -+{ -+double value; -+struct -+{ -+u_int32_t msw; -+u_int32_t lsw; -+} parts; -+} ieee_double_shape_type; -+*/ -+ -+#endif -+ -+ -+ -+ -+ -+#define EXTRACT_WORDS(ix0,ix1,d) \ -+do { \ -+ieee_double_shape_type ew_u; \ -+ew_u.value = (d); \ -+(ix0) = ew_u.parts.msw; \ -+(ix1) = ew_u.parts.lsw; \ -+} while (0) -+/* Get the more significant 32 bit int from a double. */ -+ -+#define GET_HIGH_WORD(i,d) \ -+do { \ -+ieee_double_shape_type gh_u; \ -+gh_u.value = (d); \ -+(i) = gh_u.parts.msw; \ -+} while (0) -+ -+/* Get the less significant 32 bit int from a double. */ -+ -+#define GET_LOW_WORD(i,d) \ -+do { \ -+ieee_double_shape_type gl_u; \ -+gl_u.value = (d); \ -+(i) = gl_u.parts.lsw; \ -+} while (0) -+ -+/* Set a double from two 32 bit ints. */ -+ -+ -+/* Set the more significant 32 bits of a double from an int. */ -+ -+#define SET_HIGH_WORD(d,v) \ -+do { \ -+ieee_double_shape_type sh_u; \ -+sh_u.value = (d); \ -+sh_u.parts.msw = (v); \ -+(d) = sh_u.value; \ -+} while (0) -+ -+/* Set the less significant 32 bits of a double from an int. */ -+ -+#define SET_LOW_WORD(d,v) \ -+do { \ -+ieee_double_shape_type sl_u; \ -+sl_u.value = (d); \ -+sl_u.parts.lsw = (v); \ -+(d) = sl_u.value; \ -+} while (0) -+ -+ -+ -+/* A union which permits us to convert between a float and a 32 bit -+int. */ -+ -+typedef union -+{ -+float value; -+u_int32_t word; -+} ieee_float_shape_type; -+ -+/* Get a 32 bit int from a float. */ -+ -+#define GET_FLOAT_WORD(i,d) \ -+do { \ -+ieee_float_shape_type gf_u; \ -+gf_u.value = (d); \ -+(i) = gf_u.word; \ -+} while (0) -+ -+/* Set a float from a 32 bit int. */ -+ -+#define SET_FLOAT_WORD(d,i) \ -+do { \ -+ieee_float_shape_type sf_u; \ -+sf_u.word = (i); \ -+(d) = sf_u.value; \ -+} while (0) -+ -+ -+ -+#endif -diff -Nru a/bsdlogf.c b/bsdlogf.c ---- a/bsdlogf.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/bsdlogf.c 2010-01-19 19:08:07.000000000 +0100 -@@ -0,0 +1,77 @@ -+/* -+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@xxxxxxxxxxx -+ */ -+ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunPro, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ */ -+ -+#include "bsdlog.h" -+ -+ -+static const float -+ln2 = 0.6931471805599452862268, -+two25 = 3.355443200e+07, /* 0x4c000000 */ -+Lg1 = 6.6666668653e-01, /* 3F2AAAAB */ -+Lg2 = 4.0000000596e-01, /* 3ECCCCCD */ -+Lg3 = 2.8571429849e-01, /* 3E924925 */ -+Lg4 = 2.2222198546e-01, /* 3E638E29 */ -+Lg5 = 1.8183572590e-01, /* 3E3A3325 */ -+Lg6 = 1.5313838422e-01, /* 3E1CD04F */ -+Lg7 = 1.4798198640e-01; /* 3E178897 */ -+ -+static const float zero = 0.0; -+ -+ -+ -+float log2f(float x) -+{ -+ float hfsq,f,s,z,R,w,t1,t2,dk; -+ int32_t k,ix,i,j; -+ -+ GET_FLOAT_WORD(ix,x); -+ -+ k=0; -+ if (ix < 0x00800000) { /* x < 2**-126 */ -+ if ((ix&0x7fffffff)==0) -+ return -two25/zero; /* log(+-0)=-inf */ -+ if (ix<0) return (x-x)/zero; /* log(-#) = NaN */ -+ k -= 25; x *= two25; /* subnormal number, scale up x */ -+ GET_FLOAT_WORD(ix,x); -+ } -+ if (ix >= 0x7f800000) return x+x; -+ k += (ix>>23)-127; -+ ix &= 0x007fffff; -+ i = (ix+(0x95f64<<3))&0x800000; -+ SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */ -+ k += (i>>23); -+ dk = (float)k; -+ f = x-(float)1.0; -+ if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */ -+ if (f==zero) -+ return (dk); -+ R = f*f*((float)0.5-(float)0.33333333333333333*f); -+ return (dk-(R-f)/ln2); -+ } -+ s = f/((float)2.0+f); -+ z = s*s; -+ i = ix-(0x6147a<<3); -+ w = z*z; -+ j = (0x6b851<<3)-ix; -+ t1= w*(Lg2+w*(Lg4+w*Lg6)); -+ t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); -+ i |= j; -+ R = t2+t1; -+ if(i>0) { -+ hfsq=(float)0.5*f*f; -+ return (dk-(hfsq-s*(hfsq+R)-f)/ln2); -+ } else -+ return (dk-((s*(f-R))-f)/ln2); -+} -diff -Nru a/configure b/configure ---- a/configure 2009-12-08 22:45:08.000000000 +0100 -+++ b/configure 2010-01-19 19:10:14.000000000 +0100 -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/local/bin/bash - - if test x"$1" = x"-h" -o x"$1" = x"--help" ; then - -diff -Nru a/encoder/analyse.c b/encoder/analyse.c ---- a/encoder/analyse.c 2009-12-08 22:45:08.000000000 +0100 -+++ b/encoder/analyse.c 2010-01-19 19:08:07.000000000 +0100 -@@ -33,6 +33,7 @@ - #include "ratecontrol.h" - #include "analyse.h" - #include "rdo.c" -+#include "../bsdlog.h" - - typedef struct - { |