net.sf.ffmpeg_java.custom_protocol
Class CallbackURLProtocolMgr
java.lang.Object
net.sf.ffmpeg_java.custom_protocol.CallbackURLProtocolMgr
public class CallbackURLProtocolMgr
- extends java.lang.Object
Provides a single ffmpeg URLProtocol, using the prefix callback:, which calls back to Java code to access the data.
A particular handler for a particular stream is set with addCallbackURLProtocolHandler, using a generated URL.
Before using, the CallbackURLProtocolMgr needs to be registered using register.
Then, to register a new stream, and open it with ffmpeg:
final String callbackURL = CallbackURLProtocolMgr.addCallbackURLProtocolHandler(new FileCallbackURLProtocolHandler(new File(filePath)));
final PointerByReference ppFormatCtx = new PointerByReference();
if (AVFORMAT.av_open_input_file(ppFormatCtx, callbackURL, null, 0, null) != 0)
throw new RuntimeException("Couldn't open file"); // Couldn't open file
- Author:
- Ken Larson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URL_PREFIX
public static final java.lang.String URL_PREFIX
- See Also:
- Constant Field Values
CallbackURLProtocolMgr
public CallbackURLProtocolMgr()
getURLProtocol
public static AVFormatLibrary.URLProtocol getURLProtocol()
register
public static void register(AVFormatLibrary AVFORMAT)
addCallbackURLProtocolHandler
public static java.lang.String addCallbackURLProtocolHandler(CallbackURLProtocolHandler h)
removeCallbackURLProtocolHandler
public static void removeCallbackURLProtocolHandler(CallbackURLProtocolHandler h)