signature:
public class HumbleIO { /** * { @ inheritDoc } */
public IURLProtocolHandler getHandler ( String protocol , String url , int flags ) { } }

implementation:
// Note : We need to remove any protocol markers from the url
String streamName = URLProtocolManager . getResourceFromURL ( url ) ; RegistrationInformation tuple = mURLs . get ( streamName ) ; if ( tuple != null ) { IURLProtocolHandler handler = tuple . getHandler ( ) ; if ( tuple . isUnmappingOnOpen ( ) ) { IURLProtocolHandler oldHandler = unmapIO ( tuple . getName ( ) ) ; // the unmapIO is an atomic operation
if ( handler != null && ! handler . equals ( oldHandler ) ) { // someone already unmapped this stream
log . error ( "stream {} already unmapped; it was likely already opened" , tuple . getName ( ) ) ; return null ; } } return handler ; } return null ;


signature:
public class Logger { /** * Returns a new Logger object for this loggerName . < br >
 * < br >
 * @ param aLoggerName A name ( no spaces allowed ) for this logger . < br >
 * < br >
 * @ return a New logger for logging ; caller must delete when done . */
public static Logger getLogger ( String aLoggerName ) { } }

implementation: long cPtr = FerryJNI . Logger_getLogger ( aLoggerName ) ; return ( cPtr == 0 ) ? null : new Logger ( cPtr , false ) ;


signature:
public class Logger { /** * Get a Logger object , but ask the Logger code to < br >
 * free it up once the JavaVM shuts down . Use at your < br >
 * own risk . < br >
 * < br >
 * @ param aLoggerName A name ( no spaces allowed ) for this logger . < br >
 * < br >
 * @ return A new logger for logging ; caller must not call delete < br >
 * and must not use the logger once the JavaVM ( or main ) has exited . */
public static Logger getStaticLogger ( String aLoggerName ) { } }

implementation: long cPtr = FerryJNI . Logger_getStaticLogger ( aLoggerName ) ; return ( cPtr == 0 ) ? null : new Logger ( cPtr , false ) ;


signature:
public class Logger { /** * Log the message to the logger , using sprintf ( ) format < br >
 * strings . < br >
 * < br >
 * @ param filename The filename that is logging , or NULL . < br >
 * @ param lineNo The line number where this log statement is executed from . < br >
 * or 0 . < br >
 * @ param level Level to log at . < br >
 * @ param format A format specification string , in sprintf format . < br >
 * @ return if the message was actually logged . */
public boolean log ( String filename , int lineNo , Logger . Level level , String format ) { } }

implementation: return FerryJNI . Logger_log ( swigCPtr , this , filename , lineNo , level . swigValue ( ) , format ) ;


signature:
public class MediaAudioResampler { /** * Create a new MediaAudioResampler . */
public static MediaAudioResampler make ( AudioChannel . Layout outLayout , int outSampleRate , AudioFormat . Type outFormat , AudioChannel . Layout inLayout , int inSampleRate , AudioFormat . Type inFormat ) { } }

implementation: long cPtr = VideoJNI . MediaAudioResampler_make ( outLayout . swigValue ( ) , outSampleRate , outFormat . swigValue ( ) , inLayout . swigValue ( ) , inSampleRate , inFormat . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new MediaAudioResampler ( cPtr , false ) ;


signature:
public class MediaAudioResampler { /** * Convert audio . < br >
 * < br >
 * in can be set to null to flush the last few samples out at the < br >
 * end . < br >
 * < br >
 * If more input is provided than output space then the input will be buffered . < br >
 * You can avoid this buffering by providing more output space than input . < br >
 * Conversion will run directly without copying whenever possible . < br >
 * < br >
 * @ param out output audio object . caller is responsible for making the correct size . < br >
 * @ param in input audio . < br >
 * < br >
 * @ return number of samples output per channel . < br >
 * @ throws RuntimeError if we get an error or InvalidArgument if the attributes of < br >
 * in or out do not match what this resampler expected . */
public int resample ( MediaSampled out , MediaSampled in ) { } }

implementation: return VideoJNI . MediaAudioResampler_resample ( swigCPtr , this , MediaSampled . getCPtr ( out ) , out , MediaSampled . getCPtr ( in ) , in ) ;


signature:
public class MediaAudioResampler { /** * Get the timebase used when outputting time stamps for audio . < br >
 * < br >
 * Defaults to 1 / ( the lowest common multiple of getInputSampleRate ( ) < br >
 * and getOutputSampleRate ( ) ) in order to ensure that no rounding < br >
 * of time stamps occur . < br >
 * < br >
 * For example , if the input sample rate is 22050 and the output sample < br >
 * rate is 44100 , then the output time base will be ( 1/44100 ) . But if the < br >
 * input sample rate is 48000 and the output sample rate is 22050 , then < br >
 * the output time base will be ( 1 / lcm ( 48000,22050 ) ) which will be 1/7056000 < br >
 * ( trust me ) . This is done so that timestamp values do not get rounded ( and < br >
 * therefore introduce drift ) . */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . MediaAudioResampler_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class MediaAudioResampler { /** * Set the timebase to use for timestamps on output audio . < br >
 * < br >
 * @ throws InvalidArgument if null . */
public void setTimeBase ( Rational rational ) { } }

implementation: VideoJNI . MediaAudioResampler_setTimeBase ( swigCPtr , this , Rational . getCPtr ( rational ) , rational ) ;


signature:
public class ContainerStream { /** * Get an ordered sequence of index entries in this { @ link Stream } .
 * @ return A list of entries . Will always return a non - null
 * list , but if there are no entries the list size will be zero . */
public java . util . List < IndexEntry > getIndexEntries ( ) { } }

implementation: final int numEntries = getNumIndexEntries ( ) ; java . util . List < IndexEntry > retval = new java . util . ArrayList < IndexEntry > ( Math . max ( numEntries , 10 ) ) ; for ( int i = 0 ; i < numEntries ; i ++ ) { final IndexEntry entry = getIndexEntry ( i ) ; if ( entry != null ) { retval . add ( entry ) ; } } return retval ;


signature:
public class ContainerStream { /** * Get the ( sometimes estimated ) average frame rate of this container . < br >
 * For variable frame - rate containers ( they do exist ) this is just < br >
 * an approximation . Better to use getTimeBase ( ) . < br >
 * < br >
 * For contant frame - rate containers , this will be 1 / ( getTimeBase ( ) ) < br >
 * < br >
 * @ return The frame - rate of this container . */
public Rational getFrameRate ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getFrameRate ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class ContainerStream { /** * The time base in which all timestamps ( e . g . Presentation Time Stamp ( PTS ) < br >
 * and Decompression Time Stamp ( DTS ) ) are represented . For example < br >
 * if the time base is 1/1000 , then the difference between a PTS of 1 and < br >
 * a PTS of 2 is 1 millisecond . If the timebase is 1/1 , then the difference < br >
 * between a PTS of 1 and a PTS of 2 is 1 second . < br >
 * < br >
 * @ return The time base of this stream . */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class ContainerStream { /** * Gets the sample aspect ratio . < br >
 * < br >
 * @ return The sample aspect ratio . */
public Rational getSampleAspectRatio ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getSampleAspectRatio ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class ContainerStream { /** * Get the underlying container for this stream , or null if Humble Video < br >
 * doesn ' t know . < br >
 * < br >
 * @ return the container , or null if we don ' t know . */
public Container getContainer ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getContainer ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Container ( cPtr , false ) ;


signature:
public class ContainerStream { /** * Get the KeyValueBag for this object , < br >
 * or null if none . < br >
 * < p > < br >
 * If the Container or Stream object < br >
 * that this KeyValueBag came from was opened < br >
 * for reading , then changes via KeyValueBag # setValue ( String , String ) < br >
 * will have no effect on the underlying media . < br >
 * < / p > < br >
 * < p > < br >
 * If the Container or Stream object < br >
 * that this KeyValueBag came from was opened < br >
 * for writing , then changes via KeyValueBag # setValue ( String , String ) < br >
 * will have no effect after Container # writeHeader ( ) < br >
 * is called . < br >
 * < / p > < br >
 * @ return the KeyValueBag . */
public KeyValueBag getMetaData ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getMetaData ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new KeyValueBag ( cPtr , false ) ;


signature:
public class ContainerStream { /** * Search for the given time stamp in the key - frame index for this Stream . < br >
 * < p > < br >
 * Not all ContainerFormat implementations < br >
 * maintain key frame indexes , but if they have one , < br >
 * then this method searches in the Stream index < br >
 * to quickly find the byte - offset of the nearest key - frame to < br >
 * the given time stamp . < br >
 * < / p > < br >
 * @ param wantedTimeStamp the time stamp wanted , in the stream ' s < br >
 * time base units . < br >
 * @ param flags A bitmask of the < code > SEEK _ FLAG _ * < / code > flags , or 0 to turn < br >
 * all flags off . If Container # SEEK _ FLAG _ BACKWARDS then the returned < br >
 * index will correspond to the time stamp which is & lt ; = < br >
 * the requested one ( not supported by all demuxers ) . < br >
 * If Container # SEEK _ FLAG _ BACKWARDS is not set then it will be & gt ; = . < br >
 * if Container # SEEK _ FLAG _ ANY seek to any frame , only < br >
 * keyframes otherwise ( not supported by all demuxers ) . < br >
 * @ return The IndexEntry for the nearest appropriate timestamp < br >
 * in the index , or null if it can ' t be found . */
public IndexEntry findTimeStampEntryInIndex ( long wantedTimeStamp , int flags ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_findTimeStampEntryInIndex ( swigCPtr , this , wantedTimeStamp , flags ) ; return ( cPtr == 0 ) ? null : new IndexEntry ( cPtr , false ) ;


signature:
public class ContainerStream { /** * Get the IndexEntry at the given position in this < br >
 * Stream object ' s index . < br >
 * < p > < br >
 * Not all ContainerFormat types maintain < br >
 * Stream indexes , but if they do , < br >
 * this method can return those entries . < br >
 * < / p > < br >
 * < p > < br >
 * Do not modify the Container this stream < br >
 * is from between calls to this method and < br >
 * # getNumIndexEntries ( ) as indexes may < br >
 * be compacted while processing . < br >
 * < / p > < br >
 * @ param position The position in the index table . */
public IndexEntry getIndexEntry ( int position ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getIndexEntry ( swigCPtr , this , position ) ; return ( cPtr == 0 ) ? null : new IndexEntry ( cPtr , false ) ;


signature:
public class ContainerStream { /** * For containers with Stream . Disposition . DISPOSITION _ ATTACHED _ PIC , < br >
 * this returns a read - only copy of the packet containing the < br >
 * picture ( needs to be decoded separately ) . */
public MediaPacket getAttachedPic ( ) { } }

implementation: long cPtr = VideoJNI . ContainerStream_getAttachedPic ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new MediaPacket ( cPtr , false ) ;


signature:
public class Codec { /** * Gets a collection of ALL codecs installed on this
 * system .
 * @ return A collection of all installed codecs . */
public static java . util . Collection < Codec > getInstalledCodecs ( ) { } }

implementation: java . util . Collection < Codec > retval = new java . util . HashSet < Codec > ( ) ; int count = getNumInstalledCodecs ( ) ; for ( int i = 0 ; i < count ; i ++ ) { Codec codec = getInstalledCodec ( i ) ; if ( codec != null ) retval . add ( codec ) ; } return retval ;


signature:
public class Codec { /** * Returns a list of supported frame - rates this codec can encode
 * video to .
 * Not all codecs support reporting this , in which case the returned list
 * will be empty .
 * @ return a list */
public java . util . Collection < Rational > getSupportedVideoFrameRates ( ) { } }

implementation: java . util . List < Rational > retval = new java . util . LinkedList < Rational > ( ) ; int count = getNumSupportedVideoFrameRates ( ) ; for ( int i = 0 ; i < count ; i ++ ) { Rational rate = getSupportedVideoFrameRate ( i ) ; if ( rate != null ) retval . add ( rate ) ; } return retval ;


signature:
public class Codec { /** * Returns a list of supported pixel formats this codec can encode
 * video in .
 * Not all codecs support reporting this , in which case the returned list
 * will be empty .
 * @ return a list */
public java . util . Collection < PixelFormat . Type > getSupportedVideoPixelFormats ( ) { } }

implementation: java . util . List < PixelFormat . Type > retval = new java . util . LinkedList < PixelFormat . Type > ( ) ; int count = getNumSupportedVideoPixelFormats ( ) ; for ( int i = 0 ; i < count ; i ++ ) { PixelFormat . Type type = getSupportedVideoPixelFormat ( i ) ; if ( type != null && type != PixelFormat . Type . PIX_FMT_NONE ) retval . add ( type ) ; } return retval ;


signature:
public class Codec { /** * Returns a list of supported audio sample rates this codec can encode
 * audio in .
 * Not all codecs support reporting this , in which case the returned list
 * will be empty .
 * @ return a list */
public java . util . Collection < Integer > getSupportedAudioSampleRates ( ) { } }

implementation: java . util . List < Integer > retval = new java . util . LinkedList < Integer > ( ) ; int count = getNumSupportedAudioSampleRates ( ) ; for ( int i = 0 ; i < count ; i ++ ) { int rate = getSupportedAudioSampleRate ( i ) ; if ( rate != 0 ) retval . add ( rate ) ; } return retval ;


signature:
public class Codec { /** * Returns a list of supported audio sample formats this codec can encode
 * audio in .
 * Not all codecs support reporting this , in which case the returned list
 * will be empty .
 * @ return a list */
public java . util . Collection < AudioFormat . Type > getSupportedAudioFormats ( ) { } }

implementation: java . util . List < AudioFormat . Type > retval = new java . util . LinkedList < AudioFormat . Type > ( ) ; int count = getNumSupportedAudioFormats ( ) ; for ( int i = 0 ; i < count ; i ++ ) { AudioFormat . Type fmt = getSupportedAudioFormat ( i ) ; if ( fmt != null && fmt != AudioFormat . Type . SAMPLE_FMT_NONE ) retval . add ( fmt ) ; } return retval ;


signature:
public class Codec { /** * Returns a list of supported audio channel layouts this codec can encode
 * audio in .
 * Not all codecs support reporting this , in which case the returned list
 * will be empty .
 * @ return a list */
public java . util . Collection < AudioChannel . Layout > getSupportedAudioChannelLayouts ( ) { } }

implementation: java . util . List < AudioChannel . Layout > retval = new java . util . LinkedList < AudioChannel . Layout > ( ) ; int count = getNumSupportedAudioChannelLayouts ( ) ; for ( int i = 0 ; i < count ; i ++ ) { AudioChannel . Layout layout = getSupportedAudioChannelLayout ( i ) ; if ( layout != AudioChannel . Layout . CH_LAYOUT_UNKNOWN ) retval . add ( layout ) ; } return retval ;


signature:
public class Codec { /** * Find a codec that can be used for encoding . < br >
 * @ param id The id of the codec < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findEncodingCodec ( Codec . ID id ) { } }

implementation: long cPtr = VideoJNI . Codec_findEncodingCodec ( id . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Find a codec that can be used for encoding . < br >
 * @ param id The id of the codec , as an integer . < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findEncodingCodecByIntID ( int id ) { } }

implementation: long cPtr = VideoJNI . Codec_findEncodingCodecByIntID ( id ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Find a codec that can be used for encoding . < br >
 * @ param id The id of the codec , as a FFMPEG short - name string < br >
 * ( for example , " mpeg4 " ) . < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findEncodingCodecByName ( String id ) { } }

implementation: long cPtr = VideoJNI . Codec_findEncodingCodecByName ( id ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Find a codec that can be used for decoding . < br >
 * @ param id The id of the codec < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findDecodingCodec ( Codec . ID id ) { } }

implementation: long cPtr = VideoJNI . Codec_findDecodingCodec ( id . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Find a codec that can be used for decoding . < br >
 * @ param id The id of the codec , as an integer < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findDecodingCodecByIntID ( int id ) { } }

implementation: long cPtr = VideoJNI . Codec_findDecodingCodecByIntID ( id ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Find a codec that can be used for decoding . < br >
 * @ param id The id of the codec , as a FFMPEG short - name string < br >
 * ( for example , " mpeg4 " ) < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec findDecodingCodecByName ( String id ) { } }

implementation: long cPtr = VideoJNI . Codec_findDecodingCodecByName ( id ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Ask us to guess an encoding codec based on the inputs < br >
 * passed in . < br >
 * < p > < br >
 * You must pass in at least one non null fmt , shortName , < br >
 * url or mime _ type . < br >
 * < / p > < br >
 * @ param fmt A SinkFormat for the container you ' ll want to encode into . < br >
 * @ param shortName The FFMPEG short name of the codec ( e . g . " mpeg4 " ) . < br >
 * @ param url The URL you ' ll be writing packets to . < br >
 * @ param mimeType The mime type of the container . < br >
 * @ param type The codec type . < br >
 * @ return the codec , or null if we can ' t find it . */
public static Codec guessEncodingCodec ( MuxerFormat fmt , String shortName , String url , String mimeType , MediaDescriptor . Type type ) { } }

implementation: long cPtr = VideoJNI . Codec_guessEncodingCodec ( MuxerFormat . getCPtr ( fmt ) , fmt , shortName , url , mimeType , type . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Get the ICodec at the given index . < br >
 * < br >
 * @ param index the index in our list < br >
 * < br >
 * @ return the codec , or null if index & lt ; 0 or index & gt ; = < br >
 * # getNumInstalledCodecs ( ) */
public static Codec getInstalledCodec ( int index ) { } }

implementation: long cPtr = VideoJNI . Codec_getInstalledCodec ( index ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Codec { /** * Return the supported frame rate at the given index . < br >
 * < br >
 * @ param index the index in our list . < br >
 * < br >
 * @ return the frame rate , or null if unknown , if index & lt ; 0 or < br >
 * if index & gt ; = # getNumSupportedVideoFrameRates ( ) */
public Rational getSupportedVideoFrameRate ( int index ) { } }

implementation: long cPtr = VideoJNI . Codec_getSupportedVideoFrameRate ( swigCPtr , this , index ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class Codec { /** * Return the supported video pixel format at the given index . < br >
 * < br >
 * @ param index the index in our list . < br >
 * < br >
 * @ return the pixel format , or IPixelFormat . Type # NONE if unknown , < br >
 * if index & lt ; 0 or < br >
 * if index & gt ; = # getNumSupportedVideoPixelFormats ( ) */
public PixelFormat . Type getSupportedVideoPixelFormat ( int index ) { } }

implementation: return PixelFormat . Type . swigToEnum ( VideoJNI . Codec_getSupportedVideoPixelFormat ( swigCPtr , this , index ) ) ;


signature:
public class Codec { /** * Get the supported sample format at this index . < br >
 * < br >
 * @ param index the index in our list . < br >
 * < br >
 * @ return the format , or AudioFormat . Type . SAMPLE _ FMT _ NONE if < br >
 * unknown , index & lt ; 0 or index & gt ; = < br >
 * # getNumSupportedAudioSampleFormats ( ) . */
public AudioFormat . Type getSupportedAudioFormat ( int index ) { } }

implementation: return AudioFormat . Type . swigToEnum ( VideoJNI . Codec_getSupportedAudioFormat ( swigCPtr , this , index ) ) ;


signature:
public class Codec { /** * Get the supported audio channel layout at this index . < br >
 * < br >
 * The value returned is a bit flag representing the different < br >
 * types of audio layout this codec can support . Test the values < br >
 * by bit - comparing them to the AudioChannel . Layout < br >
 * enum types . < br >
 * < br >
 * @ param index the index < br >
 * < br >
 * @ return the channel layout , or 0 if unknown , index & lt ; 0 or < br >
 * index & gt ; = # getNumSupportedAudioChannelLayouts . */
public AudioChannel . Layout getSupportedAudioChannelLayout ( int index ) { } }

implementation: return AudioChannel . Layout . swigToEnum ( VideoJNI . Codec_getSupportedAudioChannelLayout ( swigCPtr , this , index ) ) ;


signature:
public class Codec { /** * Get the supported CodecProfile at this index . < br >
 * < br >
 * @ param index the index < br >
 * @ return A CodecProfile , or null if unknown , index & lt ; 0 < br >
 * or lindex & gt ; = # getNumSupportedProfiles . */
public CodecProfile getSupportedProfile ( int index ) { } }

implementation: long cPtr = VideoJNI . Codec_getSupportedProfile ( swigCPtr , this , index ) ; return ( cPtr == 0 ) ? null : new CodecProfile ( cPtr , false ) ;


signature:
public class MediaPictureResampler { /** * Resample in to out based on the resampler parameters . < br >
 * < br >
 * Resamples the in picture based on the parameters set when < br >
 * this resampler was constructed . < br >
 * < br >
 * @ param out The picture we ' ll resample to . Check < br >
 * MediaPicture # isComplete ( ) after the call . < br >
 * @ param in The picture we ' ll resample from . < br >
 * < br >
 * @ throws InvalidArgument if in our out does not match the parameters this < br >
 * resampler was set with . */
public int resample ( MediaSampled out , MediaSampled in ) { } }

implementation: return VideoJNI . MediaPictureResampler_resample ( swigCPtr , this , MediaSampled . getCPtr ( out ) , out , MediaSampled . getCPtr ( in ) , in ) ;


signature:
public class MediaPictureResampler { /** * A more precisely typed way to call # resample */
public int resamplePicture ( MediaPicture out , MediaPicture in ) { } }

implementation: return VideoJNI . MediaPictureResampler_resamplePicture ( swigCPtr , this , MediaPicture . getCPtr ( out ) , out , MediaPicture . getCPtr ( in ) , in ) ;


signature:
public class MediaPictureResampler { /** * Get a new picture resampler . < br >
 * < br >
 * @ param outputWidth The width in pixels you want to output frame to have . < br >
 * @ param outputHeight The height in pixels you want to output frame to have . < br >
 * @ param outputFmt The pixel format of the output frame . < br >
 * @ param inputWidth The width in pixels the input frame will be in . < br >
 * @ param inputHeight The height in pixels the input frame will be in . < br >
 * @ param inputFmt The pixel format of the input frame . < br >
 * @ return a new object , or null if we cannot allocate one . */
public static MediaPictureResampler make ( int outputWidth , int outputHeight , PixelFormat . Type outputFmt , int inputWidth , int inputHeight , PixelFormat . Type inputFmt , int flags ) { } }

implementation: long cPtr = VideoJNI . MediaPictureResampler_make ( outputWidth , outputHeight , outputFmt . swigValue ( ) , inputWidth , inputHeight , inputFmt . swigValue ( ) , flags ) ; return ( cPtr == 0 ) ? null : new MediaPictureResampler ( cPtr , false ) ;


signature:
public class InputOutputStreamHandler { /** * { @ inheritDoc } */
public int open ( String url , int flags ) { } }

implementation: if ( mOpenStream != null ) { log . debug ( "attempting to open already open handler: {}" , mOpenStream ) ; return - 1 ; } switch ( flags ) { case URL_RDWR : log . debug ( "do not support read/write mode for Java IO Handlers" ) ; return - 1 ; case URL_WRONLY_MODE : mOpenStream = mOutputStream ; if ( mOpenStream == null ) { log . error ( "No OutputStream specified for writing: {}" , url ) ; return - 1 ; } break ; case URL_RDONLY_MODE : mOpenStream = mInputStream ; if ( mOpenStream == null ) { log . error ( "No InputStream specified for reading: {}" , url ) ; return - 1 ; } break ; default : log . error ( "Invalid flag passed to open: {}" , url ) ; return - 1 ; } return 0 ;


signature:
public class InputOutputStreamHandler { /** * { @ inheritDoc } */
public int read ( byte [ ] buf , int size ) { } }

implementation: int ret = - 1 ; if ( mOpenStream == null || ! ( mOpenStream instanceof InputStream ) ) return - 1 ; try { InputStream stream = ( InputStream ) mOpenStream ; ret = stream . read ( buf , 0 , size ) ; return ret ; } catch ( IOException e ) { log . error ( "Got IO exception reading from stream: {}; {}" , mOpenStream , e ) ; return - 1 ; }


signature:
public class InputOutputStreamHandler { /** * { @ inheritDoc } */
public int write ( byte [ ] buf , int size ) { } }

implementation: if ( mOpenStream == null || ! ( mOpenStream instanceof OutputStream ) ) return - 1 ; try { OutputStream stream = ( OutputStream ) mOpenStream ; stream . write ( buf , 0 , size ) ; return size ; } catch ( IOException e ) { log . error ( "Got error writing to file: {}; {}" , mOpenStream , e ) ; return - 1 ; }


signature:
public class KeyValueBag { /** * Get the set of keys currently in this { @ link KeyValueBag } object
 * as an unordered collection .
 * @ return the keys . */
public java . util . Collection < String > getKeys ( ) { } }

implementation: int numKeys = getNumKeys ( ) ; java . util . List < String > retval = new java . util . ArrayList < String > ( numKeys ) ; for ( int i = 0 ; i < getNumKeys ( ) ; i ++ ) { String key = getKey ( i ) ; if ( key != null && key . length ( ) > 0 ) retval . add ( key ) ; } return retval ;


signature:
public class KeyValueBag { /** * Get the value for the given key . < br >
 * < br >
 * @ param key The key < br >
 * @ param flag A flag for how to search < br >
 * < br >
 * @ return The value , or null if none . */
public String getValue ( String key , KeyValueBag . Flags flag ) { } }

implementation: return VideoJNI . KeyValueBag_getValue ( swigCPtr , this , key , flag . swigValue ( ) ) ;


signature:
public class KeyValueBag { /** * Sets the value for the given key to value . This overrides < br >
 * any prior setting for key , or adds key to the meta - data < br >
 * if appropriate . < br >
 * < br >
 * @ param key The key to set . < br >
 * @ param value The value to set . */
public int setValue ( String key , String value ) { } }

implementation: return VideoJNI . KeyValueBag_setValue__SWIG_0 ( swigCPtr , this , key , value ) ;


signature:
public class KeyValueBag { /** * Create a new KeyValueBag bag of properties with < br >
 * no values set . */
public static KeyValueBag make ( ) { } }

implementation: long cPtr = VideoJNI . KeyValueBag_make ( ) ; return ( cPtr == 0 ) ? null : new KeyValueBag ( cPtr , false ) ;


signature:
public class KeyValueBag { /** * Sets the value for the given key to value . This overrides < br >
 * any prior setting for key , or adds key to the meta - data < br >
 * if appropriate . < br >
 * < br >
 * @ param key The key to set . < br >
 * @ param value The value to set . < br >
 * @ param flag A flag on how this should be set . < br >
 * < br >
 * @ since 5.0 */
public int setValue ( String key , String value , KeyValueBag . Flags flag ) { } }

implementation: return VideoJNI . KeyValueBag_setValue__SWIG_1 ( swigCPtr , this , key , value , flag . swigValue ( ) ) ;


signature:
public class Coder { /** * Open this Coder , using the given bag of Codec - specific options . < br >
 * < br >
 * @ param inputOptions If non - null , a bag of codec - specific options . < br >
 * @ param unsetOptions If non - null , the bag will be emptied and then filled with < br >
 * the options in < code > inputOptions < / code > that were not set . */
public void open ( KeyValueBag inputOptions , KeyValueBag unsetOptions ) { } }

implementation: VideoJNI . Coder_open ( swigCPtr , this , KeyValueBag . getCPtr ( inputOptions ) , inputOptions , KeyValueBag . getCPtr ( unsetOptions ) , unsetOptions ) ;


signature:
public class Coder { /** * The Codec this StreamCoder will use . < br >
 * < br >
 * @ return The Codec used by this StreamCoder , or 0 ( null ) if none . */
public Codec getCodec ( ) { } }

implementation: long cPtr = VideoJNI . Coder_getCodec ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Codec ( cPtr , false ) ;


signature:
public class Coder { /** * Get the time base this stream will ENCODE in , or the time base we < br >
 * detect while DECODING . < br >
 * < br >
 * @ return The time base this StreamCoder is using . */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . Coder_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class Coder { /** * Set the time base we ' ll use to ENCODE with . A no - op when DECODING . < br >
 * < br >
 * As a convenience , we forward this call to the Stream # setTimeBase ( ) < br >
 * method . < br >
 * < br >
 * @ see # getTimeBase ( ) < br >
 * < br >
 * @ param newTimeBase The new time base to use . */
public void setTimeBase ( Rational newTimeBase ) { } }

implementation: VideoJNI . Coder_setTimeBase ( swigCPtr , this , Rational . getCPtr ( newTimeBase ) , newTimeBase ) ;


signature:
public class Coder { /** * Set a flag to true or false . */
public void setFlag ( Coder . Flag flag , boolean value ) { } }

implementation: VideoJNI . Coder_setFlag ( swigCPtr , this , flag . swigValue ( ) , value ) ;


signature:
public class Coder { /** * Set a flag2 to true or false . */
public void setFlag2 ( Coder . Flag2 flag , boolean value ) { } }

implementation: VideoJNI . Coder_setFlag2 ( swigCPtr , this , flag . swigValue ( ) , value ) ;


signature:
public class DemuxerStream { /** * Get the decoder that can decode the information in this Demuxer stream . */
public Decoder getDecoder ( ) { } }

implementation: long cPtr = VideoJNI . DemuxerStream_getDecoder ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Decoder ( cPtr , false ) ;


signature:
public class DemuxerStream { /** * Get the Demuxer this DemuxerStream belongs to . */
public Demuxer getDemuxer ( ) { } }

implementation: long cPtr = VideoJNI . DemuxerStream_getDemuxer ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Demuxer ( cPtr , false ) ;


signature:
public class MuxerFormat { /** * Return a collection of all output formats installed on this system .
 * @ return the list . */
public static java . util . Collection < MuxerFormat > getFormats ( ) { } }

implementation: java . util . Collection < MuxerFormat > retval = new java . util . HashSet < MuxerFormat > ( ) ; int count = getNumFormats ( ) ; for ( int i = 0 ; i < count ; ++ i ) { MuxerFormat fmt = getFormat ( i ) ; if ( fmt != null ) retval . add ( fmt ) ; } return retval ;


signature:
public class MuxerFormat { /** * Return the sink format in the list of registered sink formats < br >
 * which best matches the provided parameters , or return NULL if < br >
 * there is no match . < br >
 * < br >
 * @ param shortName if non - NULL checks if short _ name matches with the < br >
 * names of the registered formats < br >
 * @ param filename if non - NULL checks if filename terminates with the < br >
 * extensions of the registered formats < br >
 * @ param mimeType if non - NULL checks if mime _ type matches with the < br >
 * MIME type of the registered formats */
public static MuxerFormat guessFormat ( String shortName , String filename , String mimeType ) { } }

implementation: long cPtr = VideoJNI . MuxerFormat_guessFormat ( shortName , filename , mimeType ) ; return ( cPtr == 0 ) ? null : new MuxerFormat ( cPtr , false ) ;


signature:
public class MuxerFormat { /** * Get the Codec . ID for the n ' th codec supported by this container . < br >
 * < br >
 * @ param n The n ' th codec supported by this codec . Lower n are higher priority . < br >
 * n must be & lt ; # getNumSupportedCodecs ( ) < br >
 * @ return the Codec . ID at the n ' th slot , or Codec . ID . CODEC _ ID _ NONE if none . */
protected Codec . ID getSupportedCodecId ( int n ) { } }

implementation: return Codec . ID . swigToEnum ( VideoJNI . MuxerFormat_getSupportedCodecId ( swigCPtr , this , n ) ) ;


signature:
public class MuxerFormat { /** * Return an object for the input format at the given index . < br >
 * < br >
 * @ param index an index for the input format list we maintain < br >
 * < br >
 * @ return a format object for that input or null if < br >
 * unknown , index & lt ; 0 or index & gt ; = # getNumInstalledInputFormats ( ) */
public static MuxerFormat getFormat ( int index ) { } }

implementation: long cPtr = VideoJNI . MuxerFormat_getFormat ( index ) ; return ( cPtr == 0 ) ? null : new MuxerFormat ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Creates a new FilterGraph . */
public static FilterGraph make ( ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_make ( ) ; return ( cPtr == 0 ) ? null : new FilterGraph ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Add a filter with the given name to the graph . < br >
 * @ return An object that refers to the new filter . */
public Filter addFilter ( FilterType type , String name ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_addFilter ( swigCPtr , this , FilterType . getCPtr ( type ) , type , name ) ; return ( cPtr == 0 ) ? null : new Filter ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Add a FilterAudioSource . < br >
 * @ param name the name ; must be unique in graph < br >
 * @ param timeBase timebase of frames that will be input . If null 1 / sampleRate is assumed . < br >
 * @ param sampleRate the audio sample rate < br >
 * < br >
 * @ param format the sample format < br >
 * < br >
 * @ return The FilterSource that was added . < br >
 * @ throws RuntimeException if name is already in graph . < br >
 * @ throws InvalidArgument if any argument is invalid . */
public FilterAudioSource addAudioSource ( String name , int sampleRate , AudioChannel . Layout channelLayout , AudioFormat . Type format , Rational timeBase ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_addAudioSource ( swigCPtr , this , name , sampleRate , channelLayout . swigValue ( ) , format . swigValue ( ) , Rational . getCPtr ( timeBase ) , timeBase ) ; return ( cPtr == 0 ) ? null : new FilterAudioSource ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Add a FilterPictureSource . < br >
 * @ param name the name ; must be unique in graph < br >
 * @ param width the width in pixels of MediaPicture objects that will be added to this source . < br >
 * @ param height the height in pixels of MediaPicture objects that will be added to this source . < br >
 * @ param format the pixel format < br >
 * @ param timeBase timebase of frames that will be input . If null , 1 / Global . DEFAULT _ PTS _ PER _ SECOND is assumed . < br >
 * @ param pixelAspectRatio pixel aspect ratio . If null , 1/1 is assumed . < br >
 * < br >
 * @ return The FilterSource that was added . < br >
 * @ throws RuntimeException if name is already in graph . < br >
 * @ throws InvalidArgument if any argument is invalid . */
public FilterPictureSource addPictureSource ( String name , int width , int height , PixelFormat . Type format , Rational timeBase , Rational pixelAspectRatio ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_addPictureSource ( swigCPtr , this , name , width , height , format . swigValue ( ) , Rational . getCPtr ( timeBase ) , timeBase , Rational . getCPtr ( pixelAspectRatio ) , pixelAspectRatio ) ; return ( cPtr == 0 ) ? null : new FilterPictureSource ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Add a FilterAudioSink . < br >
 * @ param name the name ; must be unique in graph < br >
 * @ param sampleRate the audio sample rate < br >
 * < br >
 * @ param format the sample format < br >
 * < br >
 * @ return The FilterAudioSink that was added . < br >
 * @ throws RuntimeException if name is already in graph . < br >
 * @ throws InvalidArgument if any argument is invalid . */
public FilterAudioSink addAudioSink ( String name , int sampleRate , AudioChannel . Layout channelLayout , AudioFormat . Type format ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_addAudioSink ( swigCPtr , this , name , sampleRate , channelLayout . swigValue ( ) , format . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new FilterAudioSink ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Add a FilterPictureSink . < br >
 * @ param name the name ; must be unique in graph < br >
 * @ param format the pixel format desired of pictures taken from this sink . < br >
 * @ return The FilterPictureSink that was added . < br >
 * @ throws RuntimeException if name is already in graph . < br >
 * @ throws InvalidArgument if any argument is invalid . */
public FilterPictureSink addPictureSink ( String name , PixelFormat . Type format ) { } }

implementation: long cPtr = VideoJNI . FilterGraph_addPictureSink ( swigCPtr , this , name , format . swigValue ( ) ) ; return ( cPtr == 0 ) ? null : new FilterPictureSink ( cPtr , false ) ;


signature:
public class FilterGraph { /** * Queue a command for one or more filter instances . < br >
 * < br >
 * @ param target the filter ( s ) to which the command should be sent < br >
 * " all " sends to all filters < br >
 * otherwise it can be a filter or filter instance name < br >
 * which will send the command to all matching filters . < br >
 * @ param command the command to sent , for handling simplicity all commands must be alphanummeric only < br >
 * @ param arguments the argument for the command < br >
 * @ param ts time at which the command should be sent to the filter < br >
 * < br >
 * Note : As this executes commands after this function returns , no return code < br >
 * from the filter is provided , also AVFILTER _ CMD _ FLAG _ ONE is not supported . */
public void queueCommand ( String target , String command , String arguments , int flags , double ts ) { } }

implementation: VideoJNI . FilterGraph_queueCommand ( swigCPtr , this , target , command , arguments , flags , ts ) ;


signature:
public class IndexEntry { /** * Create a new IndexEntry with the specified < br >
 * values . < br >
 * < br >
 * @ param position The value to be returned from # getPosition ( ) . < br >
 * @ param timeStamp The value to be returned from # getTimeStamp ( ) . < br >
 * @ param flags The value to be returned from # getFlags ( ) . < br >
 * @ param size The value to be returned from # getSize ( ) . < br >
 * @ param minDistance The value to be returned from # getMinDistance ( ) . */
public static IndexEntry make ( long position , long timeStamp , int flags , int size , int minDistance ) { } }

implementation: long cPtr = VideoJNI . IndexEntry_make ( position , timeStamp , flags , size , minDistance ) ; return ( cPtr == 0 ) ? null : new IndexEntry ( cPtr , false ) ;


signature:
public class BitStreamFilter { /** * Create a filter given the name . < br >
 * < br >
 * @ param filtername The name of the filter . < br >
 * < br >
 * @ see BitStreamFilterType */
public static BitStreamFilter make ( String filtername ) { } }

implementation: long cPtr = VideoJNI . BitStreamFilter_make__SWIG_0 ( filtername ) ; return ( cPtr == 0 ) ? null : new BitStreamFilter ( cPtr , false ) ;


signature:
public class BitStreamFilter { /** * Create a filter given the type . < br >
 * < br >
 * @ param type The type of the filter . < br >
 * < br >
 * @ see BitStreamFilterType */
public static BitStreamFilter make ( BitStreamFilterType type ) { } }

implementation: long cPtr = VideoJNI . BitStreamFilter_make__SWIG_1 ( BitStreamFilterType . getCPtr ( type ) , type ) ; return ( cPtr == 0 ) ? null : new BitStreamFilter ( cPtr , false ) ;


signature:
public class BitStreamFilter { /** * Get the type of this filter . */
public BitStreamFilterType getType ( ) { } }

implementation: long cPtr = VideoJNI . BitStreamFilter_getType ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new BitStreamFilterType ( cPtr , false ) ;


signature:
public class BitStreamFilter { /** * Filter the input buffer into the output buffer . < br >
 * < br >
 * @ param output The output buffer to copy filtered bytes to . < br >
 * @ param outputOffset The offset in output to copy data into . < br >
 * @ param input The input buffer to filter . < br >
 * @ param inputOffset The number of bytes into input to start filtering at . < br >
 * @ param inputSize The number of bytes ( from inputOffset ) to filter . < br >
 * @ param coder The Coder context belong to the Stream that this data will eventually get outputted to . < br >
 * @ param args String arguments for the filter call . See the FFmpeg documentation or source code . < br >
 * @ param isKey Does this data represent a key packet . < br >
 * < br >
 * @ return The number of bytes copied into output once filtering is done . < br >
 * < br >
 * @ throws InvalidArgument if any parameters are invalid . < br >
 * @ throws FfmpegException if the filtering fails for any reason . */
public int filter ( Buffer output , int outputOffset , Buffer input , int inputOffset , int inputSize , Coder coder , String args , boolean isKey ) { } }

implementation: return VideoJNI . BitStreamFilter_filter__SWIG_0 ( swigCPtr , this , Buffer . getCPtr ( output ) , output , outputOffset , Buffer . getCPtr ( input ) , input , inputOffset , inputSize , Coder . getCPtr ( coder ) , coder , args , isKey ) ;


signature:
public class BitStreamFilter { /** * Filters a packet in place ( i . e . the prior contents will be replaced < br >
 * with the filtered data ) . < br >
 * < br >
 * This method assumes packet . getCoder ( ) is the coder that is being used < br >
 * for outputting the packet to a stream . If this is not the case , use < br >
 * the other filter mechanism and construct packets yourself . < br >
 * < br >
 * @ param packet The packet to filter in place . < br >
 * @ param args Text arguments for the filter . < br >
 * < br >
 * @ throws InvalidArgument if output is null . < br >
 * @ throws InvalidArgument if input is null or not complete . */
public void filter ( MediaPacket packet , String args ) { } }

implementation: VideoJNI . BitStreamFilter_filter__SWIG_1 ( swigCPtr , this , MediaPacket . getCPtr ( packet ) , packet , args ) ;


signature:
public class Buffer { /** * Absolute bulk put method .
 * This method transfers bytes into this buffer from the given source array .
 * If there are more bytes to be copied from the array than there is
 * space remaining at the specified destination offset ,
 * then no bytes are transferred and a java . nio . BufferOverflowException is thrown .
 * This method is equivalent to calling { @ link # getByteBuffer ( int , int ) }
 * yourself and copying the bytes over , but is more efficient in
 * the { @ link JNIMemoryManager . MemoryModel # NATIVE _ BUFFERS } memory model .
 * @ param src The array from which bytes are to be read . Must be non null .
 * @ param srcPos The offset within < code > src < / code > of the first byte to be read ;
 * must be non - negative and less than < code > src . length < / code >
 * @ param destPos The offset in the Buffer where you want to copy
 * data to . Must be non - negative and less than < code > getBufferSize ( ) < / code >
 * @ param length The number of bytes to be read from < code > src < / code > ;
 * must be non - negative and no larger than < code > src . length - srcPos < / code >
 * @ throws NullPointerException if < code > src < / code > is null .
 * @ throws IndexOutOfBoundsException if the preconditions on the arguments
 * mentioned above are not honored .
 * @ throws java . nio . BufferOverflowException if there is insufficient space
 * in this { @ link Buffer } . */
public void put ( byte [ ] src , int srcPos , int destPos , int length ) { } }

implementation: java . util . concurrent . atomic . AtomicReference < JNIReference > ref = new java . util . concurrent . atomic . AtomicReference < JNIReference > ( ) ; java . nio . ByteBuffer buffer = this . getByteBuffer ( 0 , this . getBufferSize ( ) , ref ) ; try { if ( buffer == null ) return ; buffer . clear ( ) ; validateArgs ( src , src . length , srcPos , buffer . limit ( ) , destPos , length ) ; buffer . position ( destPos ) ; buffer . put ( src , srcPos , length ) ; return ; } finally { if ( ref . get ( ) != null ) ref . get ( ) . delete ( ) ; }


signature:
public class Buffer { /** * Returns up to length bytes , starting at offset in the underlying
 * buffer we ' re managing .
 * The buffer position , mark are initialized to zero and limit
 * is set to the maximum capacity of this buffer . For some
 * Buffer contents , the actual usable data in this buffer will
 * be less that the limit .
 * If you want to control exactly when the underlying memory
 * beyind the returned { @ link java . nio . ByteBuffer } is released ,
 * use { @ link # getByteBuffer ( int , int , java . util . concurrent . atomic . AtomicReference ) } .
 * @ see # getByteBuffer ( int , int , java . util . concurrent . atomic . AtomicReference ) */
public java . nio . ByteBuffer getByteBuffer ( int offset , int length ) { } }

implementation: return getByteBuffer ( offset , length , null ) ;


signature:
public class Buffer { /** * Returns up to length bytes , starting at offset in the underlying
 * buffer we ' re managing , and also passed back a { @ link JNIReference }
 * that can optionally be used by the caller to free the underlying
 * native memory .
 * The buffer position , mark are initialized to zero and limit
 * is set to the maximum capacity of this buffer . For some
 * Buffer contents , the actual usable data in this buffer will
 * be less that the limit .
 * If you use this method you are accessing the direct native
 * memory associated with this buffer . That means changes you make
 * to this buffer are immediately reflected in the underlying
 * memory .
 * Once you call this method ,
 * the underlying native memory allocated will not be released until
 * all references to the returned ByteBuffer are no longer reachable and
 * at least one call to { @ link JNIMemoryManager # gc ( ) } has been
 * performed . You can force the memory to be collect earlier
 * by using the { @ link JNIReference } value returned when you
 * call this method .
 * < / p > < p >
 * The { @ link JNIMemoryManager # gc ( ) } is called whenever
 * Humble Video tries to allocate new memory for any Humble interface ,
 * so normally you don ' t need to care about this . If for some
 * reason no other Humble object is ever allocated , every
 * Humble object has
 * a finalizer as well that will do the right thing .
 * You can also start up
 * a separate thread to do continuously do Ferry garabage
 * collections by calling
 * { @ link JNIMemoryManager # startCollectionThread ( ) } . This thread
 * will only wake up when it has work to do , so the overhead
 * is very low . We don ' t turn it on by default since in
 * 99.999 % of cases you don ' t need to worry about it .
 * @ param offset The offset ( in bytes ) into the buffer managed by
 * this Buffer
 * @ param length The requested length ( in bytes ) you want to access .
 * The buffer returned may actually be longer than length .
 * @ param referenceReturn If non null , on exit
 * calling { @ link java . util . concurrent . atomic . AtomicReference # get ( ) }
 * on this value will return a { @ link JNIReference } you can use
 * for explicitly de - allocating the underlying native store
 * of the { @ link java . nio . ByteBuffer } . Call
 * { @ link JNIReference # delete ( ) } to do that . < strong > Warning : < / strong >
 * if you do call { @ link JNIReference # delete ( ) } on the
 * value returned in this parameter , then the returned byte buffer
 * will be immediately invalid .
 * @ return A java . nio . ByteBuffer that directly accesses
 * the native memory this Buffer manages , or null if
 * error . */
public java . nio . ByteBuffer getByteBuffer ( int offset , int length , java . util . concurrent . atomic . AtomicReference < JNIReference > referenceReturn ) { } }

implementation:
java . nio . ByteBuffer retval = this . java_getByteBuffer ( offset , length ) ; if ( retval != null ) { // increment the ref count of this class to reflect the
// byte buffer
java . util . concurrent . atomic . AtomicLong refCount = this . getJavaRefCount ( ) ; refCount . incrementAndGet ( ) ; // and use the byte buffer as the reference to track
JNIReference ref = JNIReference . createNonFerryReference ( this , retval , swigCPtr , refCount ) ; if ( referenceReturn != null ) referenceReturn . set ( ref ) ; // and tell Java this byte buffer is in native order
retval . order ( java . nio . ByteOrder . nativeOrder ( ) ) ; retval . position ( 0 ) ; retval . mark ( ) ; retval . limit ( this . getBufferSize ( ) ) ; } return retval ;


signature:
public class Buffer { /** * Allocate a new buffer of at least bufferSize . < br >
 * < br >
 * @ param requestor An optional value telling the Buffer class what object requested it . This is used for debugging memory leaks ; it ' s a marker for the FERRY object ( e . g . IPacket ) that actually requested the buffer . If you ' re not an FERRY object , pass in null here . < br >
 * @ param bufferSize The minimum buffer size you ' re requesting in bytes ; a buffer with a larger size may be returned . < br >
 * < br >
 * @ return A new buffer , or null on error . */
public static Buffer make ( RefCounted requestor , int bufferSize ) { } }

implementation: long cPtr = FerryJNI . Buffer_make__SWIG_0 ( RefCounted . getCPtr ( requestor ) , requestor , bufferSize ) ; return ( cPtr == 0 ) ? null : new Buffer ( cPtr , false ) ;


signature:
public class Buffer { /** * Allocate a new buffer of at least bufferSize . < br >
 * < br >
 * @ param requestor An optional value telling the Buffer class what object requested it . This is used for debugging memory leaks ; it ' s a marker for the FERRY object ( e . g . IPacket ) that actually requested the buffer . If you ' re not an FERRY object , pass in null here . < br >
 * @ param type The type of buffer . < br >
 * @ param numElements The minimum number of elements of the specified < br >
 * type you will put in this buffer . < br >
 * @ param zero If true , we will guarantee the buffer contains < br >
 * only zeros . If false , we will not ( it is < br >
 * faster to not , but then the buffer will have < br >
 * garbage - data in it ) . < br >
 * < br >
 * @ return A new buffer , or null on error . */
public static Buffer make ( RefCounted requestor , Buffer . Type type , int numElements , boolean zero ) { } }

implementation: long cPtr = FerryJNI . Buffer_make__SWIG_1 ( RefCounted . getCPtr ( requestor ) , requestor , type . swigValue ( ) , numElements , zero ) ; return ( cPtr == 0 ) ? null : new Buffer ( cPtr , false ) ;


signature:
public class Buffer { /** * Allocate a new Buffer , and copy the data in buffer into < br >
 * the new Buffer object . < br >
 * < br >
 * @ param requestor An optional value telling the Buffer class < br >
 * what object requested it . This is used for debugging memory leaks ; < br >
 * it ' s a marker for the FERRY object ( e . g . IPacket ) that actually < br >
 * requested the buffer . If you ' re not an FERRY object , pass in null here . < br >
 * @ param buffer A java byte buffer for the data containing the < br >
 * data you want to copy . < br >
 * @ param offset The starting offset in buffer where you want < br >
 * to start copying . < br >
 * @ param length The total number of bytes you want to copy from buffer . < br >
 * < br >
 * @ return a new Buffer object with a copy of the data in buffer , < br >
 * or null on failure . */
public static Buffer make ( RefCounted requestor , byte [ ] buffer , int offset , int length ) { } }

implementation: long cPtr = FerryJNI . Buffer_make__SWIG_2 ( RefCounted . getCPtr ( requestor ) , requestor , buffer , offset , length ) ; return ( cPtr == 0 ) ? null : new Buffer ( cPtr , false ) ;


signature:
public class Buffer { /** * Create a new Buffer object that uses the direct byte buffer < br >
 * passed in by reference ( i . e . it directly uses the bytes in < br >
 * the direct byte buffer ) . < br >
 * < br >
 * @ param requestor An optional value telling the Buffer class < br >
 * what object requested it . This is used for debugging memory leaks ; < br >
 * it ' s a marker for the FERRY object ( e . g . IPacket ) that actually < br >
 * requested the buffer . If you ' re not an FERRY object , pass in null here . < br >
 * @ param directByteBuffer A direct java . nio . ByteBuffer object < br >
 * you want to use for your memory . This must be a direct object - - < br >
 * non direct objects will result in an JVM - dependent exception < br >
 * being thrown . < br >
 * @ param offset The starting offset in directByteBuffer where you want < br >
 * to start copying . < br >
 * @ param length The total number of bytes you want to copy from < br >
 * directByteBuffer . < br >
 * < br >
 * @ return a new Buffer object that is using directByteBuffer < br >
 * behind the scenes , or null on failure . */
public static Buffer make ( RefCounted requestor , java . nio . ByteBuffer directByteBuffer , int offset , int length ) { } }

implementation: long cPtr = FerryJNI . Buffer_make__SWIG_3 ( RefCounted . getCPtr ( requestor ) , requestor , directByteBuffer , offset , length ) ; return ( cPtr == 0 ) ? null : new Buffer ( cPtr , false ) ;


signature:
public class AudioFrame { /** * Get a connection to the speaker , if available .
 * @ param audioFormat The java audio format that we will use .
 * @ return A new audio format , or null if we cannot create one . */
public static AudioFrame make ( final AudioFormat audioFormat ) { } }

implementation: try { return new AudioFrame ( audioFormat ) ; } catch ( LineUnavailableException e ) { log . error ( "Could not get audio data line: {}" , e . getMessage ( ) ) ; return null ; }


signature:
public class AudioFrame { /** * Play the given bytes ( in { @ link # getFormat ( ) } format on the device .
 * @ param rawAudio a byte buffer where the data from { @ link ByteBuffer # position ( ) }
 * to { @ link ByteBuffer # limit ( ) } will be written . */
public void play ( ByteBuffer rawAudio ) { } }

implementation: byte [ ] data = rawAudio . array ( ) ; mLine . write ( data , rawAudio . position ( ) , rawAudio . limit ( ) ) ;


signature:
public class AMediaPictureConverter { /** * Re - sample a picture .
 * @ param picture1 the picture to re - sample
 * @ param resampler the picture re - samper to use
 * @ throws RuntimeException if could not re - sample picture */
protected static MediaPicture resample ( MediaPicture input , MediaPictureResampler resampler ) { } }

implementation:
// create new picture object
MediaPicture output = MediaPicture . make ( resampler . getOutputWidth ( ) , resampler . getOutputHeight ( ) , resampler . getOutputFormat ( ) ) ; return resample ( output , input , resampler ) ;


signature:
public class AMediaPictureConverter { /** * Test that the passed image is valid and conforms to the
 * converters specifications .
 * @ param image the image to test
 * @ throws IllegalArgumentException if the passed { @ link
 * BufferedImage } is NULL ;
 * @ throws IllegalArgumentException if the passed { @ link
 * BufferedImage } is not the correct type . See { @ link
 * # getImageType } . */
protected void validateImage ( BufferedImage image ) { } }

implementation:
// if the image is NULL , throw up
if ( image == null ) throw new IllegalArgumentException ( "The passed image is NULL." ) ; // if image is not the correct type , throw up
if ( image . getType ( ) != getImageType ( ) ) throw new IllegalArgumentException ( "The passed image is of type #" + image . getType ( ) + " but is required to be of BufferedImage type #" + getImageType ( ) + "." ) ;


signature:
public class AMediaPictureConverter { /** * Test that the passed picture is valid and conforms to the
 * converters specifications .
 * @ param picture the picture to test
 * @ throws IllegalArgumentException if the passed { @ link
 * MediaPicture } is NULL ;
 * @ throws IllegalArgumentException if the passed { @ link
 * MediaPicture } is not complete .
 * @ throws IllegalArgumentException if the passed { @ link
 * MediaPicture } is not the correct type . */
protected void validatePicture ( MediaPicture picture ) { } }

implementation:
// if the picture is NULL , throw up
if ( picture == null ) throw new IllegalArgumentException ( "The picture is NULL." ) ; // if the picture is not complete , throw up
if ( ! picture . isComplete ( ) ) throw new IllegalArgumentException ( "The picture is not complete." ) ; // if the picture is an invalid type throw up
PixelFormat . Type type = picture . getFormat ( ) ; if ( ( type != getPictureType ( ) ) && ( willResample ( ) && type != mToImageResampler . getOutputFormat ( ) ) ) throw new IllegalArgumentException ( "Picture is of type: " + type + ", but must be " + getPictureType ( ) + ( willResample ( ) ? " or " + mToImageResampler . getOutputFormat ( ) : "" ) + "." ) ;


signature:
public class JNIThreadProxy { /** * { @ inheritDoc } */
@ Override public boolean isInterrupted ( ) { } }

implementation: final Thread thread = mThreads . get ( ) . mThread ; final Interruptable handler = getGlobalInterruptHandler ( ) ; boolean retval = false ; if ( handler != null ) { retval = handler . preInterruptCheck ( ) ; if ( ! retval ) return retval ; } retval = thread . isInterrupted ( ) ; if ( handler != null ) { retval = handler . postInterruptCheck ( retval ) ; } return retval ;


signature:
public class JNIThreadProxy { /** * { @ inheritDoc } */
@ Override public void interrupt ( ) { } }

implementation: final Thread thread = mThreads . get ( ) . mThread ; log . trace ( "interrupt (thread {})" , thread ) ; thread . interrupt ( ) ; return ;


signature:
public class FilterLink { /** * Get the FilterGraph this FilterLink belongs to . */
public FilterGraph getFilterGraph ( ) { } }

implementation: long cPtr = VideoJNI . FilterLink_getFilterGraph ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new FilterGraph ( cPtr , false ) ;


signature:
public class FilterLink { /** * Define the time base used by the PTS of the frames / samples < br >
 * which will pass through this link . < br >
 * During the configuration stage , each filter is supposed to < br >
 * change only the output timebase , while the timebase of the < br >
 * input link is assumed to be an unchangeable property . < br >
 * < br >
 * @ return the timebase */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . FilterLink_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class FilterLink { /** * Insert a filter into this link between the current input and output . < br >
 * @ param filter filter to insert < br >
 * @ param srcPadIndex the index of the pad on filter to connect the output of the start of the prior link to . < br >
 * @ param dstPadIndex the index of the pad on filter to connect the input of the end of the prior link to . */
public void insertFilter ( Filter filter , int srcPadIndex , int dstPadIndex ) { } }

implementation: VideoJNI . FilterLink_insertFilter ( swigCPtr , this , Filter . getCPtr ( filter ) , filter , srcPadIndex , dstPadIndex ) ;


signature:
public class MediaRaw { /** * Get the time base that time stamps of this object are represented in . < br >
 * < br >
 * @ return the time base . */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . MediaRaw_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class MediaRaw { /** * Get any meta - data associated with this media item */
public KeyValueBag getMetaData ( ) { } }

implementation: long cPtr = VideoJNI . MediaRaw_getMetaData ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new KeyValueBag ( cPtr , false ) ;


signature:
public class MediaRaw { /** * Sets the timebase on this object . < br >
 * < br >
 * Note : This will NOT automatically rescale the timestamp set - - so if you change < br >
 * the timebase , you almost definitely want to change the timestamp as well . */
public void setTimeBase ( Rational timeBase ) { } }

implementation: VideoJNI . MediaRaw_setTimeBase ( swigCPtr , this , Rational . getCPtr ( timeBase ) , timeBase ) ;


signature:
public class URLProtocolManager { /** * Register a new factory for IURLProtocolHandlers for a given protocol .
 * FFMPEG is very picky ; protocols must be only alpha characters ( no numbers ) .
 * @ param protocol The protocol , without colon , this factory is to be used for .
 * @ param factory The factory for the manager to use whenever a handler is requested for a registered protocol ;
 * null means disable handling for this factory .
 * @ return The factory that was previously used for that protocol ( or null if none ) . */
public IURLProtocolHandlerFactory registerFactory ( String protocol , IURLProtocolHandlerFactory factory ) { } }

implementation:
if ( protocol == null ) throw new IllegalArgumentException ( "protocol required" ) ; IURLProtocolHandlerFactory oldFactory ; if ( factory == null ) oldFactory = mProtocols . remove ( protocol ) ; else oldFactory = mProtocols . put ( protocol , factory ) ; log . trace ( "Registering factory for URLProtocol: {}" , protocol ) ; if ( oldFactory == null ) { // we previously didn ' t have something registered for this factory
// so tell FFMPEG we ' re now the protocol manager for this protocol .
log . trace ( "Letting FFMPEG know about an additional protocol: {}" , protocol ) ; FfmpegIO . registerProtocolHandler ( protocol , this ) ; } return oldFactory ;


signature:
public class URLProtocolManager { /** * Get a IURLProtocolHandler for this url .
 * IMPORTANT : This function is called from native code , and so the name and signature cannot
 * change without changing the native code .
 * < / p > < p >
 * This function is eventually invoked whenever someone tries to call url _ open ( " yourprotocol : . . . " , flags )
 * from FFMPEG native code . It returns a protocol handler which will then have open ( . . . ) called on it .
 * @ param url The URL we want to handle .
 * @ param flags Any flags that the url _ open ( ) function will want to pass .
 * @ returns A protocol handler to use . */
public IURLProtocolHandler getHandler ( String url , int flags ) { } }

implementation: IURLProtocolHandler result = null ; log . trace ( "looking for protocol handler for: {}" , url ) ; if ( url == null || url . length ( ) == 0 ) throw new IllegalArgumentException ( "expected valid URL" ) ; int colonIndex = url . indexOf ( ":" ) ; String protocol = null ; if ( colonIndex > 0 ) { protocol = url . substring ( 0 , colonIndex ) ; } else { protocol = DEFAULT_PROTOCOL ; } IURLProtocolHandlerFactory factory = mProtocols . get ( protocol ) ; if ( factory != null ) { result = factory . getHandler ( protocol , url , flags ) ; } else { log . error ( "asked to get handler for unsupported protocol: {}" , protocol ) ; } return result ;


signature:
public class URLProtocolManager { /** * Get the resource portion of a url . For example for the URL
 * < pre >
 * http : / / www . humble . io / video
 * < / pre >
 * The protocol string is < code > http < / code > and the resource
 * string is < code > www . humble . io / video < / code >
 * @ param url The url to parse
 * @ return The resource */
public static String getResourceFromURL ( String url ) { } }

implementation:
String retval = url ; if ( url != null && url . length ( ) > 0 ) { int colonIndex ; colonIndex = url . indexOf ( "://" ) ; if ( colonIndex > 0 ) retval = url . substring ( colonIndex + 3 ) ; else { colonIndex = url . indexOf ( ":" ) ; if ( colonIndex > 1 ) // handle windows drive letters .
{ // remove the URL prefix
retval = url . substring ( colonIndex + 1 ) ; } } } return retval ;


signature:
public class URLProtocolManager { /** * Get the protocol portion of a url . For example for the URL
 * < pre >
 * http : / / www . humble . io / video
 * < / pre >
 * The protocol string is < code > http < / code > and the resource
 * string is < code > / / www . humble . io / video < / code >
 * @ param url The url to parse
 * @ return The protocol */
public static String getProtocolFromURL ( String url ) { } }

implementation:
String retval = null ; if ( url != null && url . length ( ) > 0 ) { int colonIndex = url . indexOf ( ":" ) ; if ( colonIndex > 0 ) { // remove the URL suffix
retval = url . substring ( 0 , colonIndex ) ; } } return retval ;


signature:
public class JNIEnv { /** * Get the CPU architecture based on the passed in javaCPUArch specifier .
 * The string should be of a format returned from { @ link System # getProperty ( String ) }
 * for the property " os . arch " .
 * @ param javaCPU the string to parse
 * @ return the CPU architecture
 * @ see System # getProperty ( String ) */
public static CPUArch getCPUArch ( String javaCPU ) { } }

implementation:
final CPUArch javaArch ; final String javaCPUArch = javaCPU != null ? javaCPU . toLowerCase ( ) : "" ; // first parse the java arch
if ( javaCPUArch . startsWith ( "x86_64" ) || javaCPUArch . startsWith ( "amd64" ) || javaCPUArch . startsWith ( "ia64" ) ) { javaArch = CPUArch . X86_64 ; } else if ( javaCPUArch . startsWith ( "ppc64" ) || javaCPUArch . startsWith ( "powerpc64" ) ) { javaArch = CPUArch . PPC64 ; } else if ( javaCPUArch . startsWith ( "ppc" ) || javaCPUArch . startsWith ( "powerpc" ) ) { javaArch = CPUArch . PPC ; } else if ( javaCPUArch . contains ( "86" ) ) { javaArch = CPUArch . X86 ; } else { javaArch = CPUArch . UNKNOWN ; } return javaArch ;


signature:
public class JNIEnv { /** * Return a CPUArch from parsing a GNU autoconf triple .
 * For example " x86_64 - w64 - mingw32 " will return { @ link JNIEnv . CPUArch # X86_64}
 * and " ppc - apple - darwin " will return { @ link JNIEnv . CPUArch # PPC } .
 * @ param gnuString the GNU string
 * @ return the architecture */
public static CPUArch getCPUArchFromGNUString ( String gnuString ) { } }

implementation:
final String nativeCpu = gnuString . toLowerCase ( ) ; final CPUArch nativeArch ; // then the native arch
if ( nativeCpu . startsWith ( "x86_64" ) || nativeCpu . startsWith ( "amd64" ) || nativeCpu . startsWith ( "ia64" ) ) nativeArch = CPUArch . X86_64 ; else if ( nativeCpu . startsWith ( "ppc64" ) || nativeCpu . startsWith ( "powerpc64" ) ) nativeArch = CPUArch . PPC64 ; else if ( nativeCpu . startsWith ( "ppc" ) || nativeCpu . startsWith ( "powerpc" ) ) nativeArch = CPUArch . PPC ; else if ( nativeCpu . contains ( "86" ) ) nativeArch = CPUArch . X86 ; else nativeArch = CPUArch . UNKNOWN ; return nativeArch ;


signature:
public class JNIEnv { /** * Get the OSFamily based on the passed in osName specifier .
 * The string should be of a format returned from { @ link System # getProperty ( String ) }
 * for the property " os . name " .
 * @ param osName the string to parse
 * @ return the OSFamily
 * @ see System # getProperty ( String ) */
public static OSFamily getOSFamily ( String osName ) { } }

implementation: final OSFamily retval ; if ( osName != null && osName . length ( ) > 0 ) { if ( osName . startsWith ( "Windows" ) ) retval = OSFamily . WINDOWS ; else if ( osName . startsWith ( "Mac" ) ) retval = OSFamily . MAC ; else if ( osName . startsWith ( "Linux" ) ) retval = OSFamily . LINUX ; else retval = OSFamily . UNKNOWN ; } else retval = OSFamily . UNKNOWN ; return retval ;


signature:
public class JNIEnv { /** * Return an OS Family from parsing a GNU autoconf triple .
 * For example " x86_64 - w64 - mingw32 " will return { @ link JNIEnv . OSFamily # WINDOWS }
 * and " ppc - apple - darwin " will return { @ link JNIEnv . OSFamily # MAC } .
 * @ param gnuString the GNU string
 * @ return the OSFamily */
public static OSFamily getOSFamilyFromGNUString ( String gnuString ) { } }

implementation: final String nativeOs = ( gnuString != null ? gnuString . toLowerCase ( ) : "" ) ; final OSFamily retval ; if ( nativeOs . startsWith ( "mingw" ) || nativeOs . startsWith ( "cygwin" ) ) retval = OSFamily . WINDOWS ; else if ( nativeOs . startsWith ( "darwin" ) ) retval = OSFamily . MAC ; else if ( nativeOs . startsWith ( "linux" ) ) retval = OSFamily . LINUX ; else retval = OSFamily . UNKNOWN ; return retval ;


signature:
public class Media { /** * Get a string representation of the time stamp for this { @ link
 * Media } . The format of the resulting string is specified by
 * the format parameter . See { @ link java . util . Formatter } for
 * details on how to specify formats , however a good place to start
 * is with the following format : < b > % 1 $ tH : % 1 $ tM : % 1 $ tS . % 1 $ tL < / b >
 * @ param format the format for the time stamp string
 * @ return the printable string form of the timestamp
 * @ see # getFormattedTimeStamp ( )
 * @ see # DEFAULT _ TIME _ STAMP _ FORMAT
 * @ see java . util . Formatter */
public String getFormattedTimeStamp ( String format ) { } }

implementation: String retval = null ; java . util . Formatter formatter = new java . util . Formatter ( ) ; try { Rational timeBase = getTimeBase ( ) ; if ( timeBase == null ) timeBase = Rational . make ( 1 , ( int ) Global . DEFAULT_PTS_PER_SECOND ) ; retval = formatter . format ( format , ( long ) ( getTimeStamp ( ) * timeBase . getDouble ( ) * 1000 ) + TIME_OFFSET ) . toString ( ) ; timeBase . delete ( ) ; } finally { formatter . close ( ) ; } return retval ;


signature:
public class Media { /** * Get the time base that time stamps of this object are represented in . < br >
 * < br >
 * Caller must release the returned value . < br >
 * < br >
 * @ return the time base . */
public Rational getTimeBase ( ) { } }

implementation: long cPtr = VideoJNI . Media_getTimeBase ( swigCPtr , this ) ; return ( cPtr == 0 ) ? null : new Rational ( cPtr , false ) ;


signature:
public class DecodeAndPlayAudio { /** * Opens a file , and plays the audio from it on the speakers .
 * @ param filename The file or URL to play .
 * @ throws LineUnavailableException */
private static void playSound ( String filename ) throws InterruptedException , IOException , LineUnavailableException { } }

implementation:
/* * Start by creating a container object , in this case a demuxer since
 * we are reading , to get audio data from . */
Demuxer demuxer = Demuxer . make ( ) ; /* * Open the demuxer with the filename passed on . */
demuxer . open ( filename , null , false , true , null , null ) ; /* * Query how many streams the call to open found */
int numStreams = demuxer . getNumStreams ( ) ; /* * Iterate through the streams to find the first audio stream */
int audioStreamId = - 1 ; Decoder audioDecoder = null ; for ( int i = 0 ; i < numStreams ; i ++ ) { final DemuxerStream stream = demuxer . getStream ( i ) ; final Decoder decoder = stream . getDecoder ( ) ; if ( decoder != null && decoder . getCodecType ( ) == MediaDescriptor . Type . MEDIA_AUDIO ) { audioStreamId = i ; audioDecoder = decoder ; // stop at the first one .
break ; } } if ( audioStreamId == - 1 ) throw new RuntimeException ( "could not find audio stream in container: " + filename ) ; /* * Now we have found the audio stream in this file . Let ' s open up our decoder so it can
 * do work . */
audioDecoder . open ( null , null ) ; /* * We allocate a set of samples with the same number of channels as the
 * coder tells us is in this buffer . */
final MediaAudio samples = MediaAudio . make ( audioDecoder . getFrameSize ( ) , audioDecoder . getSampleRate ( ) , audioDecoder . getChannels ( ) , audioDecoder . getChannelLayout ( ) , audioDecoder . getSampleFormat ( ) ) ; /* * A converter object we ' ll use to convert Humble Audio to a format that
 * Java Audio can actually play . The details are complicated , but essentially
 * this converts any audio format ( represented in the samples object ) into
 * a default audio format suitable for Java ' s speaker system ( which will
 * be signed 16 - bit audio , stereo ( 2 - channels ) , resampled to 22,050 samples
 * per second ) . */
final MediaAudioConverter converter = MediaAudioConverterFactory . createConverter ( MediaAudioConverterFactory . DEFAULT_JAVA_AUDIO , samples ) ; /* * An AudioFrame is a wrapper for the Java Sound system that abstracts away
 * some stuff . Go read the source code if you want - - it ' s not very complicated . */
final AudioFrame audioFrame = AudioFrame . make ( converter . getJavaFormat ( ) ) ; if ( audioFrame == null ) throw new LineUnavailableException ( ) ; /* We will use this to cache the raw - audio we pass to and from
 * the java sound system . */
ByteBuffer rawAudio = null ; /* * Now , we start walking through the container looking at each packet . This
 * is a decoding loop , and as you work with Humble you ' ll write a lot
 * of these .
 * Notice how in this loop we reuse all of our objects to avoid
 * reallocating them . Each call to Humble resets objects to avoid
 * unnecessary reallocation . */
final MediaPacket packet = MediaPacket . make ( ) ; while ( demuxer . read ( packet ) >= 0 ) { /* * Now we have a packet , let ' s see if it belongs to our audio stream */
if ( packet . getStreamIndex ( ) == audioStreamId ) { /* * A packet can actually contain multiple sets of samples ( or frames of samples
 * in audio - decoding speak ) . So , we may need to call decode audio multiple
 * times at different offsets in the packet ' s data . We capture that here . */
int offset = 0 ; int bytesRead = 0 ; do { bytesRead += audioDecoder . decode ( samples , packet , offset ) ; if ( samples . isComplete ( ) ) { rawAudio = converter . toJavaAudio ( rawAudio , samples ) ; audioFrame . play ( rawAudio ) ; } offset += bytesRead ; } while ( offset < packet . getSize ( ) ) ; } } // Some audio decoders ( especially advanced ones ) will cache
// audio data before they begin decoding , so when you are done you need
// to flush them . The convention to flush Encoders or Decoders in Humble Video
// is to keep passing in null until incomplete samples or packets are returned .
do { audioDecoder . decode ( samples , null , 0 ) ; if ( samples . isComplete ( ) ) { rawAudio = converter . toJavaAudio ( rawAudio , samples ) ; audioFrame . play ( rawAudio ) ; } } while ( samples . isComplete ( ) ) ; // It is good practice to close demuxers when you ' re done to free
// up file handles . Humble will EVENTUALLY detect if nothing else
// references this demuxer and close it then , but get in the habit
// of cleaning up after yourself , and your future girlfriend / boyfriend
// will appreciate it .
demuxer . close ( ) ; // similar with the demuxer , for the audio playback stuff , clean up after yourself .
audioFrame . dispose ( ) ;


signature:
public class DecodeAndPlayAudio { /** * Takes a media container ( file ) as the first argument , opens it ,
 * opens up the default audio device on your system , and plays back the audio .
 * @ param args Must contain one string which represents a filename
 * @ throws IOException
 * @ throws InterruptedException
 * @ throws LineUnavailableException */
public static void main ( String [ ] args ) throws InterruptedException , IOException , LineUnavailableException { } }

implementation:
final Options options = new Options ( ) ; options . addOption ( "h" , "help" , false , "displays help" ) ; options . addOption ( "v" , "version" , false , "version of this library" ) ; final CommandLineParser parser = new org . apache . commons . cli . BasicParser ( ) ; try { final CommandLine cmd = parser . parse ( options , args ) ; if ( cmd . hasOption ( "version" ) ) { // let ' s find what version of the library we ' re running
final String version = io . humble . video_native . Version . getVersionInfo ( ) ; System . out . println ( "Humble Version: " + version ) ; } else if ( cmd . hasOption ( "help" ) || args . length == 0 ) { final HelpFormatter formatter = new HelpFormatter ( ) ; formatter . printHelp ( DecodeAndPlayAudio . class . getCanonicalName ( ) + " <filename>" , options ) ; } else { final String [ ] parsedArgs = cmd . getArgs ( ) ; for ( String arg : parsedArgs ) playSound ( arg ) ; } } catch ( ParseException e ) { System . err . println ( "Exception parsing command line: " + e . getLocalizedMessage ( ) ) ; }


signature:
public class RefCounted { /** * Releases any underlying native memory and marks this object
 * as invalid .
 * Normally Ferry manages when to release native memory .
 * In the unlikely event you want to control EXACTLY when a native
 * object is released , each Humble object has a { @ link # delete ( ) }
 * method that you can use . Once you call { @ link # delete ( ) } ,
 * you must ENSURE your object is never referenced again from
 * that Java object - - Ferry tries to help you avoid crashes if you
 * accidentally use an object after deletion but on this but we
 * cannot offer 100 % protection ( specifically if another thread
 * is accessing that object EXACTLY when you { @ link # delete ( ) } it ) . */
public void delete ( ) { } }

implementation:
if ( swigCPtr != 0 ) { // assigning to an object removes an incorrect java
// compiler warning for some
// generated files
Object object = this ; if ( object instanceof RefCounted && mRefCounter != null ) { mRefCounter . delete ( ) ; } else if ( swigCMemOwn ) { swigCMemOwn = false ; } } mJavaRefCount = null ; mRefCounter = null ; mObjectToForceFinalize = null ; mLifecycleReference = null ; swigCPtr = 0 ;


signature:
public class JNILibraryLoader { /** * @ deprecated Use { @ link JNILibrary } instead .
 * Attempts to find and load the given library , with the given version of the
 * library if version is asked for .
 * First , if we detect that we ' ve already loaded the given library , we ' ll just
 * return rather than attempt a second load ( which will fail on some OSes ) .
 * If we haven ' t already loaded this library , we will search in the path
 * defined by the property java . library . path for the library , creating
 * OS - dependent names , and using version strings . If we can ' t find it in that
 * property , we ' ll search through the OS - dependent shared - library
 * specification environment variable .
 * If we can ' t find a versioned library ( and one was requested ) but can find
 * an unversioned library , we ' ll use the unversioned library . But we will
 * first search all directories for a versioned library under the assumption
 * that if you asked for a version , you care more about meeting that
 * requirement than finding it in the first directory we run across .
 * If all that still fails , we ' ll fall back to the
 * { @ link System # loadLibrary ( String ) } method ( for example , if we cannot guess
 * a libtool - like convention for the OS we ' re on ) .
 * We assume a libtool - like library name for the shared library , but will
 * check for common variants on that name .
 * Hopefully an illustration will make this all clearer . Assume we ' re looking
 * for a library named " foo " with version 1 , this method will search as
 * follows :
 * < table >
 * < tr >
 * < th > OS < / th >
 * < th > Filenames searched for ( in order ) < / th >
 * < th > Directories looked in ( in order ) < / th >
 * < / tr >
 * < tr >
 * < td >
 * On Windows : < / td >
 * < td >
 * < ol >
 * < li > foo - 1 . dll < / li >
 * < li > libfoo - 1 . dll < / li >
 * < li > cygfoo - 1 . dll < / li >
 * < li > foo . dll < / li >
 * < li > libfoo . dll < / li >
 * < li > cygfoo . dll < / li >
 * < / ol >
 * < / td >
 * < td >
 * < ol >
 * < li > Every directory in the java property < b > java . library . path < / b > < / li >
 * < li > Every directory in the environment variable < b > PATH < / b > < / li >
 * < / ol >
 * < / td >
 * < / tr >
 * < tr >
 * < td >
 * On Linux : < / td >
 * < td >
 * < ol >
 * < li > libfoo . so . 1 < / li >
 * < li > libfoo . so < / li >
 * < / ol >
 * < / td >
 * < td >
 * < ol >
 * < li > Every directory in the java property < b > java . library . path < / b > < / li >
 * < li > Every directory in the environment variable < b > LD _ LIBRARY _ PATH < / b > < / li >
 * < / ol >
 * < / td >
 * < / tr >
 * < tr >
 * < td >
 * On Apple OS - X : < / td >
 * < td >
 * < ol >
 * < li > libfoo . 1 . dylib < / li >
 * < li > libfoo . dylib < / li >
 * < / ol >
 * < / td >
 * < td >
 * < ol >
 * < li > Every directory in the java property < b > java . library . path < / b > < / li >
 * < li > Every directory in the environment variable < b > DYLD _ LIBRARY _ PATH < / b > < / li >
 * < / ol >
 * < / td >
 * < / tr >
 * < / table >
 * @ param aLibraryName
 * The name of the library , without any OS - dependent adornments like
 * " lib " , " . so " or " . dll " .
 * @ param aMajorVersion
 * The major version of this library , or null if you want to take any
 * version .
 * @ throws UnsatisfiedLinkError
 * If we cannot find the library after searching in all the
 * aforementioned locations . */
@ Deprecated public static void loadLibrary ( String aLibraryName , Long aMajorVersion ) { } }

implementation: getInstance ( ) . loadLibrary0 ( aLibraryName , aMajorVersion ) ;


signature:
public class JNILibraryLoader { /** * This is the method that actually loads the library . It maintains an object
 * level lock , and since this class only allows a singleton object , that is a
 * class - level lock . That means if you ' re loading a library on one thread ,
 * other threads will block until it finishes .
 * This should be OK in general .
 * @ param aLibraryName
 * The library name .
 * @ param aMajorVersion
 * The version , or null if you don ' t care . */
synchronized void loadLibrary0 ( String aLibraryName , Long aMajorVersion ) { } }

implementation:
if ( alreadyLoadedLibrary ( aLibraryName , aMajorVersion ) ) // our work is done .
return ; List < String > libCandidates = getLibraryCandidates ( aLibraryName , aMajorVersion ) ; if ( libCandidates != null && libCandidates . size ( ) > 0 && ! loadCandidateLibrary ( aLibraryName , aMajorVersion , libCandidates ) ) { // finally , try the System . loadLibrary call
try { System . loadLibrary ( aLibraryName ) ; } catch ( UnsatisfiedLinkError e ) { log . error ( "Could not load library: {}; version: {}." , aLibraryName , aMajorVersion == null ? "" : aMajorVersion ) ; throw e ; } // and if we get here it means we successfully loaded since no
// exception was thrown . Add our library to the cache .
setLoadedLibrary ( aLibraryName , aMajorVersion ) ; } log . trace ( "Successfully Loaded library: {}; Version: {}" , aLibraryName , aMajorVersion ) ;


signature:
public class JNILibraryLoader { /** * Tell the cache that we ' ve loaded this version .
 * @ param aLibraryName
 * @ param aMajorVersion */
void setLoadedLibrary ( String aLibraryName , Long aMajorVersion ) { } }

implementation: Set < Long > foundVersions = mLoadedLibraries . get ( aLibraryName ) ; if ( foundVersions == null ) { foundVersions = new HashSet < Long > ( ) ; mLoadedLibraries . put ( aLibraryName , foundVersions ) ; } foundVersions . add ( aMajorVersion ) ;


signature:
public class JNILibraryLoader { /** * Iterates through the set of aLibCandidates until it succeeds in loading a
 * library . If it succeeds , it lets the cache know .
 * @ param aLibraryName
 * The library name .
 * @ param aMajorVersion
 * The version we want , or null if we don ' t care .
 * @ param aLibCandidates
 * The set of candidates generated by
 * { @ link # getLibraryCandidates ( String , Long ) }
 * @ return true if we succeeded in loading a library ; false otherwise */
boolean loadCandidateLibrary ( String aLibraryName , Long aMajorVersion , List < String > aLibCandidates ) { } }

implementation:
boolean retval = false ; for ( String candidate : aLibCandidates ) { log . trace ( "Attempt: library load of library: {}; version: {}: relative path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , candidate } ) ; File candidateFile = new File ( candidate ) ; if ( candidateFile . exists ( ) ) { String absPath = candidateFile . getAbsolutePath ( ) ; try { log . trace ( "Attempt: library load of library: {}; version: {}: absolute path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath } ) ; // Here ' s where we attempt the actual load .
System . load ( absPath ) ; log . trace ( "Success: library load of library: {}; version: {}: absolute path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath } ) ; // if we got here , we loaded successfully
setLoadedLibrary ( aLibraryName , aMajorVersion ) ; retval = true ; break ; } catch ( UnsatisfiedLinkError e ) { log . warn ( "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath , e } ) ; } catch ( SecurityException e ) { log . warn ( "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath , e } ) ; } } } return retval ;


signature:
public class JNILibraryLoader { /** * For a given library , and the OS we ' re running on , this method generates a
 * list of potential absolute file paths that
 * { @ link # loadCandidateLibrary ( String , Long , String [ ] ) } should attempt ( in
 * order ) to load . This method will not check for existence and readability of
 * the file we ' re attempting to load .
 * @ param aLibraryName
 * The library name
 * @ param aMajorVersion
 * The version , or null if we don ' t care .
 * @ return The set of absolute file paths to try . */
List < String > getLibraryCandidates ( String aLibraryName , Long aMajorVersion ) { } }

implementation:
final List < String > retval = new LinkedList < String > ( ) ; // Note : when done each of these variables must be set to a non - null , non
// empty string array
final String [ ] prefixes ; final String [ ] suffixes ; final String [ ] preSuffixVersions ; final String [ ] postSuffixVersions ; switch ( getOS ( ) ) { case Unknown : case Linux : prefixes = new String [ ] { "lib" , "" } ; suffixes = new String [ ] { ".so" } ; preSuffixVersions = new String [ ] { "" } ; postSuffixVersions = ( aMajorVersion == null ? new String [ ] { "" } : new String [ ] { "." + aMajorVersion . longValue ( ) } ) ; break ; case Windows : prefixes = new String [ ] { "lib" , "" , "cyg" } ; suffixes = new String [ ] { ".dll" } ; preSuffixVersions = ( aMajorVersion == null ? new String [ ] { "" } : new String [ ] { "-" + aMajorVersion . longValue ( ) } ) ; postSuffixVersions = new String [ ] { "" } ; break ; case MacOSX : prefixes = new String [ ] { "lib" , "" } ; suffixes = new String [ ] { ".dylib" } ; preSuffixVersions = ( aMajorVersion == null ? new String [ ] { "" } : new String [ ] { "." + aMajorVersion . longValue ( ) } ) ; postSuffixVersions = new String [ ] { "" } ; break ; default : // really no cases should get here
prefixes = null ; suffixes = null ; preSuffixVersions = null ; postSuffixVersions = null ; break ; } initializeSearchPaths ( ) ; // First check the versioned paths
if ( aMajorVersion != null ) { for ( String directory : mJavaPropPaths ) { generateFileNames ( retval , directory , aLibraryName , prefixes , suffixes , preSuffixVersions , postSuffixVersions , true ) ; } for ( String directory : mJavaEnvPaths ) { generateFileNames ( retval , directory , aLibraryName , prefixes , suffixes , preSuffixVersions , postSuffixVersions , true ) ; } } for ( String directory : mJavaPropPaths ) { generateFileNames ( retval , directory , aLibraryName , prefixes , suffixes , preSuffixVersions , postSuffixVersions , false ) ; } for ( String directory : mJavaEnvPaths ) { generateFileNames ( retval , directory , aLibraryName , prefixes , suffixes , preSuffixVersions , postSuffixVersions , false ) ; } return retval ;


signature:
public class JNILibraryLoader { /** * Initialize the paths we ' ll search for libraries in . */
private void initializeSearchPaths ( ) { } }

implementation: String pathVar = null ; if ( mJavaPropPaths == null ) { pathVar = System . getProperty ( "java.library.path" , "" ) ; log . trace ( "property java.library.path: {}" , pathVar ) ; mJavaPropPaths = getEntitiesFromPath ( pathVar ) ; } if ( mJavaEnvPaths == null ) { String envVar = getSystemRuntimeLibraryPathVar ( ) ; pathVar = System . getenv ( envVar ) ; log . trace ( "OS environment runtime shared library path ({}): {}" , envVar , pathVar ) ; mJavaEnvPaths = getEntitiesFromPath ( pathVar ) ; }


signature:
public class JNILibraryLoader { /** * Checks our cache to see if we ' ve already loaded this library .
 * We will also detect if we ' ve already loaded another version of this
 * library , and log a warning , but otherwise will return false in that case .
 * @ param aLibraryName
 * The library name .
 * @ param aMajorVersion
 * The version , or null if we don ' t care .
 * @ return true if in cache ; false otherwise */
boolean alreadyLoadedLibrary ( String aLibraryName , Long aMajorVersion ) { } }

implementation:
boolean retval = false ; Set < Long > foundVersions = mLoadedLibraries . get ( aLibraryName ) ; if ( foundVersions != null ) { // we found at least some versions
if ( aMajorVersion == null || foundVersions . contains ( aMajorVersion ) ) { retval = true ; } else { log . warn ( "Attempting load of {}, version {}, but already loaded verions: {}." + "  We will attempt to load the specified version but behavior is undefined" , new Object [ ] { aLibraryName , aMajorVersion , foundVersions . toArray ( ) } ) ; } } return retval ;


signature:
public class Decoder { /** * Create a Decoder that will use the given Codec . < br >
 * < br >
 * @ return a Decoder < br >
 * @ throws InvalidArgument if codec is null or codec cannot decode . */
public static Decoder make ( Codec codec ) { } }

implementation: long cPtr = VideoJNI . Decoder_make__SWIG_0 ( Codec . getCPtr ( codec ) , codec ) ; return ( cPtr == 0 ) ? null : new Decoder ( cPtr , false ) ;


signature:
public class Decoder { /** * Creates a Decoder from a given Coder ( either an encoder or a decoder ) . < br >
 * @ return a Decoder < br >
 * @ throws InvalidArgument if src is null */
public static Decoder make ( Coder src ) { } }

implementation: long cPtr = VideoJNI . Decoder_make__SWIG_1 ( Coder . getCPtr ( src ) , src ) ; return ( cPtr == 0 ) ? null : new Decoder ( cPtr , false ) ;


signature:
public class Decoder { /** * Decode this packet into output . It will < br >
 * try to fill up the audio samples object , starting < br >
 * from the byteOffset inside this packet . < br >
 * < p > < br >
 * The caller is responsible for allocating the < br >
 * MediaAudio object . This function will overwrite < br >
 * any data in the samples object . < br >
 * < / p > < br >
 * @ param output The MediaAudio we decode to . Caller must check if it is complete on return . < br >
 * @ param packet The packet we ' re attempting to decode from . < br >
 * @ param byteOffset Where in the packet payload to start decoding < br >
 * < br >
 * @ return number of bytes actually processed from the packet , or negative for error */
public int decodeAudio ( MediaAudio output , MediaPacket packet , int byteOffset ) { } }

implementation: return VideoJNI . Decoder_decodeAudio ( swigCPtr , this , MediaAudio . getCPtr ( output ) , output , MediaPacket . getCPtr ( packet ) , packet , byteOffset ) ;


signature:
public class Decoder { /** * Decode this packet into output . < br >
 * < br >
 * The caller is responsible for allocating the < br >
 * MediaPicture object . This function will potentially < br >
 * overwrite any data in the frame object , but < br >
 * you should pass the same MediaPicture into this function < br >
 * repeatedly until Media . isComplete ( ) is true . < br >
 * < p > < br >
 * Note on memory for MediaPicture : For a multitude of reasons , < br >
 * if you created MediaPicture from a buffer , decodeVideo will discard < br >
 * it and replace it with a buffer that is aligned correctly for different < br >
 * CPUs and different codecs . If you must have a copy of the image data < br >
 * in memory managed by you , then pass in a MediaPicture allocated without < br >
 * a buffer to DecodeVideo , and then copy that into your own media picture . < br >
 * < / p > < br >
 * < br >
 * @ param output The MediaPicture we decode . Caller must check if it is complete on return . < br >
 * @ param packet The packet we ' re attempting to decode from . < br >
 * @ param byteOffset Where in the packet payload to start decoding < br >
 * < br >
 * @ return number of bytes actually processed from the packet , or negative for error */
public int decodeVideo ( MediaPicture output , MediaPacket packet , int byteOffset ) { } }

implementation: return VideoJNI . Decoder_decodeVideo ( swigCPtr , this , MediaPicture . getCPtr ( output ) , output , MediaPacket . getCPtr ( packet ) , packet , byteOffset ) ;


signature:
public class Decoder { /** * Decode this packet into output . It will < br >
 * try to fill up the media object , starting < br >
 * from the byteOffset inside this packet . < br >
 * < p > < br >
 * The caller is responsible for allocating the < br >
 * correct underlying Media object . This function will overwrite < br >
 * any data in the samples object . < br >
 * < / p > < br >
 * @ param output The Media we decode to . Caller must check if it is complete on return . < br >
 * @ param packet The packet we ' re attempting to decode from . < br >
 * @ param byteOffset Where in the packet payload to start decoding < br >
 * < br >
 * @ return number of bytes actually processed from the packet , or negative for error < br >
 * < br >
 * @ throws InvalidArgument if the media type is not compatible with this decoder . < br >
 * @ see decodeVideo < br >
 * @ see decodeAudio */
public int decode ( MediaSampled output , MediaPacket packet , int byteOffset ) { } }

implementation: return VideoJNI . Decoder_decode ( swigCPtr , this , MediaSampled . getCPtr ( output ) , output , MediaPacket . getCPtr ( packet ) , packet , byteOffset ) ;


signature:
public class JNIReference { /** * Explicitly deletes the underlying native storage used by
 * the object this object references . The underlying native
 * object is now no long valid , and attempts to use it could
 * cause unspecified behavior . */
public void delete ( ) { } }

implementation:
// acquire lock for minimum time
final long swigPtr = mSwigCPtr . getAndSet ( 0 ) ; if ( swigPtr != 0 ) { if ( mJavaRefCount . decrementAndGet ( ) == 0 ) { // log . debug ( " deleting : { } ; { } " , this , mSwigCPtr ) ;
FerryJNI . RefCounted_release ( swigPtr , null ) ; } // Free the memory manager we use
mMemAllocator = null ; }


signature:
public class FilterAudioSource { /** * Adds audio to this source . NOTE : If you had audio to a FilterSource < br >
 * be careful with re - using or rewriting the underlying data . Filters will < br >
 * try hard to avoid copying data , so if you change the data out from under < br >
 * them unexpected results can occur . < br >
 * @ param audio the audio to add . Must be non - null and complete . < br >
 * @ throws InvalidArgument if audio is null or audio is not complete . */
public void addAudio ( MediaAudio audio ) { } }

implementation: VideoJNI . FilterAudioSource_addAudio ( swigCPtr , this , MediaAudio . getCPtr ( audio ) , audio ) ;


signature:
public class MediaResampler { /** * Resample in to out based on the resampler parameters . < br >
 * < br >
 * Resamples the in media based on the parameters set when < br >
 * this resampler was constructed . < br >
 * < br >
 * @ param out The media we ' ll resample to . Check < br >
 * MediaSampled # isComplete ( ) after the call . < br >
 * @ param in The media we ' ll resample from . < br >
 * < br >
 * @ throws InvalidArgument if in our out does not match the parameters this < br >
 * resampler was set with . < br >
 * @ throws InvalidArgument if the sub - class of in our out is of an invalid < br >
 * type ( e . g . passsing audio to a picture resampler ) . */
public int resample ( MediaSampled out , MediaSampled in ) { } }

implementation: return VideoJNI . MediaResampler_resample ( swigCPtr , this , MediaSampled . getCPtr ( out ) , out , MediaSampled . getCPtr ( in ) , in ) ;


signature:
public class AudioFormat { /** * Return a sample format corresponding to name , or SAMPLE _ FMT _ NONE < br >
 * on error . */
public static AudioFormat . Type getFormat ( String name ) { } }

implementation: return AudioFormat . Type . swigToEnum ( VideoJNI . AudioFormat_getFormat ( name ) ) ;


signature:
public class AudioFormat { /** * Return the planar & lt ; - & gt ; packed alternative form of the given sample format , or < br >
 * SAMPLE _ FMT _ NONE on error . If the passed sample _ fmt is already in the < br >
 * requested planar / packed format , the format returned is the same as the < br >
 * input . */
public static AudioFormat . Type getAlternateSampleFormat ( AudioFormat . Type sample_fmt , boolean planar ) { } }

implementation: return AudioFormat . Type . swigToEnum ( VideoJNI . AudioFormat_getAlternateSampleFormat ( sample_fmt . swigValue ( ) , planar ) ) ;


signature:
public class AudioFormat { /** * Get the packed alternative form of the given sample format . < br >
 * < br >
 * If the passed sample _ fmt is already in packed format , the format returned is < br >
 * the same as the input . < br >
 * < br >
 * @ return the packed alternative form of the given sample format or < br >
 * AV _ SAMPLE _ FMT _ NONE on error . */
public static AudioFormat . Type getPackedSampleFormat ( AudioFormat . Type sample_fmt ) { } }

implementation: return AudioFormat . Type . swigToEnum ( VideoJNI . AudioFormat_getPackedSampleFormat ( sample_fmt . swigValue ( ) ) ) ;