Package org.mp4parser.muxer
Class Mp4TrackImpl
- java.lang.Object
-
- org.mp4parser.muxer.AbstractTrack
-
- org.mp4parser.muxer.Mp4TrackImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Track
- Direct Known Subclasses:
CencMp4TrackImplImpl,PiffMp4TrackImpl
public class Mp4TrackImpl extends AbstractTrack
Represents a single track of an MP4 file.
-
-
Constructor Summary
Constructors Constructor Description Mp4TrackImpl(long trackId, Container isofile, RandomAccessSource randomAccess, String name)Creates a track from a TrackBox and potentially fragments.
-
Method Summary
Modifier and Type Method Description voidclose()List<CompositionTimeToSample.Entry>getCompositionTimeEntries()StringgetHandler()List<SampleDependencyTypeBox.Entry>getSampleDependencies()long[]getSampleDurations()Each samples is covers a small time span in a video.List<SampleEntry>getSampleEntries()List<Sample>getSamples()The list of all samples.SubSampleInformationBoxgetSubsampleInformationBox()long[]getSyncSamples()TrackMetaDatagetTrackMetaData()-
Methods inherited from class org.mp4parser.muxer.AbstractTrack
getDuration, getEdits, getName, getSampleGroups
-
-
-
-
Constructor Detail
-
Mp4TrackImpl
public Mp4TrackImpl(long trackId, Container isofile, RandomAccessSource randomAccess, String name)Creates a track from a TrackBox and potentially fragments. Use fragements parameter only to supply additional fragments that are not located in the main file.- Parameters:
trackId- ID of the track to extractisofile- the parsed MP4 filerandomAccess- the RandomAccessSource to read the samples fromname- an arbitrary naem to identify track later - e.g. filename
-
-
Method Detail
-
close
public void close() throws IOException- Throws:
IOException
-
getSamples
public List<Sample> getSamples()
Description copied from interface:TrackThe list of all samples.- Returns:
- this track's samples
-
getSampleDurations
public long[] getSampleDurations()
Description copied from interface:TrackEach samples is covers a small time span in a video. This method returns the duration for each sample in track timescale. The array must contain exactly as many samples asTrack.getSamples()contains.- Returns:
- an array of ticks
-
getSampleEntries
public List<SampleEntry> getSampleEntries()
-
getCompositionTimeEntries
public List<CompositionTimeToSample.Entry> getCompositionTimeEntries()
- Specified by:
getCompositionTimeEntriesin interfaceTrack- Overrides:
getCompositionTimeEntriesin classAbstractTrack
-
getSyncSamples
public long[] getSyncSamples()
- Specified by:
getSyncSamplesin interfaceTrack- Overrides:
getSyncSamplesin classAbstractTrack
-
getSampleDependencies
public List<SampleDependencyTypeBox.Entry> getSampleDependencies()
- Specified by:
getSampleDependenciesin interfaceTrack- Overrides:
getSampleDependenciesin classAbstractTrack
-
getTrackMetaData
public TrackMetaData getTrackMetaData()
-
getHandler
public String getHandler()
-
getSubsampleInformationBox
public SubSampleInformationBox getSubsampleInformationBox()
- Specified by:
getSubsampleInformationBoxin interfaceTrack- Overrides:
getSubsampleInformationBoxin classAbstractTrack
-
-