mirror of https://github.com/sipwise/jitsi.git
Optimizes the H.264 decoder (i.e. JNIDecoder) and the image scaler and colorspace converter (i.e. SwScaler) by: (1) passing the decoded frames from JNIDecoder to SwScaler in the native format of FFmpeg thus sparing the conversions from the native to the Java and back to the native format, (2) removes the conversion to RGB from JNIDecoder because the decoded frame will be either converted or scaled by SwScaler afterwards anyway, (3) uses sws_getCachedContext in SwScaler in order to remove the penalty of the expensive initialization that sws_getContext performs and (4) notes that FFmpeg is to be built without --disable-mmx. WARNING: The FFmpeg JNI binaries must be rebuilt.
parent
9aca0d5432
commit
6fc9119de8
@ -1,529 +1,523 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG */
|
||||
/* Header for class net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg */
|
||||
|
||||
#ifndef _Included_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
#define _Included_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
#ifndef _Included_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
#define _Included_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_CODEC_FLAG_LOOP_FILTER
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_CODEC_FLAG_LOOP_FILTER 2048L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_CODEC_ID_H264
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_CODEC_ID_H264 28L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_BUG_AUTODETECT
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_BUG_AUTODETECT 1L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_CMP_CHROMA
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_CMP_CHROMA 256L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_INPUT_BUFFER_PADDING_SIZE
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_INPUT_BUFFER_PADDING_SIZE 8L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_MB_DECISION_SIMPLE
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_FF_MB_DECISION_SIMPLE 0L
|
||||
#undef net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_X264_RC_ABR
|
||||
#define net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_X264_RC_ABR 2L
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: av_free
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_av_1free
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_av_1free
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: av_malloc
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_av_1malloc
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_av_1malloc
|
||||
(JNIEnv *, jclass, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: av_register_all
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_av_1register_1all
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_av_1register_1all
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_alloc_context
|
||||
* Signature: ()J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1alloc_1context
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1alloc_1context
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_alloc_frame
|
||||
* Signature: ()J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1alloc_1frame
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1alloc_1frame
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_close
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1close
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1close
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_decode_video
|
||||
* Signature: (JJ[Z[BI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1decode_1video
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1decode_1video
|
||||
(JNIEnv *, jclass, jlong, jlong, jbooleanArray, jbyteArray, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_encode_video
|
||||
* Signature: (J[BIJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1encode_1video
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1encode_1video
|
||||
(JNIEnv *, jclass, jlong, jbyteArray, jint, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_find_decoder
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1find_1decoder
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1find_1decoder
|
||||
(JNIEnv *, jclass, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_find_encoder
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1find_1encoder
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1find_1encoder
|
||||
(JNIEnv *, jclass, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_init
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1init
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1init
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodec_open
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodec_1open
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodec_1open
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_add_flags
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1add_1flags
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1add_1flags
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_add_partitions
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1add_1partitions
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1add_1partitions
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_get_height
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1get_1height
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1get_1height
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_get_pix_fmt
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1get_1pix_1fmt
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1get_1pix_1fmt
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_get_width
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1get_1width
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1get_1width
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_b_frame_strategy
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1b_1frame_1strategy
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1b_1frame_1strategy
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_bit_rate
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1bit_1rate
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1bit_1rate
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_bit_rate_tolerance
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1bit_1rate_1tolerance
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1bit_1rate_1tolerance
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_chromaoffset
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1chromaoffset
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1chromaoffset
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_crf
|
||||
* Signature: (JF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1crf
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1crf
|
||||
(JNIEnv *, jclass, jlong, jfloat);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_deblockbeta
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1deblockbeta
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1deblockbeta
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_gop_size
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1gop_1size
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1gop_1size
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_i_quant_factor
|
||||
* Signature: (JF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1i_1quant_1factor
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1i_1quant_1factor
|
||||
(JNIEnv *, jclass, jlong, jfloat);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_max_b_frames
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1max_1b_1frames
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1max_1b_1frames
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_mb_decision
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1mb_1decision
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1mb_1decision
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_me_cmp
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1me_1cmp
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1me_1cmp
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_me_method
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1me_1method
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1me_1method
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_me_range
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1me_1range
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1me_1range
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_me_subpel_quality
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1me_1subpel_1quality
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1me_1subpel_1quality
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_pix_fmt
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1pix_1fmt
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1pix_1fmt
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_qcompress
|
||||
* Signature: (JF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1qcompress
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1qcompress
|
||||
(JNIEnv *, jclass, jlong, jfloat);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_quantizer
|
||||
* Signature: (JIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1quantizer
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1quantizer
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_rc_buffer_size
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1rc_1buffer_1size
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1rc_1buffer_1size
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_rc_eq
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1rc_1eq
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1rc_1eq
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_rc_max_rate
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1rc_1max_1rate
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1rc_1max_1rate
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_refs
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1refs
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1refs
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_sample_aspect_ratio
|
||||
* Signature: (JII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1sample_1aspect_1ratio
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1sample_1aspect_1ratio
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_scenechange_threshold
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1scenechange_1threshold
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1scenechange_1threshold
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_size
|
||||
* Signature: (JII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1size
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1size
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_thread_count
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1thread_1count
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1thread_1count
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_ticks_per_frame
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1ticks_1per_1frame
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1ticks_1per_1frame
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_time_base
|
||||
* Signature: (JII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1time_1base
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1time_1base
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_trellis
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1trellis
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1trellis
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avcodeccontext_set_workaround_bugs
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avcodeccontext_1set_1workaround_1bugs
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avcodeccontext_1set_1workaround_1bugs
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avframe_set_data
|
||||
* Signature: (JJJJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avframe_1set_1data
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avframe_1set_1data
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avframe_set_key_frame
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avframe_1set_1key_1frame
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avframe_1set_1key_1frame
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avframe_set_linesize
|
||||
* Signature: (JIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avframe_1set_1linesize
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avframe_1set_1linesize
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avpicture_fill
|
||||
* Signature: (JJIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avpicture_1fill
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avpicture_1fill
|
||||
(JNIEnv *, jclass, jlong, jlong, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avpicture_get_data0
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avpicture_1get_1data0
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avpicture_1get_1data0
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: avpicture_get_size
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_avpicture_1get_1size
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_avpicture_1get_1size
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getRGB32Format
|
||||
* Signature: ()I
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: memcpy
|
||||
* Signature: ([IIIJ)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getRGB32Format
|
||||
(JNIEnv *, jclass);
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_memcpy___3IIIJ
|
||||
(JNIEnv *, jclass, jintArray, jint, jint, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: memcpy
|
||||
* Signature: (J[BII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_memcpy__J_3BII
|
||||
(JNIEnv *, jclass, jlong, jbyteArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getRGB32_1Format
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_BGR32
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getRGB32_11Format
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1BGR32
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getBGR32Format
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_BGR32_1
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getBGR32Format
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1BGR32_11
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getBGR32_1Format
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_RGB24
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getBGR32_11Format
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1RGB24
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getRGB24Format
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_RGB32
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getRGB24Format
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1RGB32
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: getYUV420PFormat
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_RGB32_1
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_getYUV420PFormat
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1RGB32_11
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: img_convert
|
||||
* Signature: (JIJIII)I
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: PIX_FMT_YUV420P
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_img_1convert__JIJIII
|
||||
(JNIEnv *, jclass, jlong, jint, jlong, jint, jint, jint);
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_PIX_1FMT_1YUV420P
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: img_convert
|
||||
* Signature: (Ljava/lang/Object;IJIIIII)I
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: sws_freeContext
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_img_1convert__Ljava_lang_Object_2IJIIIII
|
||||
(JNIEnv *, jclass, jobject, jint, jlong, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_sws_1freeContext
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: img_convert
|
||||
* Signature: (Ljava/lang/Object;ILjava/lang/Object;IIIII)I
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: sws_getCachedContext
|
||||
* Signature: (JIIIIIII)J
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_img_1convert__Ljava_lang_Object_2ILjava_lang_Object_2IIIII
|
||||
(JNIEnv *, jclass, jobject, jint, jobject, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_sws_1getCachedContext
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG
|
||||
* Method: memcpy
|
||||
* Signature: ([IIIJ)V
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: sws_scale
|
||||
* Signature: (JJIILjava/lang/Object;III)I
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_memcpy___3IIIJ
|
||||
(JNIEnv *, jclass, jintArray, jint, jint, jlong);
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_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_video_FFMPEG
|
||||
* Method: memcpy
|
||||
* Signature: (J[BII)V
|
||||
* Class: net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg
|
||||
* Method: sws_scale
|
||||
* Signature: (JLjava/lang/Object;IIIIILjava/lang/Object;III)I
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFMPEG_memcpy__J_3BII
|
||||
(JNIEnv *, jclass, jlong, jbyteArray, jint, jint);
|
||||
JNIEXPORT jint JNICALL Java_net_java_sip_communicator_impl_neomedia_codec_video_FFmpeg_sws_1scale__JLjava_lang_Object_2IIIIILjava_lang_Object_2III
|
||||
(JNIEnv *, jclass, jlong, jobject, jint, jint, jint, jint, jint, jobject, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.neomedia.codec.video;
|
||||
|
||||
/**
|
||||
* Represents a pointer to a native FFmpeg <tt>AVFrame</tt> object.
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class AVFrame
|
||||
{
|
||||
/**
|
||||
* The pointer to the native FFmpeg <tt>AVFrame</tt> object represented by
|
||||
* this instance.
|
||||
*/
|
||||
private final long ptr;
|
||||
|
||||
/**
|
||||
* Initializes a new <tt>AVFrame</tt> instance which is to represent a
|
||||
* specific pointer to a native FFmpeg <tt>AVFrame</tt> object.
|
||||
*
|
||||
* @param ptr the pointer to the native FFmpeg <tt>AVFrame</tt> object to be
|
||||
* represented by the new instance
|
||||
*/
|
||||
public AVFrame(long ptr)
|
||||
{
|
||||
if (ptr == 0)
|
||||
throw new IllegalArgumentException("ptr");
|
||||
|
||||
this.ptr = ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the pointer to the native FFmpeg <tt>AVFrame</tt> object represented
|
||||
* by this instance.
|
||||
*
|
||||
* @return the pointer to the native FFmpeg <tt>AVFrame</tt> object
|
||||
* represented by this instance
|
||||
*/
|
||||
public long getPtr()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.neomedia.codec.video;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import javax.media.*;
|
||||
import javax.media.format.*;
|
||||
|
||||
/**
|
||||
* Implements a <tt>VideoFormat</tt> for a <tt>Buffer</tt> carrying
|
||||
* <tt>AVFrame</tt> as its <tt>data</tt>. While the <tt>AVFrameFormat</tt> class
|
||||
* is not strictly necessary and <tt>VideoFormat</tt> could have be directly
|
||||
* used, it is conceived as an appripriate way to avoid possible matching with
|
||||
* other <tt>VideoFormat</tt>s and a very obvious one.
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class AVFrameFormat
|
||||
extends VideoFormat
|
||||
{
|
||||
private int pixFmt;
|
||||
|
||||
/**
|
||||
* Initializes a new <tt>AVFrameFormat</tt> instance with unspecified size
|
||||
* and frame rate.
|
||||
*/
|
||||
public AVFrameFormat()
|
||||
{
|
||||
this(null, NOT_SPECIFIED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new <tt>AVFrameFormat</tt> instance with specific size and
|
||||
* frame rate.
|
||||
*/
|
||||
public AVFrameFormat(Dimension size, float frameRate)
|
||||
{
|
||||
super("AVFrame", size, NOT_SPECIFIED, AVFrame.class, frameRate);
|
||||
|
||||
this.pixFmt = FFmpeg.PIX_FMT_YUV420P;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new <tt>AVFrameFormat</tt> instance which has the same
|
||||
* properties as this instance.
|
||||
*
|
||||
* @return a new <tt>AVFrameFormat</tt> instance which has the same
|
||||
* properties as this instance
|
||||
*/
|
||||
@Override
|
||||
public Object clone()
|
||||
{
|
||||
AVFrameFormat f = new AVFrameFormat(size, frameRate);
|
||||
|
||||
f.copy(this);
|
||||
return f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void copy(Format f)
|
||||
{
|
||||
super.copy(f);
|
||||
|
||||
if (f instanceof AVFrameFormat)
|
||||
{
|
||||
AVFrameFormat avFrameFormat = (AVFrameFormat) f;
|
||||
|
||||
pixFmt = avFrameFormat.pixFmt;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a specific <tt>Object</tt> represents a value that is
|
||||
* equal to the value represented by this instance.
|
||||
*
|
||||
* @param obj the <tt>Object</tt> to be determined whether it represents a
|
||||
* value that is equal to the value represented by this instance
|
||||
* @return <tt>true</tt> if the specified <tt>obj</tt> represents a value
|
||||
* that is equal to the value represented by this instance; otherwise,
|
||||
* <tt>false</tt>
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if ((obj instanceof AVFrameFormat) && super.equals(obj))
|
||||
{
|
||||
AVFrameFormat avFrameFormat = (AVFrameFormat) obj;
|
||||
|
||||
return (pixFmt == avFrameFormat.pixFmt);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPixFmt()
|
||||
{
|
||||
return pixFmt;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,302 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.neomedia.codec.video.h264;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.media.*;
|
||||
import javax.media.format.*;
|
||||
|
||||
import net.java.sip.communicator.impl.neomedia.codec.*;
|
||||
import net.java.sip.communicator.impl.neomedia.codec.video.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
* Implements <tt>Codec</tt> to represent a depacketizer of H.264 RTP packets
|
||||
* into NAL units.
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
* @author Damian Minkov
|
||||
*/
|
||||
public class DePacketizer
|
||||
extends AbstractCodecExt
|
||||
{
|
||||
|
||||
/**
|
||||
* The <tt>Logger</tt> used by the <tt>DePacketizer</tt> class and its
|
||||
* instances for logging output.
|
||||
*/
|
||||
private static final Logger logger = Logger.getLogger(DePacketizer.class);
|
||||
|
||||
/**
|
||||
* The start sequence of every NAL.
|
||||
*/
|
||||
private static final byte[] NAL_START_SEQUENCE = { 0, 0, 1 };
|
||||
|
||||
/**
|
||||
* If last processed packet has a marker (indicate end of frame).
|
||||
*/
|
||||
private boolean lastHasMarker = false;
|
||||
|
||||
/**
|
||||
* Keeps track of last (input) sequence number in order to avoid
|
||||
* inconsistent data.
|
||||
*/
|
||||
private long lastSequenceNumber = -1;
|
||||
|
||||
/**
|
||||
* The timestamp of the last received RTP packet.
|
||||
*/
|
||||
private long lastTimeStamp = -1;
|
||||
|
||||
/**
|
||||
* The size of the padding at the end of the output data of this
|
||||
* <tt>DePpacketizer</tt> expected by the H.264 decoder.
|
||||
*/
|
||||
private final int outputPaddingSize
|
||||
= FFmpeg.FF_INPUT_BUFFER_PADDING_SIZE;
|
||||
|
||||
/**
|
||||
* In case of inconsistent input drop all data until a marker is received.
|
||||
*/
|
||||
private boolean waitingForMarker = false;
|
||||
|
||||
/**
|
||||
* Initializes a new <tt>DePacketizer</tt> instance which is to depacketize
|
||||
* H.264 RTP packets into NAL units.
|
||||
*/
|
||||
public DePacketizer()
|
||||
{
|
||||
super(
|
||||
"H264 DePacketizer",
|
||||
VideoFormat.class,
|
||||
new VideoFormat[] { new VideoFormat(Constants.H264) });
|
||||
|
||||
inputFormats
|
||||
= new VideoFormat[] { new VideoFormat(Constants.H264_RTP) };
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts a fragment of a NAL unit from a specific FU-A RTP packet
|
||||
* payload.
|
||||
*
|
||||
* @param input the payload of the RTP packet from which a FU-A fragment of
|
||||
* a NAL unit is to be extracted
|
||||
* @param inputOffset the offset in <tt>input</tt> at which the payload
|
||||
* starts
|
||||
* @param inputLength the length of the payload in <tt>input</tt> starting
|
||||
* at <tt>inputOffset</tt>
|
||||
* @param outputBuffer the <tt>Buffer</tt> which is to receive the extracted
|
||||
* FU-A fragment of a NAL unit
|
||||
*/
|
||||
private void deencapsulateFU(
|
||||
byte[] input, int inputOffset, int inputLength,
|
||||
Buffer outputBuffer)
|
||||
{
|
||||
byte fu_indicator = input[inputOffset];
|
||||
|
||||
// Skip fu_indicator.
|
||||
inputOffset++;
|
||||
inputLength--;
|
||||
|
||||
byte fu_header = input[inputOffset];
|
||||
boolean start_bit = (fu_header >> 7) != 0;
|
||||
//boolean end_bit = ((fu_header & 0x40) >> 6) != 0;
|
||||
int nal_type = (fu_header & 0x1f);
|
||||
byte reconstructed_nal;
|
||||
|
||||
//reconstruct this packet's true nal; only the data follows..
|
||||
//the original nal forbidden bit and NRI are stored in this packet's nal;
|
||||
reconstructed_nal = (byte)(fu_indicator & (byte)0xe0);
|
||||
reconstructed_nal |= nal_type;
|
||||
|
||||
// Skip fu_header.
|
||||
inputOffset++;
|
||||
inputLength--;
|
||||
|
||||
int outputOffset = outputBuffer.getOffset();
|
||||
int outputLength = outputBuffer.getLength();
|
||||
int newOutputLength = outputLength + inputLength;
|
||||
|
||||
if (start_bit)
|
||||
newOutputLength += NAL_START_SEQUENCE.length + 1;
|
||||
|
||||
byte[] output
|
||||
= validateByteArraySize(
|
||||
outputBuffer,
|
||||
outputOffset + newOutputLength + outputPaddingSize);
|
||||
|
||||
outputOffset += outputLength;
|
||||
|
||||
if (start_bit)
|
||||
{
|
||||
// Copy in the start sequence and the reconstructed NAL.
|
||||
System.arraycopy(
|
||||
NAL_START_SEQUENCE, 0,
|
||||
output, outputOffset,
|
||||
NAL_START_SEQUENCE.length);
|
||||
outputOffset += NAL_START_SEQUENCE.length;
|
||||
|
||||
output[outputOffset] = reconstructed_nal;
|
||||
outputOffset++;
|
||||
}
|
||||
System.arraycopy(
|
||||
input, inputOffset,
|
||||
output, outputOffset,
|
||||
inputLength);
|
||||
outputOffset += inputLength;
|
||||
|
||||
padOutput(output, outputOffset);
|
||||
|
||||
outputBuffer.setLength(newOutputLength);
|
||||
}
|
||||
|
||||
protected void doClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected void doOpen()
|
||||
throws ResourceUnavailableException
|
||||
{
|
||||
lastHasMarker = false;
|
||||
lastSequenceNumber = -1;
|
||||
lastTimeStamp = -1;
|
||||
waitingForMarker = false;
|
||||
}
|
||||
|
||||
protected int doProcess(Buffer inputBuffer, Buffer outputBuffer)
|
||||
{
|
||||
if (waitingForMarker)
|
||||
{
|
||||
lastSequenceNumber = inputBuffer.getSequenceNumber();
|
||||
if ((inputBuffer.getFlags() & Buffer.FLAG_RTP_MARKER) != 0)
|
||||
{
|
||||
waitingForMarker = false;
|
||||
discardOutputBuffer(outputBuffer);
|
||||
return BUFFER_PROCESSED_OK;
|
||||
}
|
||||
else
|
||||
return OUTPUT_BUFFER_NOT_FILLED;
|
||||
}
|
||||
|
||||
long inputSequenceNumber = inputBuffer.getSequenceNumber();
|
||||
|
||||
// Detect inconsistent input drop.
|
||||
if ((lastSequenceNumber != -1)
|
||||
&& (inputSequenceNumber - lastSequenceNumber > 1))
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
logger.trace(
|
||||
"Dropping RTP data! "
|
||||
+ lastSequenceNumber + "/" + inputSequenceNumber);
|
||||
|
||||
lastSequenceNumber = inputSequenceNumber;
|
||||
waitingForMarker = true;
|
||||
outputBuffer.setLength(0);
|
||||
return OUTPUT_BUFFER_NOT_FILLED;
|
||||
}
|
||||
else
|
||||
lastSequenceNumber = inputSequenceNumber;
|
||||
|
||||
// if the timestamp changes we are starting receiving a new frame
|
||||
// this is also the case when last processed packet has marker
|
||||
long timeStamp = inputBuffer.getTimeStamp();
|
||||
|
||||
if((timeStamp != lastTimeStamp) || lastHasMarker)
|
||||
outputBuffer.setLength(0); // reset
|
||||
// the new frame timestamp
|
||||
lastTimeStamp = timeStamp;
|
||||
|
||||
byte[] input = (byte[]) inputBuffer.getData();
|
||||
int inputOffset = inputBuffer.getOffset();
|
||||
byte fByte = input[inputOffset];
|
||||
|
||||
/*
|
||||
* A value of 00 indicates that the content of the NAL unit is not used
|
||||
* to reconstruct reference pictures for inter picture prediction. Such
|
||||
* NAL units can be discarded without risking the integrity of the
|
||||
* reference pictures.
|
||||
*/
|
||||
int nri = (fByte & 0x60) >> 5;
|
||||
|
||||
if(nri == 0)
|
||||
return OUTPUT_BUFFER_NOT_FILLED;
|
||||
|
||||
int type = fByte & 0x1f;
|
||||
|
||||
try
|
||||
{
|
||||
if ((type >= 1) && (type <= 23)) // Single NAL unit packet per H.264
|
||||
{
|
||||
int outputOffset = outputBuffer.getOffset();
|
||||
int outputLength = outputBuffer.getLength();
|
||||
int inputLength = inputBuffer.getLength();
|
||||
int newOutputLength
|
||||
= outputLength + NAL_START_SEQUENCE.length + inputLength;
|
||||
byte[] output
|
||||
= validateByteArraySize(
|
||||
outputBuffer,
|
||||
outputOffset + newOutputLength + outputPaddingSize);
|
||||
|
||||
outputOffset += outputLength;
|
||||
|
||||
System.arraycopy(
|
||||
NAL_START_SEQUENCE, 0,
|
||||
output, outputOffset,
|
||||
NAL_START_SEQUENCE.length);
|
||||
outputOffset += NAL_START_SEQUENCE.length;
|
||||
|
||||
System.arraycopy(
|
||||
input, inputOffset,
|
||||
output, outputOffset,
|
||||
inputLength);
|
||||
outputOffset += inputLength;
|
||||
|
||||
padOutput(output, outputOffset);
|
||||
|
||||
outputBuffer.setLength(newOutputLength);
|
||||
}
|
||||
else if (type == 28) // FU-A Fragmentation unit
|
||||
{
|
||||
deencapsulateFU(
|
||||
input, inputOffset, inputBuffer.getLength(),
|
||||
outputBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Skipping unsupported NAL unit type");
|
||||
return OUTPUT_BUFFER_NOT_FILLED;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.warn("Cannot parse incoming packet", ex);
|
||||
outputBuffer.setLength(0); // reset
|
||||
return OUTPUT_BUFFER_NOT_FILLED;
|
||||
}
|
||||
|
||||
outputBuffer.setTimeStamp(timeStamp);
|
||||
|
||||
// the rtp marker field points that this is the last packet of
|
||||
// the received frame
|
||||
boolean hasMarker
|
||||
= (inputBuffer.getFlags() & Buffer.FLAG_RTP_MARKER) != 0;
|
||||
|
||||
lastHasMarker = hasMarker;
|
||||
|
||||
return hasMarker ? BUFFER_PROCESSED_OK : OUTPUT_BUFFER_NOT_FILLED;
|
||||
}
|
||||
|
||||
private void padOutput(byte[] output, int outputOffset)
|
||||
{
|
||||
Arrays.fill(
|
||||
output,
|
||||
outputOffset,
|
||||
outputOffset + outputPaddingSize,
|
||||
(byte) 0);
|
||||
}
|
||||
}
|
||||
@ -1,204 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.neomedia.codec.video.h264;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.media.*;
|
||||
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
* Parses H264 rtp headers and extracts the data in the format
|
||||
* the decoder expects it. RFC3984.
|
||||
*
|
||||
* @author Damian Minkov
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class H264Parser
|
||||
{
|
||||
private final Logger logger = Logger.getLogger(H264Parser.class);
|
||||
|
||||
// allocate enough space for the incoming data
|
||||
private static final int MAX_FRAME_SIZE = 1280 * 1024;
|
||||
|
||||
// every NAL starts with this start sequence
|
||||
private static final byte[] startSequence = { 0, 0, 1};
|
||||
|
||||
// the timestamp of the last received rtp packet
|
||||
private long lastTimestamp = -1;
|
||||
|
||||
// the result data is collected in this buffer
|
||||
private final byte[] encodedFrame;
|
||||
|
||||
// the size of the result data
|
||||
private int encodedFrameLen;
|
||||
|
||||
private final int encodedFramePaddingSize;
|
||||
|
||||
/**
|
||||
* If last processed packet has a marker (indicate end of frame).
|
||||
*/
|
||||
private boolean lastHasMarker = false;
|
||||
|
||||
public H264Parser()
|
||||
{
|
||||
this(0);
|
||||
}
|
||||
|
||||
public H264Parser(int encodedFramePaddingSize)
|
||||
{
|
||||
this.encodedFramePaddingSize = encodedFramePaddingSize;
|
||||
this.encodedFrame =
|
||||
new byte[MAX_FRAME_SIZE + this.encodedFramePaddingSize];
|
||||
}
|
||||
|
||||
/**
|
||||
* New rtp packet is received. We push it to the parser to extract the data.
|
||||
* @param inputBuffer the data from the rtp packet
|
||||
* @return true if the result data must be passed to the decoder.
|
||||
*/
|
||||
public boolean pushRTPInput(Buffer inputBuffer)
|
||||
{
|
||||
long currentStamp = inputBuffer.getTimeStamp();
|
||||
|
||||
// the rtp marker field points that this is the last packet of
|
||||
// the received frame
|
||||
boolean hasMarker =
|
||||
(inputBuffer.getFlags() & Buffer.FLAG_RTP_MARKER) != 0;
|
||||
|
||||
// if the timestamp changes we are starting receiving a new frame
|
||||
// this is also the case when last processed packet has marker
|
||||
if(!(currentStamp == lastTimestamp) || lastHasMarker)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
// the new frame timestamp
|
||||
lastTimestamp = currentStamp;
|
||||
|
||||
byte[] inData = (byte[]) inputBuffer.getData();
|
||||
int inputOffset = inputBuffer.getOffset();
|
||||
byte fByte = inData[inputOffset];
|
||||
int type = fByte & 0x1f;
|
||||
int nri = (fByte & 0x60) >> 5;
|
||||
|
||||
if(nri == 0)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
// types from 1 to 23 are treated the same way
|
||||
if (type >= 1 && type <= 23)
|
||||
{
|
||||
System.arraycopy(startSequence, 0, encodedFrame, encodedFrameLen, startSequence.length);
|
||||
encodedFrameLen += startSequence.length;
|
||||
int len = inputBuffer.getLength();
|
||||
System.arraycopy(inData, inputOffset, encodedFrame, encodedFrameLen, len);
|
||||
encodedFrameLen += len;
|
||||
ensureEncodedFramePaddingSize();
|
||||
}
|
||||
//else if (type == 24)
|
||||
//{
|
||||
//return deencapsulateSTAP(inputBuffer);
|
||||
//}
|
||||
else if (type == 28)
|
||||
{
|
||||
deencapsulateFU(fByte, inputBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Skipping unsupported NAL unit type");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
logger.warn("Cannot parse incoming " + ex.getMessage());
|
||||
reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
lastHasMarker = hasMarker;
|
||||
return hasMarker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract data from FU packet. This are packets across several rtp packets,
|
||||
* the first has a start bit set, we store all data and don't care about end
|
||||
* bit.
|
||||
*
|
||||
* @param nal
|
||||
* @param inputBuffer
|
||||
*/
|
||||
private void deencapsulateFU (byte nal, Buffer inputBuffer)
|
||||
{
|
||||
byte[] buf = (byte[])inputBuffer.getData();
|
||||
int len = inputBuffer.getLength();
|
||||
int offset = inputBuffer.getOffset();
|
||||
|
||||
offset++;
|
||||
len--;
|
||||
|
||||
byte fu_indicator = nal;
|
||||
byte fu_header = buf[offset];
|
||||
boolean start_bit = (fu_header >> 7) != 0;
|
||||
//boolean end_bit = ((fu_header & 0x40) >> 6) != 0;
|
||||
int nal_type = (fu_header & 0x1f);
|
||||
byte reconstructed_nal;
|
||||
//reconstruct this packet's true nal; only the data follows..
|
||||
//the original nal forbidden bit and NRI are stored in this packet's nal;
|
||||
reconstructed_nal = (byte)(fu_indicator & (byte)0xe0);
|
||||
reconstructed_nal |= nal_type;
|
||||
|
||||
// skip the fu_header...
|
||||
offset++;
|
||||
len--;
|
||||
|
||||
if (start_bit)
|
||||
{
|
||||
// copy in the start sequence, and the reconstructed nal....
|
||||
System.arraycopy(startSequence, 0, encodedFrame, encodedFrameLen,
|
||||
startSequence.length);
|
||||
encodedFrameLen += startSequence.length;
|
||||
encodedFrame[encodedFrameLen] = reconstructed_nal;
|
||||
encodedFrameLen++;
|
||||
}
|
||||
System.arraycopy(buf, offset, encodedFrame, encodedFrameLen, len);
|
||||
encodedFrameLen += len;
|
||||
ensureEncodedFramePaddingSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result data extracted from one ore more rtp packest.
|
||||
* @return the result data.
|
||||
*/
|
||||
public byte[] getEncodedFrame()
|
||||
{
|
||||
return encodedFrame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result data length.
|
||||
* @return the result length.
|
||||
*/
|
||||
public int getEncodedFrameLen()
|
||||
{
|
||||
return encodedFrameLen;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
encodedFrameLen = 0;
|
||||
ensureEncodedFramePaddingSize();
|
||||
}
|
||||
|
||||
private void ensureEncodedFramePaddingSize()
|
||||
{
|
||||
Arrays.fill(encodedFrame, encodedFrameLen, encodedFrameLen
|
||||
+ encodedFramePaddingSize, (byte) 0);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue