47 #include <libavformat/avformat.h> 48 #include <libavcodec/avcodec.h> 49 #include <libswresample/swresample.h> 50 #include <libavutil/timestamp.h> 51 #include <libavutil/opt.h> 103 int ff_open_file(JNIEnv*, AVFormatContext**, AVStream**, AVCodecContext**,
int*,
const char*);
int stream_index
Index of the audio stream we are using.
void throwUnsupportedAudioFileExceptionIfError(JNIEnv *, int, const char *)
Throws an UnsupportedAudioFileException.
AVFormatContext * format_context
Current AVFormatContext.
int ff_init_encoder(JNIEnv *, FFAudioIO *, AVCodec *)
Allocates and initializes the encoder context and frame in FFAudioIO.
void throwIOExceptionIfError(JNIEnv *, int, const char *)
Throws an IOException.
AVStream * stream
Audio stream we are interested in.
uint8_t ** audio_data
Audio data (accommodates multiple planes)
uint64_t decoded_samples
Running count of decoded samples.
int ff_init_audioio(JNIEnv *, FFAudioIO *)
Initialize our main context FFAudioIO, so that SwrContext, decode buffers and the encoder are set to ...
jint java_buffer_capacity
Current capacity of the Java nativeBuffer.
void ff_audioio_free(FFAudioIO *)
Free all resources held by aio and then itself.
void logFine(FFAudioIO *, int, const char *)
Log a debug message.
void throwFileNotFoundExceptionIfError(JNIEnv *, int, const char *)
Throws an IllegalArgumentException.
int ff_big_endian(enum AVCodecID)
Indicates whether the given id belongs to a big endian codec.
int got_frame
Indicates whether we got a frame in the last call to avcodec_decode_audio4.
int ff_fill_buffer(FFAudioIO *)
Reads a frame via av_read_frame(AVFormatContext, AVPacket), decodes it to a AVPacket, and writes the result to the Java-side nativeBuffer.
AVCodec * ff_find_encoder(enum AVSampleFormat, int, int, int)
Finds an AVCodec encoder for the given sample format, bits per sample, byte order and signed/unsigned...
AVFrame * encode_frame
AVFrame for encoding.
SwrContext * swr_context
Resampling context.
void logWarning(FFAudioIO *, int, const char *)
Log a warning.
AVPacket decode_packet
AVPacket for decoding.
uint64_t resampled_samples
Count of resampled samples.
JNIEnv * env
JNI environment.
AVPacket encode_packet
AVPacket for encoding.
int ff_open_format_context(JNIEnv *, AVFormatContext **, const char *)
Opens the input file/url and allocates a AVFormatContext for it, but does not open the audio stream w...
AVCodecContext * decode_context
Codec context for decoding.
int ff_open_file(JNIEnv *, AVFormatContext **, AVStream **, AVCodecContext **, int *, const char *)
Opens the input file/url, allocates a AVFormatContext for it and opens the audio stream with an appro...
AVCodecContext * encode_context
Codec context for encoding.
Central context representing the native peer to the Java FFNativePeerInputStream object.
AVFrame * decode_frame
AVFrame for decoding.
int ff_open_stream(JNIEnv *, AVStream *, AVCodecContext **)
Opens the given stream, i.e.
uint64_t timestamp
Current timestamp (in samples, not seconds)
void throwIndexOutOfBoundsExceptionIfError(JNIEnv *, int, int)
Throws an IndexOutOfBoundsException.
jobject java_instance
Calling Java instance.