net.sf.ffmpeg_java.custom_protocol
Class FileCallbackURLProtocolHandler

java.lang.Object
  extended by net.sf.ffmpeg_java.custom_protocol.FileCallbackURLProtocolHandler
All Implemented Interfaces:
CallbackURLProtocolHandler

public class FileCallbackURLProtocolHandler
extends java.lang.Object
implements CallbackURLProtocolHandler

Implements CallbackURLProtocolHandler by using standard Java file I/O.

Author:
Ken Larson

Field Summary
static boolean TRACE
           
 
Fields inherited from interface net.sf.ffmpeg_java.custom_protocol.CallbackURLProtocolHandler
SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
FileCallbackURLProtocolHandler(java.io.File file)
           
 
Method Summary
 int close(AVFormatLibrary.URLContext h)
           
 int open(AVFormatLibrary.URLContext h, java.lang.String filename, int flags)
          Flags may be a combination of: AVFormatLibrary.URL_RDONLY, AVFormatLibrary.URL_WRONLY, AVFormatLibrary.URL_RDWR.
 int read(AVFormatLibrary.URLContext h, com.sun.jna.Pointer buf, int size)
           
 long seek(AVFormatLibrary.URLContext h, long pos, int whence)
          Implementations need to be very careful about returning -1.
 int write(AVFormatLibrary.URLContext h, com.sun.jna.Pointer buf, int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static final boolean TRACE
See Also:
Constant Field Values
Constructor Detail

FileCallbackURLProtocolHandler

public FileCallbackURLProtocolHandler(java.io.File file)
Method Detail

open

public int open(AVFormatLibrary.URLContext h,
                java.lang.String filename,
                int flags)
Description copied from interface: CallbackURLProtocolHandler
Flags may be a combination of: AVFormatLibrary.URL_RDONLY, AVFormatLibrary.URL_WRONLY, AVFormatLibrary.URL_RDWR.

Specified by:
open in interface CallbackURLProtocolHandler

read

public int read(AVFormatLibrary.URLContext h,
                com.sun.jna.Pointer buf,
                int size)
Specified by:
read in interface CallbackURLProtocolHandler

write

public int write(AVFormatLibrary.URLContext h,
                 com.sun.jna.Pointer buf,
                 int size)
Specified by:
write in interface CallbackURLProtocolHandler

seek

public long seek(AVFormatLibrary.URLContext h,
                 long pos,
                 int whence)
Description copied from interface: CallbackURLProtocolHandler
Implementations need to be very careful about returning -1. Basically, they should support full seek capability, or not at all, because much code in ffmpeg never checks the return value of a seek.

Specified by:
seek in interface CallbackURLProtocolHandler

close

public int close(AVFormatLibrary.URLContext h)
Specified by:
close in interface CallbackURLProtocolHandler