Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec
Class FFmpeg

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.codec.FFmpeg

public class FFmpeg
extends Object

Provides the interface to the native FFmpeg library.

Author:
Lyubomir Marinov, Sebastien Vincent

Field Summary
static long AV_NOPTS_VALUE
          No pts value.
static int AV_SAMPLE_FMT_S16
          The AV sample format for signed 16.
static int CODEC_FLAG_AC_PRED
          AC pred flag.
static int CODEC_FLAG_H263P_SLICE_STRUCT
          H263+ slice struct flag.
static int CODEC_FLAG_H263P_UMV
          H263+ UMV flag.
static int CODEC_FLAG_LOOP_FILTER
          Loop filter flag.
static int CODEC_FLAG2_CHUNKS
          Allow to pass incomplete frame to decoder.
static int CODEC_FLAG2_INTRA_REFRESH
          Intra refresh flag2.
static int CODEC_ID_H263
          H263 codec ID.
static int CODEC_ID_H263P
          H263+ codec ID.
static int CODEC_ID_H264
          H264 codec ID.
static int CODEC_ID_MJPEG
          MJPEG codec ID.
static int CODEC_ID_MP3
          MP3 codec ID.
static int FF_BUG_AUTODETECT
          Work around bugs in encoders which sometimes cannot be detected automatically.
static int FF_CMP_CHROMA
           
static int FF_INPUT_BUFFER_PADDING_SIZE
          Padding size for FFmpeg input buffer.
static int FF_MB_DECISION_SIMPLE
           
static int FF_MIN_BUFFER_SIZE
          The minimum encoding buffer size defined by libavcodec.
static int FF_PROFILE_H264_BASELINE
          The H264 baseline profile.
static int FF_PROFILE_H264_MAIN
          The H264 main profile.
static int PIX_FMT_ARGB
          ARGB format.
static int PIX_FMT_BGR24_1
          BGR24 format as of FFmpeg.
static int PIX_FMT_BGR32
          BGR32 format handled in endian specific manner.
static int PIX_FMT_BGR32_1
          BGR32_1 format handled in endian specific manner.
static int PIX_FMT_NONE
          "NONE" format.
static int PIX_FMT_NV12
          NV12 format.
static int PIX_FMT_RGB24
          RGB24 format handled in endian specific manner.
static int PIX_FMT_RGB24_1
          RGB24 format as of FFmpeg.
static int PIX_FMT_RGB32
          RGB32 format handled in endian specific manner.
static int PIX_FMT_RGB32_1
          RGB32_1 format handled in endian specific manner.
static int PIX_FMT_UYVY422
          UYVY422 format.
static int PIX_FMT_UYYVYY411
          UYYVYY411 format.
static int PIX_FMT_YUV420P
          YUV420P format.
static int PIX_FMT_YUVJ422P
          YUVJ422P format.
static int PIX_FMT_YUYV422
          YUYV422 format.
static int SWS_BICUBIC
          BICUBIC type for libswscale conversion.
 
Constructor Summary
FFmpeg()
           
 
Method Summary
static void av_free(long ptr)
          Free a native pointer allocated by av_malloc.
static long av_malloc(int size)
          Allocate memory.
static void av_register_all()
          Initialize libavformat and register all the muxers, demuxers and protocols.
static long avcodec_alloc_context()
          Allocate a AVContext.
static long avcodec_alloc_frame()
          Allocate a AVFrame.
static int avcodec_close(long avctx)
          Close an AVCodecContext
static int avcodec_decode_video(long avctx, long frame, boolean[] got_picture, byte[] buf, int buf_size)
          Decode a video frame.
static int avcodec_decode_video(long avctx, long avframe, long src, int src_length)
          Decode a video frame.
static int avcodec_encode_audio(long avctx, byte[] buf, int buf_offset, int buf_size, byte[] samples, int samples_offset)
          Encodes an audio frame from samples into buf.
static int avcodec_encode_video(long avctx, byte[] buff, int buf_size, long frame)
          Encode a video frame.
static long avcodec_find_decoder(int id)
          Find a registered decoder with a matching ID.
static long avcodec_find_encoder(int id)
          Finds a registered encoder with a matching codec ID.
static void avcodec_init()
          Initializes FFmpeg's avcodec.
static int avcodec_open(long avctx, long codec)
          Initializes the specified AVCodecContext to use the specified AVCodec.
static void avcodeccontext_add_flags(long avctx, int flags)
          Add specific flags to AVCodecContext's flags member.
static void avcodeccontext_add_flags2(long avctx, int flags2)
          Add specific flags to AVCodecContext's flags2 member.
static void avcodeccontext_add_partitions(long avctx, int partitions)
          Add specified partitions to the avcodeccontext.
static int avcodeccontext_get_frame_size(long avctx)
          Gets the samples per packet of the specified AVCodecContext.
static int avcodeccontext_get_height(long avctx)
          Get height of the video.
static int avcodeccontext_get_pix_fmt(long avctx)
          Get pixel format.
static int avcodeccontext_get_width(long avctx)
          Get width of the video.
static void avcodeccontext_set_b_frame_strategy(long avctx, int b_frame_strategy)
          Set the B-Frame strategy.
static void avcodeccontext_set_bit_rate_tolerance(long avctx, int bit_rate_tolerance)
          Set the bit rate tolerance
static void avcodeccontext_set_bit_rate(long avctx, int bit_rate)
          Sets the average bit rate of the specified AVCodecContext.
static void avcodeccontext_set_channels(long avctx, int channels)
          Sets the number of channels of the specified AVCodecContext.
static void avcodeccontext_set_chromaoffset(long avctx, int chromaoffset)
           
static void avcodeccontext_set_crf(long avctx, float crf)
           
static void avcodeccontext_set_deblockbeta(long avctx, int deblockbeta)
           
static void avcodeccontext_set_gop_size(long avctx, int gop_size)
          Set the gop size (key frame interval).
static void avcodeccontext_set_i_quant_factor(long avctx, float i_quant_factor)
           
static void avcodeccontext_set_keyint_min(long avctx, int keyint_min)
          Sets the minimum GOP size.
static void avcodeccontext_set_max_b_frames(long avctx, int max_b_frames)
          Set the maximum B frames.
static void avcodeccontext_set_mb_decision(long avctx, int mb_decision)
           
static void avcodeccontext_set_me_cmp(long avctx, int me_cmp)
           
static void avcodeccontext_set_me_method(long avctx, int me_method)
           
static void avcodeccontext_set_me_range(long avctx, int me_range)
           
static void avcodeccontext_set_me_subpel_quality(long avctx, int me_subpel_quality)
           
static void avcodeccontext_set_pix_fmt(long avctx, int pix_fmt)
          Set the pixel format.
static void avcodeccontext_set_profile(long avctx, int profile)
           
static void avcodeccontext_set_qcompress(long avctx, float qcompress)
           
static void avcodeccontext_set_quantizer(long avctx, int qmin, int qmax, int max_qdiff)
           
static void avcodeccontext_set_rc_buffer_size(long avctx, int rc_buffer_size)
           
static void avcodeccontext_set_rc_eq(long avctx, String rc_eq)
           
static void avcodeccontext_set_rc_max_rate(long avctx, int rc_max_rate)
           
static void avcodeccontext_set_refs(long avctx, int refs)
           
static void avcodeccontext_set_rtp_payload_size(long avctx, int rtp_payload_size)
          Set the RTP payload size.
static void avcodeccontext_set_sample_aspect_ratio(long avctx, int num, int den)
           
static void avcodeccontext_set_sample_fmt(long avctx, int sample_fmt)
           
static void avcodeccontext_set_sample_rate(long avctx, int sample_rate)
          Sets the samples per second of the specified AVCodecContext.
static void avcodeccontext_set_scenechange_threshold(long avctx, int scenechange_threshold)
          Set the scene change threshold (in percent).
static void avcodeccontext_set_size(long avctx, int width, int height)
          Set the size of the video.
static void avcodeccontext_set_thread_count(long avctx, int thread_count)
          Set the number of thread.
static void avcodeccontext_set_ticks_per_frame(long avctx, int ticks_per_frame)
           
static void avcodeccontext_set_time_base(long avctx, int num, int den)
           
static void avcodeccontext_set_trellis(long avctx, int trellis)
           
static void avcodeccontext_set_workaround_bugs(long avctx, int workaround_bugs)
           
static long avfilter_graph_alloc()
          Allocates a new AVFilterGraph instance.
static int avfilter_graph_config(long graph, long log_ctx)
          Checks the validity and configures all the links and formats in a specific AVFilterGraph instance.
static void avfilter_graph_free(long graph)
          Frees a specific AVFilterGraph instance and destroys its links.
static long avfilter_graph_get_filter(long graph, String name)
          Gets a pointer to an AVFilterContext instance with a specific name in a specific AVFilterGraph instance.
static int avfilter_graph_parse(long graph, String filters, long inputs, long outputs, long log_ctx)
          Adds a filter graph described by a String to a specific AVFilterGraph instance.
static void avfilter_register_all()
          Initializes the libavfilter system and registers all built-in filters.
static void avfilter_unref_buffer(long ref)
          Removes a reference to a buffer.
static long avframe_get_pts(long frame)
           
static void avframe_set_data(long frame, long data0, long offset1, long offset2)
           
static void avframe_set_key_frame(long frame, boolean key_frame)
           
static void avframe_set_linesize(long frame, int linesize0, int linesize1, int linesize2)
           
static int avpicture_fill(long picture, long ptr, int pix_fmt, int width, int height)
           
static long avpicture_get_data0(long picture)
           
static int avpicture_get_size(int pix_fmt, int width, int height)
           
static long get_filtered_video_frame(long input, int width, int height, int pixFmt, long buffer, long ffsink, long output)
           
static void memcpy(int[] dst, int dst_offset, int dst_length, long src)
           
static void memcpy(long dst, byte[] src, int src_offset, int src_length)
           
static void sws_freeContext(long context)
          Free an SwsContext.
static long sws_getCachedContext(long context, int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags)
          Get a SwsContext pointer.
static int sws_scale(long context, long src, int srcSliceY, int srcSliceH, Object dst, int dstFormat, int dstW, int dstH)
          Scale an image.
static int sws_scale(long context, Object src, int srcFormat, int srcW, int srcH, int srcSliceY, int srcSliceH, Object dst, int dstFormat, int dstW, int dstH)
          Scale image an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AV_NOPTS_VALUE

public static final long AV_NOPTS_VALUE
No pts value.

See Also:
Constant Field Values

AV_SAMPLE_FMT_S16

public static final int AV_SAMPLE_FMT_S16
The AV sample format for signed 16.

See Also:
Constant Field Values

CODEC_FLAG_LOOP_FILTER

public static final int CODEC_FLAG_LOOP_FILTER
Loop filter flag.

See Also:
Constant Field Values

CODEC_FLAG_H263P_UMV

public static final int CODEC_FLAG_H263P_UMV
H263+ UMV flag.

See Also:
Constant Field Values

CODEC_FLAG_AC_PRED

public static final int CODEC_FLAG_AC_PRED
AC pred flag.

See Also:
Constant Field Values

CODEC_FLAG_H263P_SLICE_STRUCT

public static final int CODEC_FLAG_H263P_SLICE_STRUCT
H263+ slice struct flag.

See Also:
Constant Field Values

CODEC_FLAG2_INTRA_REFRESH

public static final int CODEC_FLAG2_INTRA_REFRESH
Intra refresh flag2.

See Also:
Constant Field Values

CODEC_FLAG2_CHUNKS

public static final int CODEC_FLAG2_CHUNKS
Allow to pass incomplete frame to decoder.

See Also:
Constant Field Values

CODEC_ID_H264

public static final int CODEC_ID_H264
H264 codec ID.

See Also:
Constant Field Values

CODEC_ID_H263

public static final int CODEC_ID_H263
H263 codec ID.

See Also:
Constant Field Values

CODEC_ID_H263P

public static final int CODEC_ID_H263P
H263+ codec ID.

See Also:
Constant Field Values

CODEC_ID_MJPEG

public static final int CODEC_ID_MJPEG
MJPEG codec ID.

See Also:
Constant Field Values

CODEC_ID_MP3

public static final int CODEC_ID_MP3
MP3 codec ID.

See Also:
Constant Field Values

FF_BUG_AUTODETECT

public static final int FF_BUG_AUTODETECT
Work around bugs in encoders which sometimes cannot be detected automatically.

See Also:
Constant Field Values

FF_CMP_CHROMA

public static final int FF_CMP_CHROMA
See Also:
Constant Field Values

FF_INPUT_BUFFER_PADDING_SIZE

public static final int FF_INPUT_BUFFER_PADDING_SIZE
Padding size for FFmpeg input buffer.

See Also:
Constant Field Values

FF_MB_DECISION_SIMPLE

public static final int FF_MB_DECISION_SIMPLE
See Also:
Constant Field Values

FF_MIN_BUFFER_SIZE

public static final int FF_MIN_BUFFER_SIZE
The minimum encoding buffer size defined by libavcodec.

See Also:
Constant Field Values

FF_PROFILE_H264_BASELINE

public static final int FF_PROFILE_H264_BASELINE
The H264 baseline profile.

See Also:
Constant Field Values

FF_PROFILE_H264_MAIN

public static final int FF_PROFILE_H264_MAIN
The H264 main profile.

See Also:
Constant Field Values

PIX_FMT_ARGB

public static final int PIX_FMT_ARGB
ARGB format.

See Also:
Constant Field Values

PIX_FMT_BGR32

public static final int PIX_FMT_BGR32
BGR32 format handled in endian specific manner. It is stored as ABGR on big-endian and RGBA on little-endian.


PIX_FMT_BGR32_1

public static final int PIX_FMT_BGR32_1
BGR32_1 format handled in endian specific manner. It is stored as BGRA on big-endian and ARGB on little-endian.


PIX_FMT_NONE

public static final int PIX_FMT_NONE
"NONE" format.

See Also:
Constant Field Values

PIX_FMT_NV12

public static final int PIX_FMT_NV12
NV12 format.

See Also:
Constant Field Values

PIX_FMT_RGB24_1

public static final int PIX_FMT_RGB24_1
RGB24 format as of FFmpeg.

See Also:
Constant Field Values

PIX_FMT_BGR24_1

public static final int PIX_FMT_BGR24_1
BGR24 format as of FFmpeg.

See Also:
Constant Field Values

PIX_FMT_RGB24

public static final int PIX_FMT_RGB24
RGB24 format handled in endian specific manner. It is stored as RGB on big-endian and BGR on little-endian.


PIX_FMT_RGB32

public static final int PIX_FMT_RGB32
RGB32 format handled in endian specific manner. It is stored as ARGB on big-endian and BGRA on little-endian.


PIX_FMT_RGB32_1

public static final int PIX_FMT_RGB32_1
RGB32_1 format handled in endian specific manner. It is stored as RGBA on big-endian and ABGR on little-endian.


PIX_FMT_UYVY422

public static final int PIX_FMT_UYVY422
UYVY422 format.

See Also:
Constant Field Values

PIX_FMT_UYYVYY411

public static final int PIX_FMT_UYYVYY411
UYYVYY411 format.

See Also:
Constant Field Values

PIX_FMT_YUV420P

public static final int PIX_FMT_YUV420P
YUV420P format.

See Also:
Constant Field Values

PIX_FMT_YUYV422

public static final int PIX_FMT_YUYV422
YUYV422 format.

See Also:
Constant Field Values

PIX_FMT_YUVJ422P

public static final int PIX_FMT_YUVJ422P
YUVJ422P format.

See Also:
Constant Field Values

SWS_BICUBIC

public static final int SWS_BICUBIC
BICUBIC type for libswscale conversion.

See Also:
Constant Field Values
Constructor Detail

FFmpeg

public FFmpeg()
Method Detail

av_free

public static void av_free(long ptr)
Free a native pointer allocated by av_malloc.

Parameters:
ptr - native pointer to free

av_malloc

public static long av_malloc(int size)
Allocate memory.

Parameters:
size - size to allocate
Returns:
native pointer or 0 if av_malloc failed

av_register_all

public static void av_register_all()
Initialize libavformat and register all the muxers, demuxers and protocols.


avcodec_alloc_context

public static long avcodec_alloc_context()
Allocate a AVContext.

Returns:
native pointer to AVContext

avcodec_alloc_frame

public static long avcodec_alloc_frame()
Allocate a AVFrame.

Returns:
native pointer to AVFrame

avcodec_close

public static int avcodec_close(long avctx)
Close an AVCodecContext

Parameters:
avctx - pointer to AVCodecContex
Returns:
0 if success, -1 otherwise

avcodec_decode_video

public static int avcodec_decode_video(long avctx,
                                       long frame,
                                       boolean[] got_picture,
                                       byte[] buf,
                                       int buf_size)
Decode a video frame.

Parameters:
avctx - codec context
frame - frame decoded
got_picture - if the decoding has produced a valid picture
buf - the input buffer
buf_size - input buffer size
Returns:
number of bytes written to buff if success

avcodec_decode_video

public static int avcodec_decode_video(long avctx,
                                       long avframe,
                                       long src,
                                       int src_length)
Decode a video frame.

Parameters:
avctx - codec context
avframe - frame decoded
src - input buffer
src_length - input buffer size
Returns:
number of bytes written to buff if success

avcodec_encode_audio

public static int avcodec_encode_audio(long avctx,
                                       byte[] buf,
                                       int buf_offset,
                                       int buf_size,
                                       byte[] samples,
                                       int samples_offset)
Encodes an audio frame from samples into buf.

Parameters:
avctx - the codec context
buf - the output buffer
buf_offset - the output buffer offset
buf_size - the output buffer size
samples - the input buffer containing the samples. The number of samples read from this buffer is frame_size*channels, both of which are defined in avctx. For PCM audio the number of samples read from samples is equal to buf_size*input_sample_size/output_sample_size.
samples_offset - the offset in the input buffer containing the samples
Returns:
on error a negative value is returned, on success zero or the number of bytes used to encode the data read from the input buffer

avcodec_encode_video

public static int avcodec_encode_video(long avctx,
                                       byte[] buff,
                                       int buf_size,
                                       long frame)
Encode a video frame.

Parameters:
avctx - codec context
buff - the output buffer
buf_size - output buffer size
frame - frame to encode
Returns:
number of bytes written to buff if success

avcodec_find_decoder

public static long avcodec_find_decoder(int id)
Find a registered decoder with a matching ID.

Parameters:
id - CodecID of the requested encoder
Returns:
an AVCodec encoder if one was found; 0, otherwise

avcodec_find_encoder

public static long avcodec_find_encoder(int id)
Finds a registered encoder with a matching codec ID.

Parameters:
id - CodecID of the requested encoder
Returns:
an AVCodec encoder if one was found; 0, otherwise

avcodec_init

public static void avcodec_init()
Initializes FFmpeg's avcodec.


avcodec_open

public static int avcodec_open(long avctx,
                               long codec)
Initializes the specified AVCodecContext to use the specified AVCodec.

Parameters:
avctx - the AVCodecContext which will be set up to use the specified AVCodec
codec - the AVCodec to use within the AVCodecContext
Returns:
zero on success, a negative value on error

avcodeccontext_add_flags

public static void avcodeccontext_add_flags(long avctx,
                                            int flags)
Add specific flags to AVCodecContext's flags member.

Parameters:
avctx - pointer to AVCodecContext
flags - flags to add

avcodeccontext_add_flags2

public static void avcodeccontext_add_flags2(long avctx,
                                             int flags2)
Add specific flags to AVCodecContext's flags2 member.

Parameters:
avctx - pointer to AVCodecContext
flags2 - flags to add

avcodeccontext_add_partitions

public static void avcodeccontext_add_partitions(long avctx,
                                                 int partitions)
Add specified partitions to the avcodeccontext.

Parameters:
avctx - pointer to AVCodecContext
partitions - the partitions to add

avcodeccontext_get_frame_size

public static int avcodeccontext_get_frame_size(long avctx)
Gets the samples per packet of the specified AVCodecContext. The property is set by libavcodec upon avcodec_open(long, long).

Parameters:
avctx - the AVCodecContext to get the samples per packet of
Returns:
the samples per packet of the specified AVCodecContext

avcodeccontext_get_height

public static int avcodeccontext_get_height(long avctx)
Get height of the video.

Parameters:
avctx - pointer to AVCodecContext
Returns:
video height

avcodeccontext_get_pix_fmt

public static int avcodeccontext_get_pix_fmt(long avctx)
Get pixel format.

Parameters:
avctx - pointer to AVCodecContext
Returns:
pixel format

avcodeccontext_get_width

public static int avcodeccontext_get_width(long avctx)
Get width of the video.

Parameters:
avctx - pointer to AVCodecContext
Returns:
video width

avcodeccontext_set_b_frame_strategy

public static void avcodeccontext_set_b_frame_strategy(long avctx,
                                                       int b_frame_strategy)
Set the B-Frame strategy.

Parameters:
avctx - AVCodecContext pointer
b_frame_strategy - strategy

avcodeccontext_set_bit_rate

public static void avcodeccontext_set_bit_rate(long avctx,
                                               int bit_rate)
Sets the average bit rate of the specified AVCodecContext. The property is to be set by the user when encoding and is unused for constant quantizer encoding. It is set by libavcodec when decoding and its value is 0 or some bitrate if this info is available in the stream.

Parameters:
avctx - the AVCodecContext to set the average bit rate of
bit_rate - the average bit rate to be set to the specified AVCodecContext

avcodeccontext_set_bit_rate_tolerance

public static void avcodeccontext_set_bit_rate_tolerance(long avctx,
                                                         int bit_rate_tolerance)
Set the bit rate tolerance

Parameters:
avctx - the AVCodecContext to set the bit rate of
bit_rate_tolerance - bit rate tolerance

avcodeccontext_set_channels

public static void avcodeccontext_set_channels(long avctx,
                                               int channels)
Sets the number of channels of the specified AVCodecContext. The property is audio only.

Parameters:
avctx - the AVCodecContext to set the number of channels of
channels - the number of channels to set to the specified AVCodecContext

avcodeccontext_set_chromaoffset

public static void avcodeccontext_set_chromaoffset(long avctx,
                                                   int chromaoffset)

avcodeccontext_set_crf

public static void avcodeccontext_set_crf(long avctx,
                                          float crf)

avcodeccontext_set_deblockbeta

public static void avcodeccontext_set_deblockbeta(long avctx,
                                                  int deblockbeta)

avcodeccontext_set_gop_size

public static void avcodeccontext_set_gop_size(long avctx,
                                               int gop_size)
Set the gop size (key frame interval).

Parameters:
avctx - the AVCodecContext to set the gop size of
gop_size - key frame interval

avcodeccontext_set_i_quant_factor

public static void avcodeccontext_set_i_quant_factor(long avctx,
                                                     float i_quant_factor)

avcodeccontext_set_keyint_min

public static void avcodeccontext_set_keyint_min(long avctx,
                                                 int keyint_min)
Sets the minimum GOP size.

Parameters:
avctx - the AVCodecContext to set the minimum GOP size of
keyint_min - the minimum GOP size to set on avctx

avcodeccontext_set_max_b_frames

public static void avcodeccontext_set_max_b_frames(long avctx,
                                                   int max_b_frames)
Set the maximum B frames.

Parameters:
avctx - the AVCodecContext to set the maximum B frames of
max_b_frames - maximum B frames

avcodeccontext_set_mb_decision

public static void avcodeccontext_set_mb_decision(long avctx,
                                                  int mb_decision)

avcodeccontext_set_me_cmp

public static void avcodeccontext_set_me_cmp(long avctx,
                                             int me_cmp)

avcodeccontext_set_me_method

public static void avcodeccontext_set_me_method(long avctx,
                                                int me_method)

avcodeccontext_set_me_range

public static void avcodeccontext_set_me_range(long avctx,
                                               int me_range)

avcodeccontext_set_me_subpel_quality

public static void avcodeccontext_set_me_subpel_quality(long avctx,
                                                        int me_subpel_quality)

avcodeccontext_set_pix_fmt

public static void avcodeccontext_set_pix_fmt(long avctx,
                                              int pix_fmt)
Set the pixel format.

Parameters:
avctx - the AVCodecContext to set the pixel format of
pix_fmt - pixel format

avcodeccontext_set_profile

public static void avcodeccontext_set_profile(long avctx,
                                              int profile)

avcodeccontext_set_qcompress

public static void avcodeccontext_set_qcompress(long avctx,
                                                float qcompress)

avcodeccontext_set_quantizer

public static void avcodeccontext_set_quantizer(long avctx,
                                                int qmin,
                                                int qmax,
                                                int max_qdiff)

avcodeccontext_set_rc_buffer_size

public static void avcodeccontext_set_rc_buffer_size(long avctx,
                                                     int rc_buffer_size)

avcodeccontext_set_rc_eq

public static void avcodeccontext_set_rc_eq(long avctx,
                                            String rc_eq)

avcodeccontext_set_rc_max_rate

public static void avcodeccontext_set_rc_max_rate(long avctx,
                                                  int rc_max_rate)

avcodeccontext_set_refs

public static void avcodeccontext_set_refs(long avctx,
                                           int refs)

avcodeccontext_set_rtp_payload_size

public static void avcodeccontext_set_rtp_payload_size(long avctx,
                                                       int rtp_payload_size)
Set the RTP payload size.

Parameters:
avctx - the AVCodecContext to set the RTP payload size of
rtp_payload_size - RTP payload size

avcodeccontext_set_sample_aspect_ratio

public static void avcodeccontext_set_sample_aspect_ratio(long avctx,
                                                          int num,
                                                          int den)

avcodeccontext_set_sample_fmt

public static void avcodeccontext_set_sample_fmt(long avctx,
                                                 int sample_fmt)

avcodeccontext_set_sample_rate

public static void avcodeccontext_set_sample_rate(long avctx,
                                                  int sample_rate)
Sets the samples per second of the specified AVCodecContext. The property is audio only.

Parameters:
avctx - the AVCodecContext to set the samples per second of
sample_rate - the samples per second to set to the specified AVCodecContext

avcodeccontext_set_scenechange_threshold

public static void avcodeccontext_set_scenechange_threshold(long avctx,
                                                            int scenechange_threshold)
Set the scene change threshold (in percent).

Parameters:
avctx - AVCodecContext pointer
scenechange_threshold - value between 0 and 100

avcodeccontext_set_size

public static void avcodeccontext_set_size(long avctx,
                                           int width,
                                           int height)
Set the size of the video.

Parameters:
avctx - pointer to AVCodecContext
width - video width
height - video height

avcodeccontext_set_thread_count

public static void avcodeccontext_set_thread_count(long avctx,
                                                   int thread_count)
Set the number of thread.

Parameters:
avctx - the AVCodecContext to set the number of thread of
thread_count - number of thread to set

avcodeccontext_set_ticks_per_frame

public static void avcodeccontext_set_ticks_per_frame(long avctx,
                                                      int ticks_per_frame)

avcodeccontext_set_time_base

public static void avcodeccontext_set_time_base(long avctx,
                                                int num,
                                                int den)

avcodeccontext_set_trellis

public static void avcodeccontext_set_trellis(long avctx,
                                              int trellis)

avcodeccontext_set_workaround_bugs

public static void avcodeccontext_set_workaround_bugs(long avctx,
                                                      int workaround_bugs)

avframe_get_pts

public static long avframe_get_pts(long frame)

avframe_set_data

public static void avframe_set_data(long frame,
                                    long data0,
                                    long offset1,
                                    long offset2)

avframe_set_key_frame

public static void avframe_set_key_frame(long frame,
                                         boolean key_frame)

avframe_set_linesize

public static void avframe_set_linesize(long frame,
                                        int linesize0,
                                        int linesize1,
                                        int linesize2)

avpicture_fill

public static int avpicture_fill(long picture,
                                 long ptr,
                                 int pix_fmt,
                                 int width,
                                 int height)

avpicture_get_data0

public static long avpicture_get_data0(long picture)

avpicture_get_size

public static int avpicture_get_size(int pix_fmt,
                                     int width,
                                     int height)

memcpy

public static void memcpy(int[] dst,
                          int dst_offset,
                          int dst_length,
                          long src)

memcpy

public static void memcpy(long dst,
                          byte[] src,
                          int src_offset,
                          int src_length)

sws_freeContext

public static void sws_freeContext(long context)
Free an SwsContext.

Parameters:
context - SwsContext native pointer

sws_getCachedContext

public static long sws_getCachedContext(long context,
                                        int srcW,
                                        int srcH,
                                        int srcFormat,
                                        int dstW,
                                        int dstH,
                                        int dstFormat,
                                        int flags)
Get a SwsContext pointer.

Parameters:
context - SwsContext
srcW - width of source image
srcH - height of source image
srcFormat - image format
dstW - width of destination image
dstH - height destination image
dstFormat - destination format
flags - flags
Returns:
cached SwsContext pointer

sws_scale

public static int sws_scale(long context,
                            long src,
                            int srcSliceY,
                            int srcSliceH,
                            Object dst,
                            int dstFormat,
                            int dstW,
                            int dstH)
Scale an image.

Parameters:
context - SwsContext native pointer
src - source image (native pointer)
srcSliceY - slice Y of source image
srcSliceH - slice H of source image
dst - destination image (java type)
dstFormat - destination format
dstW - width of destination image
dstH - height destination image
Returns:
0 if success, -1 otherwise

sws_scale

public static int sws_scale(long context,
                            Object src,
                            int srcFormat,
                            int srcW,
                            int srcH,
                            int srcSliceY,
                            int srcSliceH,
                            Object dst,
                            int dstFormat,
                            int dstW,
                            int dstH)
Scale image an image.

Parameters:
context - SwsContext native pointer
src - source image (java type)
srcFormat - image format
srcW - width of source image
srcH - height of source image
srcSliceY - slice Y of source image
srcSliceH - slice H of source image
dst - destination image (java type)
dstFormat - destination format
dstW - width of destination image
dstH - height destination image
Returns:
0 if success, -1 otherwise

avfilter_graph_alloc

public static long avfilter_graph_alloc()
Allocates a new AVFilterGraph instance.

Returns:
a pointer to the newly-allocated AVFilterGraph instance

avfilter_graph_config

public static int avfilter_graph_config(long graph,
                                        long log_ctx)
Checks the validity and configures all the links and formats in a specific AVFilterGraph instance.

Parameters:
graph - a pointer to the AVFilterGraph instance to check the validity of and configure
log_ctx - the AVClass context to be used for logging
Returns:
0 on success; a negative AVERROR on error

avfilter_graph_free

public static void avfilter_graph_free(long graph)
Frees a specific AVFilterGraph instance and destroys its links.

Parameters:
graph - a pointer to the AVFilterGraph instance to free

avfilter_graph_get_filter

public static long avfilter_graph_get_filter(long graph,
                                             String name)
Gets a pointer to an AVFilterContext instance with a specific name in a specific AVFilterGraph instance.

Parameters:
graph - a pointer to the AVFilterGraph instance where the AVFilterContext instance with the specified name is to be found
name - the name of the AVFilterContext instance which is to be found in the specified graph
Returns:
the filter graph pointer

avfilter_graph_parse

public static int avfilter_graph_parse(long graph,
                                       String filters,
                                       long inputs,
                                       long outputs,
                                       long log_ctx)
Adds a filter graph described by a String to a specific AVFilterGraph instance.

Parameters:
graph - a pointer to the AVFilterGraph instance where to link the parsed graph context
filters - the String to be parsed
inputs - a pointer to a linked list to the inputs of the graph if any; otherwise, 0
outputs - a pointer to a linked list to the outputs of the graph if any; otherwise, 0
log_ctx - the AVClass context to be used for logging
Returns:
0 on success; a negative AVERROR on error

avfilter_register_all

public static void avfilter_register_all()
Initializes the libavfilter system and registers all built-in filters.


avfilter_unref_buffer

public static void avfilter_unref_buffer(long ref)
Removes a reference to a buffer. If the specified AVFilterBufferRef is the last reference to the buffer, the buffer is also automatically freed.

Parameters:
ref - a pointer to the AVFilterBufferRef instance to remove

get_filtered_video_frame

public static long get_filtered_video_frame(long input,
                                            int width,
                                            int height,
                                            int pixFmt,
                                            long buffer,
                                            long ffsink,
                                            long output)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.