Class MediaToolbox


  • public final class MediaToolbox
    extends java.lang.Object
    • Method Detail

      • MTAudioProcessingTapGetTypeID

        public static long MTAudioProcessingTapGetTypeID()
      • MTAudioProcessingTapCreate

        public static int MTAudioProcessingTapCreate​(CFAllocatorRef allocator,
                                                     MTAudioProcessingTapCallbacks callbacks,
                                                     int flags,
                                                     org.moe.natj.general.ptr.Ptr<MTAudioProcessingTapRef> tapOut)
        [@function] MTAudioProcessingTapCreate Create a new processing tap. This function creates a processing tap. The processing tap will then be used to process decoded data. The processing is performed on audio either before or after any effects or other processing (varispeed, etc) is applied by the audio queue.
        Parameters:
        allocator - The allocator to use to allocate memory for the new tap. Pass NULL or kCFAllocatorDefault to use the current default allocator.
        callbacks - Callbacks struct. MTAudioProcessingTap will make a copy of this struct.
        flags - Flags that are used to control aspects of the processing tap. Valid flags are: - kMTAudioProcessingTapCreationFlag_PreEffects: processing is done before any further effects are applied by the audio queue to the audio. - kMTAudioProcessingTapCreationFlag_PostEffects: processing is done after all processing is done, including that of other taps.
        tapOut - The processing tap object.
        Returns:
        An OSStatus result code.
      • MTAudioProcessingTapGetStorage

        public static org.moe.natj.general.ptr.VoidPtr MTAudioProcessingTapGetStorage​(MTAudioProcessingTapRef tap)
        [@function] MTAudioProcessingTapGetStorage Used by a processing tap to retrieve a custom storage pointer.
        Parameters:
        tap - The processing tap.
        Returns:
        The tapStorage returned by the init callback.
      • MTAudioProcessingTapGetSourceAudio

        public static int MTAudioProcessingTapGetSourceAudio​(MTAudioProcessingTapRef tap,
                                                             long numberFrames,
                                                             AudioBufferList bufferListInOut,
                                                             org.moe.natj.general.ptr.IntPtr flagsOut,
                                                             CMTimeRange timeRangeOut,
                                                             org.moe.natj.general.ptr.NIntPtr numberFramesOut)
        [@function] MTAudioProcessingTapGetSourceAudio Used by a processing tap to retrieve source audio. This function may only be called from the processing tap's callback.
        Parameters:
        tap - The processing tap.
        numberFrames - The number of frames the processing tap requires for its processing.
        bufferListInOut - The audio buffer list which will contain the source data. On input, all fields except for the buffer pointers must be filled in. If the buffer pointers are NULL (recommended), non-NULL pointers will be returned and system owns the source buffers; these buffers are only applicable for the duration of the processing tap callback. If the buffer pointers are non-NULL, then they must be big enough to hold numberFrames, and the source data will be copied into these buffers.
        flagsOut - Flags to describe state about the input requested, e.g., discontinuity/complete. Can be NULL.
        timeRangeOut - The asset time range corresponding to the provided source audio frames. Can be NULL.
        numberFramesOut - The number of source frames that have been provided. Can be NULL. This can be less than the number of requested frames specified in numberFrames.
        Returns:
        An OSStatus result code.
      • MTCopyLocalizedNameForMediaType

        public static CFStringRef MTCopyLocalizedNameForMediaType​(int mediaType)
      • MTCopyLocalizedNameForMediaSubType

        public static CFStringRef MTCopyLocalizedNameForMediaSubType​(int mediaType,
                                                                     int mediaSubType)