com.googlecode.mp4parser.authoring.builder
Class SyncSampleIntersectFinderImpl

java.lang.Object
  extended by com.googlecode.mp4parser.authoring.builder.SyncSampleIntersectFinderImpl
All Implemented Interfaces:
FragmentIntersectionFinder

public class SyncSampleIntersectFinderImpl
extends Object
implements FragmentIntersectionFinder

This FragmentIntersectionFinder cuts the input movie video tracks in fragments of the same length exactly before the sync samples. Audio tracks are cut into pieces of similar length.


Constructor Summary
SyncSampleIntersectFinderImpl()
           
SyncSampleIntersectFinderImpl(int minFragmentDurationSeconds)
          Creates a SyncSampleIntersectFinderImpl that will not create any fragment smaller than the given minFragmentDurationSeconds
 
Method Summary
 long[] getCommonIndices(long[] syncSamples, long[] syncSampleTimes, long timeScale, long[]... otherTracksTimes)
           
static List<long[]> getSyncSamplesTimestamps(Movie movie, Track track)
          Calculates the timestamp of all tracks' sync samples.
 long[] sampleNumbers(Track track, Movie movie)
          Gets an array of sample numbers that are meant to be the first sample of each chunk or fragment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncSampleIntersectFinderImpl

public SyncSampleIntersectFinderImpl()

SyncSampleIntersectFinderImpl

public SyncSampleIntersectFinderImpl(int minFragmentDurationSeconds)
Creates a SyncSampleIntersectFinderImpl that will not create any fragment smaller than the given minFragmentDurationSeconds

Parameters:
minFragmentDurationSeconds - the smallest allowable duration of a fragment.
Method Detail

sampleNumbers

public long[] sampleNumbers(Track track,
                            Movie movie)
Gets an array of sample numbers that are meant to be the first sample of each chunk or fragment.

Specified by:
sampleNumbers in interface FragmentIntersectionFinder
Parameters:
track - concerned track
movie - the context of the track
Returns:
an array containing the ordinal of each fragment's first sample

getSyncSamplesTimestamps

public static List<long[]> getSyncSamplesTimestamps(Movie movie,
                                                    Track track)
Calculates the timestamp of all tracks' sync samples.

Parameters:
movie -
track -
Returns:

getCommonIndices

public long[] getCommonIndices(long[] syncSamples,
                               long[] syncSampleTimes,
                               long timeScale,
                               long[]... otherTracksTimes)


Copyright © 2012. All Rights Reserved.