Class MediaJNI
java.lang.Object
javaforce.jni.MediaJNI
- All Implemented Interfaces:
MediaAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddAudioStream(long ctx, MediaIO io, int codec_id, int bit_rate, int chs, int freq) intaddVideoStream(long ctx, MediaIO io, int codec_id, int bit_rate, int width, int height, float fps, int keyFrameInterval) booleanaudioDecoderChange(long ctx, int chs, int freq) short[]audioDecoderDecode(long ctx, byte[] data, int offset, int length) intaudioDecoderGetChannels(long ctx) intaudioDecoderGetSampleRate(long ctx) longaudioDecoderStart(int codec_id, int new_chs, int new_freq) voidaudioDecoderStop(long ctx) byte[]audioEncoderEncode(long ctx, short[] samples, int offset, int length) intaudioEncoderGetAudioFramesize(long ctx) longaudioEncoderStart(int codec_id, int bit_rate, int chs, int freq) voidaudioEncoderStop(long ctx) floatcompareFrames(int[] frame1, int[] frame2, int width, int height) intgetAudioBitRate(long ctx) intgetAudioChannels(long ctx) intgetAudioCodecID(long ctx) intgetAudioSampleRate(long ctx) intgetAudioStream(long ctx) longgetDuration(long ctx) static MediaAPIintgetPacketData(long ctx, byte[] data, int offset, int length) booleangetPacketKeyFrame(long ctx) intgetVideoBitRate(long ctx) intgetVideoCodecID(long ctx) floatgetVideoFrameRate(long ctx) intgetVideoHeight(long ctx) intgetVideoKeyFrameInterval(long ctx) intgetVideoStream(long ctx) intgetVideoWidth(long ctx) booleaninputClose(long ctx, MediaIO io) booleaninputOpenAudio(long ctx, MediaIO io, int chs, int freq) longinputOpenFile(String file, String format) longinputOpenIO(MediaIO io) booleaninputOpenVideo(long ctx, MediaIO io, int width, int height) intbooleanbooleanmediaLoadLibs(String codec, String device, String filter, String format, String util, String scale, String postproc, String resample) voidmediaSetLogging(boolean state) booleanoutputClose(long ctx, MediaIO io) longoutputCreateFile(String file, String format) longoutputCreateIO(MediaIO io, String format) booleanvideoDecoderChange(long ctx, int width, int height) int[]videoDecoderDecode(long ctx, byte[] data, int offset, int length) floatvideoDecoderGetFrameRate(long ctx) intvideoDecoderGetHeight(long ctx) intvideoDecoderGetWidth(long ctx) longvideoDecoderStart(int codec_id, int new_width, int new_height) voidvideoDecoderStop(long ctx) byte[]videoEncoderEncode(long ctx, int[] px, int offset, int length) longvideoEncoderStart(int codec_id, int bit_rate, int width, int height, float fps, int keyFrameInterval) voidvideoEncoderStop(long ctx) booleanwriteHeader(long ctx, MediaIO io) booleanwritePacket(long ctx, MediaIO io, int stream, byte[] data, int offset, int length, boolean keyFrame)
-
Constructor Details
-
MediaJNI
public MediaJNI()
-
-
Method Details
-
getInstance
-
mediaLoadLibs
-
mediaSetLogging
public void mediaSetLogging(boolean state) - Specified by:
mediaSetLoggingin interfaceMediaAPI
-
getVideoStream
public int getVideoStream(long ctx) - Specified by:
getVideoStreamin interfaceMediaAPI
-
getAudioStream
public int getAudioStream(long ctx) - Specified by:
getAudioStreamin interfaceMediaAPI
-
getVideoCodecID
public int getVideoCodecID(long ctx) - Specified by:
getVideoCodecIDin interfaceMediaAPI
-
getAudioCodecID
public int getAudioCodecID(long ctx) - Specified by:
getAudioCodecIDin interfaceMediaAPI
-
getVideoBitRate
public int getVideoBitRate(long ctx) - Specified by:
getVideoBitRatein interfaceMediaAPI
-
getAudioBitRate
public int getAudioBitRate(long ctx) - Specified by:
getAudioBitRatein interfaceMediaAPI
-
inputOpenFile
- Specified by:
inputOpenFilein interfaceMediaAPI
-
inputOpenIO
- Specified by:
inputOpenIOin interfaceMediaAPI
-
getDuration
public long getDuration(long ctx) - Specified by:
getDurationin interfaceMediaAPI
-
getVideoWidth
public int getVideoWidth(long ctx) - Specified by:
getVideoWidthin interfaceMediaAPI
-
getVideoHeight
public int getVideoHeight(long ctx) - Specified by:
getVideoHeightin interfaceMediaAPI
-
getVideoFrameRate
public float getVideoFrameRate(long ctx) - Specified by:
getVideoFrameRatein interfaceMediaAPI
-
getVideoKeyFrameInterval
public int getVideoKeyFrameInterval(long ctx) - Specified by:
getVideoKeyFrameIntervalin interfaceMediaAPI
-
getAudioChannels
public int getAudioChannels(long ctx) - Specified by:
getAudioChannelsin interfaceMediaAPI
-
getAudioSampleRate
public int getAudioSampleRate(long ctx) - Specified by:
getAudioSampleRatein interfaceMediaAPI
-
inputClose
- Specified by:
inputClosein interfaceMediaAPI
-
inputOpenVideo
- Specified by:
inputOpenVideoin interfaceMediaAPI
-
inputOpenAudio
- Specified by:
inputOpenAudioin interfaceMediaAPI
-
inputRead
-
getPacketKeyFrame
public boolean getPacketKeyFrame(long ctx) - Specified by:
getPacketKeyFramein interfaceMediaAPI
-
getPacketData
public int getPacketData(long ctx, byte[] data, int offset, int length) - Specified by:
getPacketDatain interfaceMediaAPI
-
inputSeek
-
outputCreateFile
- Specified by:
outputCreateFilein interfaceMediaAPI
-
outputCreateIO
- Specified by:
outputCreateIOin interfaceMediaAPI
-
addVideoStream
public int addVideoStream(long ctx, MediaIO io, int codec_id, int bit_rate, int width, int height, float fps, int keyFrameInterval) - Specified by:
addVideoStreamin interfaceMediaAPI
-
addAudioStream
- Specified by:
addAudioStreamin interfaceMediaAPI
-
outputClose
- Specified by:
outputClosein interfaceMediaAPI
-
writeHeader
- Specified by:
writeHeaderin interfaceMediaAPI
-
writePacket
public boolean writePacket(long ctx, MediaIO io, int stream, byte[] data, int offset, int length, boolean keyFrame) - Specified by:
writePacketin interfaceMediaAPI
-
audioDecoderStart
public long audioDecoderStart(int codec_id, int new_chs, int new_freq) - Specified by:
audioDecoderStartin interfaceMediaAPI
-
audioDecoderStop
public void audioDecoderStop(long ctx) - Specified by:
audioDecoderStopin interfaceMediaAPI
-
audioDecoderDecode
public short[] audioDecoderDecode(long ctx, byte[] data, int offset, int length) - Specified by:
audioDecoderDecodein interfaceMediaAPI
-
audioDecoderGetChannels
public int audioDecoderGetChannels(long ctx) - Specified by:
audioDecoderGetChannelsin interfaceMediaAPI
-
audioDecoderGetSampleRate
public int audioDecoderGetSampleRate(long ctx) - Specified by:
audioDecoderGetSampleRatein interfaceMediaAPI
-
audioDecoderChange
public boolean audioDecoderChange(long ctx, int chs, int freq) - Specified by:
audioDecoderChangein interfaceMediaAPI
-
audioEncoderStart
public long audioEncoderStart(int codec_id, int bit_rate, int chs, int freq) - Specified by:
audioEncoderStartin interfaceMediaAPI
-
audioEncoderStop
public void audioEncoderStop(long ctx) - Specified by:
audioEncoderStopin interfaceMediaAPI
-
audioEncoderEncode
public byte[] audioEncoderEncode(long ctx, short[] samples, int offset, int length) - Specified by:
audioEncoderEncodein interfaceMediaAPI
-
audioEncoderGetAudioFramesize
public int audioEncoderGetAudioFramesize(long ctx) - Specified by:
audioEncoderGetAudioFramesizein interfaceMediaAPI
-
videoDecoderStart
public long videoDecoderStart(int codec_id, int new_width, int new_height) - Specified by:
videoDecoderStartin interfaceMediaAPI
-
videoDecoderStop
public void videoDecoderStop(long ctx) - Specified by:
videoDecoderStopin interfaceMediaAPI
-
videoDecoderDecode
public int[] videoDecoderDecode(long ctx, byte[] data, int offset, int length) - Specified by:
videoDecoderDecodein interfaceMediaAPI
-
videoDecoderGetWidth
public int videoDecoderGetWidth(long ctx) - Specified by:
videoDecoderGetWidthin interfaceMediaAPI
-
videoDecoderGetHeight
public int videoDecoderGetHeight(long ctx) - Specified by:
videoDecoderGetHeightin interfaceMediaAPI
-
videoDecoderGetFrameRate
public float videoDecoderGetFrameRate(long ctx) - Specified by:
videoDecoderGetFrameRatein interfaceMediaAPI
-
videoDecoderChange
public boolean videoDecoderChange(long ctx, int width, int height) - Specified by:
videoDecoderChangein interfaceMediaAPI
-
videoEncoderStart
public long videoEncoderStart(int codec_id, int bit_rate, int width, int height, float fps, int keyFrameInterval) - Specified by:
videoEncoderStartin interfaceMediaAPI
-
videoEncoderStop
public void videoEncoderStop(long ctx) - Specified by:
videoEncoderStopin interfaceMediaAPI
-
videoEncoderEncode
public byte[] videoEncoderEncode(long ctx, int[] px, int offset, int length) - Specified by:
videoEncoderEncodein interfaceMediaAPI
-
compareFrames
public float compareFrames(int[] frame1, int[] frame2, int width, int height) - Specified by:
compareFramesin interfaceMediaAPI
-