Class CompositeMediaSource<T>

    • Constructor Detail

      • CompositeMediaSource

        protected CompositeMediaSource()
        Creates composite media source without child sources.
    • Method Detail

      • onChildSourceInfoRefreshed

        protected abstract void onChildSourceInfoRefreshed​(T id,
                                                           MediaSource mediaSource,
                                                           Timeline timeline)
        Called when the source info of a child source has been refreshed.
        Parameters:
        id - The unique id used to prepare the child source.
        mediaSource - The child source whose source info has been refreshed.
        timeline - The timeline of the child source.
      • enableChildSource

        protected final void enableChildSource​(T id)
        Enables a child source.
        Parameters:
        id - The unique id used to prepare the child source.
      • disableChildSource

        protected final void disableChildSource​(T id)
        Disables a child source.
        Parameters:
        id - The unique id used to prepare the child source.
      • releaseChildSource

        protected final void releaseChildSource​(T id)
        Releases a child source.
        Parameters:
        id - The unique id used to prepare the child source.
      • getWindowIndexForChildWindowIndex

        protected int getWindowIndexForChildWindowIndex​(T id,
                                                        int windowIndex)
        Returns the window index in the composite source corresponding to the specified window index in a child source. The default implementation does not change the window index.
        Parameters:
        id - The unique id used to prepare the child source.
        windowIndex - A window index of the child source.
        Returns:
        The corresponding window index in the composite source.
      • getMediaTimeForChildMediaTime

        protected long getMediaTimeForChildMediaTime​(T id,
                                                     long mediaTimeMs)
        Returns the media time in the MediaPeriod of the composite source corresponding to the specified media time in the MediaPeriod of the child source. The default implementation does not change the media time.
        Parameters:
        id - The unique id used to prepare the child source.
        mediaTimeMs - A media time in the MediaPeriod of the child source, in milliseconds.
        Returns:
        The corresponding media time in the MediaPeriod of the composite source, in milliseconds.