All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mp4parser.boxes.iso14496.part30.WebVTTSampleEntry Maven / Gradle / Ivy

Go to download

A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)

The newest version!
package org.mp4parser.boxes.iso14496.part30;

import org.mp4parser.BoxParser;
import org.mp4parser.boxes.sampleentry.AbstractSampleEntry;
import org.mp4parser.tools.Path;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;

/**
 * Sample Entry for WebVTT subtitles.
 * 
 * class WVTTSampleEntry() extends PlainTextSampleEntry (‘wvtt’){
 *   WebVTTConfigurationBox config;
 *   WebVTTSourceLabelBox label; // recommended
 *   MPEG4BitRateBox (); // optional
 * }
 * 
*/ public class WebVTTSampleEntry extends AbstractSampleEntry { public static final String TYPE = "wvtt"; public WebVTTSampleEntry() { super(TYPE); } @Override public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException { initContainer(dataSource, contentSize, boxParser); } @Override public void getBox(WritableByteChannel writableByteChannel) throws IOException { writableByteChannel.write(getHeader()); writeContainer(writableByteChannel); } public WebVTTConfigurationBox getConfig() { return Path.getPath(this, "vttC"); } public WebVTTSourceLabelBox getSourceLabel() { return Path.getPath(this, "vlab"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy