Class BaseExtractor

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    AudioExtractor, VideoExtractor

    public abstract class BaseExtractor
    extends java.lang.Object
    implements java.io.Closeable
    Common class for extracting metadata from a file
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected android.media.MediaExtractor mExtractor  
      protected java.lang.String mFilename  
      protected android.media.MediaFormat mMediaFormat  
      protected int mTrackIndex  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaseExtractor​(java.lang.String filename, java.lang.String mimePrefix)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      android.media.MediaFormat getMediaFormat()
      Returns the data format configured for retrieval
      • Methods inherited from class java.lang.Object

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

      • mTrackIndex

        protected final int mTrackIndex
      • mFilename

        protected final java.lang.String mFilename
      • mMediaFormat

        protected final android.media.MediaFormat mMediaFormat
      • mExtractor

        protected android.media.MediaExtractor mExtractor
    • Constructor Detail

      • BaseExtractor

        protected BaseExtractor​(java.lang.String filename,
                                java.lang.String mimePrefix)
                         throws java.io.IOException
        Parameters:
        filename - path to the file
        mimePrefix - configures to retrieve only certain data
        Throws:
        java.io.IOException
    • Method Detail

      • getMediaFormat

        public android.media.MediaFormat getMediaFormat()
        Returns the data format configured for retrieval
      • close

        @CallSuper
        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable