Package 

Class TrimDataSource

    • Method Summary

      Modifier and Type Method Description
      boolean isInitialized()
      void deinitialize()
      void initialize()
      long getDurationUs() Returns the video total duration in microseconds.
      long getPositionUs() Returns the current read position, between 0 and duration.
      boolean canReadTrack(@NonNull() TrackType type) Returns true if we can read the given track at this point.
      boolean isDrained() When this source has been totally read, it can return true here tonotify an end of input stream.
      long seekTo(long desiredPositionUs) Moves all selected tracks to the specified presentation time.
      • Methods inherited from class com.otaliastudios.transcoder.source.DataSourceWrapper

        getLocation, getOrientation, getTrackFormat, readTrack, releaseTrack, selectTrack
      • Methods inherited from class com.otaliastudios.transcoder.source.DataSource

        readTrack
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TrimDataSource

        TrimDataSource(DataSource source, long trimStartUs)
      • TrimDataSource

        TrimDataSource(DataSource source, long trimStartUs, long trimEndUs)
    • Method Detail

      • getDurationUs

         long getDurationUs()

        Returns the video total duration in microseconds.

      • getPositionUs

         long getPositionUs()

        Returns the current read position, between 0 and duration.

      • canReadTrack

         boolean canReadTrack(@NonNull() TrackType type)

        Returns true if we can read the given track at this point.If true if returned, source should expect a readTrack call.

        Parameters:
        type - track type
      • isDrained

         boolean isDrained()

        When this source has been totally read, it can return true here tonotify an end of input stream.

      • seekTo

         long seekTo(long desiredPositionUs)

        Moves all selected tracks to the specified presentation time.The timestamp should be between 0 and getDurationUs.The actual timestamp might differ from the desired one because ofseeking constraints (e.g. seek to sync frames). It will typically be smallerbecause we use SEEK_TO_PREVIOUS_SYNC inthe default source.

        Parameters:
        desiredPositionUs - requested timestamp