Package limn.video.decode
package limn.video.decode
Decoders, and the pooling every decoder needs. The toolkit's
limn.video publishes what a
picture is and how a source is driven; this is where implementations of that live, so that a codec
dependency has somewhere to land that is not a module everything else depends on.
Install what an application wants and open through the facade:
Videos.installDecoder(new Y4mDecoder());
Videos.installDecoder(new SyntheticVideoDecoder());
try (VideoStreamSource source = Videos.open(file)) {
while (source.readFrame() == VideoStreamSource.Read.FRAME) {
VideoFrame frame = source.frame();
// ... upload it, draw it ...
frame.release();
}
}
The application installs decoders, not the backend. Which decoders exist is an application's decision (it is what it ships and what it is licensed for), and the install order is the probe order, so a backend that installed its own would silently take priority over the application's.
Both decoders here are pure Java with no dependency of any kind, which is why they are the ones that came first: a Y4M file proves the seam against real bytes somebody else's tool wrote, and a synthetic stream proves it against arithmetic, with no codec, no native and no committed media in either direction.
-
ClassDescriptionA fixed set of pictures a decoder fills and hands out, and the free list that takes them back.What a synthetic stream draws.The whole description of a synthetic stream: what it draws, how big, in which layout, under which colour interpretation, how fast, for how long, and how many pictures it keeps in flight.A decoder with nothing to decode: it draws its pictures, so a video is available on any machine, in every layout, under every colour interpretation and at any size, with no file to ship and nothing to go missing.Reads YUV4MPEG2: a text header, then a
FRAMEline and raw planes per picture, with no compression and no container.Writes what a source produces as a YUV4MPEG2 file: the counterpart that makesY4mDecoderverifiable, and the only way to get a real video file out of this project without shipping one.