net.sf.ffmpeg_java.custom_protocol
Class CallbackURLProtocolMgr

java.lang.Object
  extended by 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

Field Summary
static java.lang.String URL_PREFIX
           
 
Constructor Summary
CallbackURLProtocolMgr()
           
 
Method Summary
static java.lang.String addCallbackURLProtocolHandler(CallbackURLProtocolHandler h)
           
static AVFormatLibrary.URLProtocol getURLProtocol()
           
static void register(AVFormatLibrary AVFORMAT)
           
static void removeCallbackURLProtocolHandler(CallbackURLProtocolHandler h)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PREFIX

public static final java.lang.String URL_PREFIX
See Also:
Constant Field Values
Constructor Detail

CallbackURLProtocolMgr

public CallbackURLProtocolMgr()
Method Detail

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)