Package com.avpkit.core.io
An API for extending AVPKit to read and write from arbitrary data sources.
Here's an architecture diagram for how it works:
And here's a details call flow diagram showing how we move from Java to native code to FFMPEG and back:
AVPKit needs to process raw media file data in order to decode and encode those files. What's worse, is the only input AVPKit can give to FFMPEG is a URL.
By default, AVPKit can read any "file:" URL. In fact if you don't specify a protocol, we will assume "file:". But what happens if you want to read data from an arbitrary source (like FMS, Red5, Wowza, etc)?
That's where this package comes in. Using the IO package you can implement a
IURLProtocolHandler that can respond to FFMPEG
requests to read or write buffers. From there any type of integration is
possible.
Here's an architecture diagram for how it works:
And here's a details call flow diagram showing how we move from Java to native code to FFMPEG and back:
To begin with this class, see
URLProtocolManager and take a look at the
example source code for FileProtocolHandler and
FileProtocolHandlerFactory classes.
-
Interface Summary Interface Description ISizeable IURLProtocolHandler Interface that AVPKit native code calls back to for each URL.IURLProtocolHandlerFactory Used by URLProtocolManager to get a factory for a given protocol.IURLProtocolRegistrar For Internal Use Only. -
Class Summary Class Description AVPKitIO Allows AVPKit to read from and write to many different types of Java I/O objects, plus customIURLProtocolHandlerobjects.DataInputOutputHandler Implementation of URLProtocolHandler that can read fromDataInputobjects or write toDataOutputobjects.FfmpegIO For Internal Use Only.FfmpegIOHandle For Internal Use Only.FileProtocolHandler Implementation of URLProtocolHandler that can read and write files.FileProtocolHandlerFactory Implementation ofIURLProtocolHandlerFactorythat demonstrates how you can have Java act just like FFMPEG's internal "file:" protocol.Helper For Internal Use Only.InputOutputStreamHandler Implementation of URLProtocolHandler that can read fromInputStreamobjects or write toOutputStreamobjects.NullProtocolHandler The NullProtocolHandler implementsIURLProtocolHandler, but discards any data written and always returns 0 for reading.NullProtocolHandlerFactory Returns a new NullProtocolHandler factory.ReadableWritableChannelHandler Implementation of URLProtocolHandler that can read fromReadableByteChannelobjects or write toWritableByteChannelobject.URLProtocolManager This class manages URL protocols that we have handlers for.