Package org.mp4parser.muxer.tracks
Class ChangeTimeScaleTrack
- java.lang.Object
-
- org.mp4parser.muxer.tracks.ChangeTimeScaleTrack
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Track
public class ChangeTimeScaleTrack extends Object implements Track
Changes the timescale of a track by wrapping the track.
-
-
Constructor Summary
Constructors Constructor Description ChangeTimeScaleTrack(Track source, long targetTimeScale, long[] syncSamples)Changes the time scale of the source track to the target time scale and makes sure that any rounding errors that may have summed are corrected exactly before the syncSamples.
-
Method Summary
Modifier and Type Method Description voidclose()List<CompositionTimeToSample.Entry>getCompositionTimeEntries()longgetDuration()The duration of the track in track timescale.List<Edit>getEdits()StringgetHandler()StringgetName()A name for identification purposes.List<SampleDependencyTypeBox.Entry>getSampleDependencies()long[]getSampleDurations()Each samples is covers a small time span in a video.List<SampleEntry>getSampleEntries()Map<GroupEntry,long[]>getSampleGroups()List<Sample>getSamples()The list of all samples.SubSampleInformationBoxgetSubsampleInformationBox()long[]getSyncSamples()TrackMetaDatagetTrackMetaData()StringtoString()
-
-
-
Constructor Detail
-
ChangeTimeScaleTrack
public ChangeTimeScaleTrack(Track source, long targetTimeScale, long[] syncSamples)
Changes the time scale of the source track to the target time scale and makes sure that any rounding errors that may have summed are corrected exactly before the syncSamples.- Parameters:
source- the source tracktargetTimeScale- the resulting time scale of this track.syncSamples- at these sync points where rounding error are corrected.
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getSampleEntries
public List<SampleEntry> getSampleEntries()
- Specified by:
getSampleEntriesin interfaceTrack
-
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.- Specified by:
getSampleDurationsin interfaceTrack- Returns:
- an array of ticks
-
getCompositionTimeEntries
public List<CompositionTimeToSample.Entry> getCompositionTimeEntries()
- Specified by:
getCompositionTimeEntriesin interfaceTrack
-
getSyncSamples
public long[] getSyncSamples()
- Specified by:
getSyncSamplesin interfaceTrack
-
getSampleDependencies
public List<SampleDependencyTypeBox.Entry> getSampleDependencies()
- Specified by:
getSampleDependenciesin interfaceTrack
-
getTrackMetaData
public TrackMetaData getTrackMetaData()
- Specified by:
getTrackMetaDatain interfaceTrack
-
getHandler
public String getHandler()
- Specified by:
getHandlerin interfaceTrack
-
getSamples
public List<Sample> getSamples()
Description copied from interface:TrackThe list of all samples.- Specified by:
getSamplesin interfaceTrack- Returns:
- this track's samples
-
getSubsampleInformationBox
public SubSampleInformationBox getSubsampleInformationBox()
- Specified by:
getSubsampleInformationBoxin interfaceTrack
-
getDuration
public long getDuration()
Description copied from interface:TrackThe duration of the track in track timescale. It's the sum of all samples' duration and does NOT include any edits.- Specified by:
getDurationin interfaceTrack- Returns:
- the track's duration
-
getName
public String getName()
Description copied from interface:TrackA name for identification purposes. Might return the underlying filename or network address or any other identifier. For informational/debug only. This is no metadata!
-
getSampleGroups
public Map<GroupEntry,long[]> getSampleGroups()
- Specified by:
getSampleGroupsin interfaceTrack
-
-