mediaextension

package
v0.6.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package mediaextension provides Go bindings for the MediaExtension framework.

This framework provides a means for developers to create format readers, video decoders, and RAW processors for media that the system doesn’t natively support.

MediaExtension format readers encapsulate media assets that the system doesn’t natively support so that the system can recognize them. MediaExtension video decoders decode video formats that the system doesn’t natively support. MediaExtension RAW processors work together with video decoders to allow direct control over the RAW decoding process. Developers need to build format readers, video decoders, and RAW processors as [ExtensionKit] bundles and embed them in a host app. Once a user installs and runs the host app, the embedded extensions become available to any app on the user’s system that opts in to using them.

Format readers

Track readers

  • METrackReader: A protocol that defines the information to provide about a track within a media asset.
  • METrackInfo: An object that includes track properties parsed from the media asset.

Sample cursors

  • MESampleCursor: A protocol that defines the information to provide about samples within a track of a media asset, and enables stepping through samples in the track in decode or presentation order.
  • MESampleLocation: An object that provides information about the sample location with the media.
  • MESampleCursorChunk: An object that provides information about the chunk of media at the location of a sample.
  • MEEstimatedSampleLocation: An object that provides information about the estimated sample location with the media.
  • MEHEVCDependencyInfo: An object that provides information about the HEVC dependency attributes of a sample.

Byte sources

  • MEByteSource: Provides read access to the data in a media asset file.

Video decoders

RAW processors

Errors

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// MERAWProcessorReadyForMoreMediaDataDidChangeNotification is a notification that indicates a change to the object’s readiness to process additional media data.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorReadyForMoreMediaDataDidChangeNotification
	MERAWProcessorReadyForMoreMediaDataDidChangeNotification foundation.NSNotificationName
	// MERAWProcessorValuesDidChangeNotification is a notification that indicates a change to the object’s set of available processing parameters.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorValuesDidChangeNotification
	MERAWProcessorValuesDidChangeNotification foundation.NSNotificationName
	// MEVideoDecoderReadyForMoreMediaDataDidChangeNotification is a notification that indicates a change to the decoder’s readiness to process additional media data.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderReadyForMoreMediaDataDidChangeNotification
	MEVideoDecoderReadyForMoreMediaDataDidChangeNotification foundation.NSNotificationName
)
View Source
var (
	// MediaExtensionErrorDomain is the domain of the error.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MediaExtensionErrorDomain
	MediaExtensionErrorDomain foundation.NSErrorDomain
)

Functions

func NewAVMetadataItemArrayErrorBlock

func NewAVMetadataItemArrayErrorBlock(handler AVMetadataItemArrayErrorHandler) (objc.ID, func())

NewAVMetadataItemArrayErrorBlock wraps a Go AVMetadataItemArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewCMSampleBufferRefErrorBlock

func NewCMSampleBufferRefErrorBlock(handler CMSampleBufferRefErrorHandler) (objc.ID, func())

NewCMSampleBufferRefErrorBlock wraps a Go CMSampleBufferRefErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [MESampleCursor.LoadSampleBufferContainingSamplesToEndCursorCompletionHandler]

func NewCVImageBufferRefMEDecodeFrameStatusErrorBlock

func NewCVImageBufferRefMEDecodeFrameStatusErrorBlock(handler CVImageBufferRefMEDecodeFrameStatusErrorHandler) (objc.ID, func())

NewCVImageBufferRefMEDecodeFrameStatusErrorBlock wraps a Go CVImageBufferRefMEDecodeFrameStatusErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewCVPixelBufferRefErrorBlock

func NewCVPixelBufferRefErrorBlock(handler CVPixelBufferRefErrorHandler) (objc.ID, func())

NewCVPixelBufferRefErrorBlock wraps a Go CVPixelBufferRefErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewDataErrorBlock

func NewDataErrorBlock(handler DataErrorHandler) (objc.ID, func())

NewDataErrorBlock wraps a Go DataErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewErrorBlock

func NewErrorBlock(handler ErrorHandler) (objc.ID, func())

NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewFloat32ErrorBlock

func NewFloat32ErrorBlock(handler Float32ErrorHandler) (objc.ID, func())

NewFloat32ErrorBlock wraps a Go Float32ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [METrackReader.LoadEstimatedDataRateWithCompletionHandler]

func NewMEFileInfoErrorBlock

func NewMEFileInfoErrorBlock(handler MEFileInfoErrorHandler) (objc.ID, func())

NewMEFileInfoErrorBlock wraps a Go MEFileInfoErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewMEFormatReaderParseAdditionalFragmentsStatusErrorBlock

func NewMEFormatReaderParseAdditionalFragmentsStatusErrorBlock(handler MEFormatReaderParseAdditionalFragmentsStatusErrorHandler) (objc.ID, func())

NewMEFormatReaderParseAdditionalFragmentsStatusErrorBlock wraps a Go MEFormatReaderParseAdditionalFragmentsStatusErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [MEFormatReader.ParseAdditionalFragmentsWithCompletionHandler]

func NewMETrackInfoErrorBlock

func NewMETrackInfoErrorBlock(handler METrackInfoErrorHandler) (objc.ID, func())

NewMETrackInfoErrorBlock wraps a Go METrackInfoErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func Newint64_tErrorBlock

func Newint64_tErrorBlock(handler int64_tErrorHandler) (objc.ID, func())

Newint64_tErrorBlock wraps a Go [int64_tErrorHandler] as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

Types

type AVMetadataItemArrayErrorHandler

type AVMetadataItemArrayErrorHandler = func(*[]avfoundation.AVMetadataItem, error)

AVMetadataItemArrayErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type CMSampleBufferRefErrorHandler

type CMSampleBufferRefErrorHandler = func(coremedia.CMSampleBufferRef, error)

CMSampleBufferRefErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [MESampleCursor.LoadSampleBufferContainingSamplesToEndCursorCompletionHandler]

type CMTimeBoolErrorHandler

type CMTimeBoolErrorHandler = func(bool, error)

CMTimeBoolErrorHandler handles The completion block to execute when the move operation finishes.

Used by:

  • [MESampleCursor.StepByDecodeTimeCompletionHandler]
  • [MESampleCursor.StepByPresentationTimeCompletionHandler]

type CMTimeErrorHandler

type CMTimeErrorHandler = func(error)

CMTimeErrorHandler handles The completion block to execute when the load operation finishes.

Used by:

  • [METrackReader.LoadUneditedDurationWithCompletionHandler]

type CVImageBufferRefMEDecodeFrameStatusErrorHandler

type CVImageBufferRefMEDecodeFrameStatusErrorHandler = func(corevideo.CVImageBufferRef, MEDecodeFrameStatus, error)

CVImageBufferRefMEDecodeFrameStatusErrorHandler handles The completion block to execute when the decode operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type CVPixelBufferRefErrorHandler

type CVPixelBufferRefErrorHandler = func(corevideo.CVImageBufferRef, error)

CVPixelBufferRefErrorHandler handles The handler is invoked when a frame processes and is ready to be sent back to the caller. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type DataErrorHandler

type DataErrorHandler = func(*foundation.NSData, error)

DataErrorHandler handles The completion block to execute when the read operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type ErrorHandler

type ErrorHandler = func(error)

ErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type Float32ErrorHandler

type Float32ErrorHandler = func(float32, error)

Float32ErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [METrackReader.LoadEstimatedDataRateWithCompletionHandler]

type IMEByteSource

type IMEByteSource interface {
	objectivec.IObject

	// The name of the file for the byte source.
	FileName() string
	// The length of the byte source file.
	FileLength() int64
	// The format of the byte source file.
	ContentType() uniformtypeidentifiers.UTType
	// An array of related file names in the parent directory of the byte source file.
	RelatedFileNamesInSameDirectory() []string

	// Gets the number of available bytes from the offset within the byte source.
	AvailableLengthAtOffset(offset int64) int64
	// Creates a new byte source for a related file.
	ByteSourceForRelatedFileNameError(fileName string) (IMEByteSource, error)
	// Reads bytes from a byte source into a data object.
	ReadDataOfLengthFromOffsetCompletionHandler(length uintptr, offset int64, completionHandler DataErrorHandler)
}

An interface definition for the MEByteSource class.

Inspecting a byte source

Performing operations on a byte source

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource

type IMEDecodeFrameOptions

type IMEDecodeFrameOptions interface {
	objectivec.IObject

	// A Boolean value that hints to the decoder whether or not it should emit an image buffer for the frame.
	DoNotOutputFrame() bool
	SetDoNotOutputFrame(value bool)
	// A Boolean value that hints to the decoder to use a low-power mode that can’t decode faster than 1x real-time.
	RealTimePlayback() bool
	SetRealTimePlayback(value bool)
}

An interface definition for the MEDecodeFrameOptions class.

Inspecting frame decoding options

See: https://developer.apple.com/documentation/MediaExtension/MEDecodeFrameOptions

type IMEEstimatedSampleLocation

type IMEEstimatedSampleLocation interface {
	objectivec.IObject

	// Creates an estimated sample location object with the byte source, sample location, and data location that you specify.
	InitWithByteSourceEstimatedSampleLocationRefinementDataLocation(byteSource IMEByteSource, estimatedSampleLocation avfoundation.AVSampleCursorStorageRange, refinementDataLocation avfoundation.AVSampleCursorStorageRange) MEEstimatedSampleLocation

	// The byte source to use to read the data for the sample.
	ByteSource() IMEByteSource
	// The estimated starting file offset and size in bytes of the sample.
	EstimatedSampleLocation() avfoundation.AVSampleCursorStorageRange
	// The starting file offset and size in bytes of the data necessary to provide an accurate sample location.
	RefinementDataLocation() avfoundation.AVSampleCursorStorageRange
}

An interface definition for the MEEstimatedSampleLocation class.

Creating an estimated sample location

Inspecting an estimated sample location

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation

type IMEFileInfo

type IMEFileInfo interface {
	objectivec.IObject

	// The duration of the media asset, if available.
	Duration() coremedia.CMTime
	SetDuration(value coremedia.CMTime)
	// Indicates if the media asset contains fragments or is extendable by fragments.
	FragmentsStatus() MEFileInfoFragmentsStatus
	SetFragmentsStatus(value MEFileInfoFragmentsStatus)

	SidecarFileName() string
	SetSidecarFileName(value string)
}

An interface definition for the MEFileInfo class.

Inspecting file properties

Instance Properties

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo

type IMEFormatReaderInstantiationOptions

type IMEFormatReaderInstantiationOptions interface {
	objectivec.IObject

	// Enables support for parsing additional fragments.
	AllowIncrementalFragmentParsing() bool
}

An interface definition for the MEFormatReaderInstantiationOptions class.

Inspecting format reader extension options

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderInstantiationOptions

type IMEHEVCDependencyInfo

type IMEHEVCDependencyInfo interface {
	objectivec.IObject

	// A Boolean value that indicates if the sample has an HEVC temporal sublayer access (TSA) picture.
	TemporalSubLayerAccess() bool
	SetTemporalSubLayerAccess(value bool)
	// A Boolean value that indicates if the sample has an HEVC stepwise temporal sublayer access (STSA) picture.
	StepwiseTemporalSubLayerAccess() bool
	SetStepwiseTemporalSubLayerAccess(value bool)
	// The NAL unit type for HEVC sync sample groups.
	SyncSampleNALUnitType() int16
	SetSyncSampleNALUnitType(value int16)
	// The HEVC temporal level, if available.
	TemporalLevel() int16
	SetTemporalLevel(value int16)
	// The HEVC profile space, if available.
	ProfileSpace() int16
	SetProfileSpace(value int16)
	// The HEVC tier level flag, if available.
	TierFlag() int16
	SetTierFlag(value int16)
	// The HEVC profile index, if available.
	ProfileIndex() int16
	SetProfileIndex(value int16)
	// The HEVC profile compatibility flags (4 bytes), if available.
	ProfileCompatibilityFlags() foundation.NSData
	SetProfileCompatibilityFlags(value foundation.NSData)
	// The HEVC constraint indicator flags (6 bytes), if available.
	ConstraintIndicatorFlags() foundation.NSData
	SetConstraintIndicatorFlags(value foundation.NSData)
	// The HEVC level index, if available.
	LevelIndex() int16
	SetLevelIndex(value int16)
}

An interface definition for the MEHEVCDependencyInfo class.

Inspecting the HEVC dependency attributes of a sample

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo

type IMERAWProcessingBooleanParameter

type IMERAWProcessingBooleanParameter interface {
	IMERAWProcessingParameter

	// Get or set the current value for this parameter.
	CurrentValue() bool
	SetCurrentValue(value bool)
	// The initial value for this parameter as defined in the sequence metadata.
	InitialValue() bool
}

An interface definition for the MERAWProcessingBooleanParameter class.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Boolean

type IMERAWProcessingFloatParameter

type IMERAWProcessingFloatParameter interface {
	IMERAWProcessingParameter

	// Get or set the current value for this parameter.
	CurrentValue() float32
	SetCurrentValue(value float32)
	// The initial value for this parameter as defined in the sequence metadata.
	InitialValue() float32
	// The maximum value for this parameter.
	MaximumValue() float32
	// The minimum value for this parameter.
	MinimumValue() float32
}

An interface definition for the MERAWProcessingFloatParameter class.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint

type IMERAWProcessingIntegerParameter

type IMERAWProcessingIntegerParameter interface {
	IMERAWProcessingParameter

	// Get or set the current value for this parameter.
	CurrentValue() int
	SetCurrentValue(value int)
	// The initial value for this parameter as defined in the sequence metadata.
	InitialValue() int
	// The maximum value for this parameter.
	MaximumValue() int
	// The minimum value for this parameter.
	MinimumValue() int
}

An interface definition for the MERAWProcessingIntegerParameter class.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer

type IMERAWProcessingListElementParameter

type IMERAWProcessingListElementParameter interface {
	IMERAWProcessingParameter

	// Creates a list element parameter object with the element id value.
	InitWithNameDescriptionElementID(name string, description string, elementID int) MERAWProcessingListElementParameter

	// A unique number in the list which represents this list option.
	ListElementID() int
}

An interface definition for the MERAWProcessingListElementParameter class.

Creating a list element parameter object

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/ListElement

type IMERAWProcessingListParameter

type IMERAWProcessingListParameter interface {
	IMERAWProcessingParameter

	// Get or set the current value for this parameter.
	CurrentValue() int
	SetCurrentValue(value int)
	// The initial value for this parameter as defined in the sequence metadata.
	InitialValue() int
	// The ordered array of [MERAWProcessingListElementParameter] which make up this list.
	ListElements() []MERAWProcessingListElementParameter
}

An interface definition for the MERAWProcessingListParameter class.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/List

type IMERAWProcessingParameter

type IMERAWProcessingParameter interface {
	objectivec.IObject

	// A Boolean value that indicates whether the extension enables the parameter.
	Enabled() bool
	SetEnabled(value bool)
	// A unique key string identifying the parameter.
	Key() string
	// A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.
	LongDescription() string
	// A localized human-readable name for the parameter, suitable for displaying in application UI.
	Name() string
}

An interface definition for the MERAWProcessingParameter class.

Inspecting a processing parameter

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter

type IMERAWProcessingSubGroupParameter

type IMERAWProcessingSubGroupParameter interface {
	IMERAWProcessingParameter

	// Creates a sub group parameter object with the parameters value.
	InitWithNameDescriptionParameters(name string, description string, parameters []MERAWProcessingParameter) MERAWProcessingSubGroupParameter

	// The array of [MERAWProcessingParameter](<https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter>) objects in the sub group.
	SubGroupParameters() []MERAWProcessingParameter
}

An interface definition for the MERAWProcessingSubGroupParameter class.

Creating a sub group parameter object

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/SubGroup

type IMERAWProcessorPixelBufferManager

type IMERAWProcessorPixelBufferManager interface {
	objectivec.IObject

	// A dictionary that contains the attributes Video Toolbox uses to create a pixel buffer for the video RAW processor.
	PixelBufferAttributes() foundation.INSDictionary
	SetPixelBufferAttributes(value foundation.INSDictionary)
	// Generates a pixel buffer using the session’s pixel buffer pool.
	CreatePixelBufferAndReturnError() (corevideo.CVImageBufferRef, error)
}

An interface definition for the MERAWProcessorPixelBufferManager class.

Creating a pixel buffer

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorPixelBufferManager

type IMESampleCursorChunk

type IMESampleCursorChunk interface {
	objectivec.IObject

	// Creates a new sample cursor chunk with byte source and chunk data that you provide.
	InitWithByteSourceChunkStorageRangeChunkInfoSampleIndexWithinChunk(byteSource IMEByteSource, chunkStorageRange avfoundation.AVSampleCursorStorageRange, chunkInfo avfoundation.AVSampleCursorChunkInfo, sampleIndexWithinChunk corefoundation.CFIndex) MESampleCursorChunk

	// The byte source to use to read the data for the sample.
	ByteSource() IMEByteSource
	// The offset location and length of the sample’s chunk within the byte source.
	ChunkStorageRange() avfoundation.AVSampleCursorStorageRange
	// An object that provides details about the chunk in the media.
	ChunkInfo() avfoundation.AVSampleCursorChunkInfo
	// The offset index of the sample within the chunk, in samples.
	SampleIndexWithinChunk() corefoundation.CFIndex
}

An interface definition for the MESampleCursorChunk class.

Creating a sample cursor chunk

Inspecting a chunk

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk

type IMESampleLocation

type IMESampleLocation interface {
	objectivec.IObject

	// Creates a sample location object with the byte source and sample location that you specify.
	InitWithByteSourceSampleLocation(byteSource IMEByteSource, sampleLocation avfoundation.AVSampleCursorStorageRange) MESampleLocation

	// The byte source to use to read the data for the sample.
	ByteSource() IMEByteSource
	// The starting file offset and size in bytes of the sample.
	SampleLocation() avfoundation.AVSampleCursorStorageRange
}

An interface definition for the MESampleLocation class.

Creating a sample location

Inspecting a sample location

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation

type IMETrackInfo

type IMETrackInfo interface {
	objectivec.IObject

	// The media type of the track.
	MediaType() coremedia.CMMediaType
	// An integer that identifies the track within the media asset.
	TrackID() coremedia.CMPersistentTrackID
	// A Boolean value that indicates whether the track is enabled by default.
	IsEnabled() bool
	SetEnabled(value bool)
	// The natural timescale of the track.
	NaturalTimescale() coremedia.CMTimeScale
	SetNaturalTimescale(value coremedia.CMTimeScale)
	// A string that indicates the language tag associated with the track, as an IETF BCP 47 (RFC 4646) language identifier.
	ExtendedLanguageTag() string
	SetExtendedLanguageTag(value string)
	// Indicates the natural dimensions of the media data referenced by the track.
	NaturalSize() corefoundation.CGSize
	SetNaturalSize(value corefoundation.CGSize)
	// Indicates the preferred affine display transform of the track media for visual display.
	PreferredTransform() corefoundation.CGAffineTransform
	SetPreferredTransform(value corefoundation.CGAffineTransform)
	// The frame rate of the track in frames per second, as a 32-bit floating point number.
	NominalFrameRate() float32
	SetNominalFrameRate(value float32)
	// A Boolean value that indicates whether frame reordering occurs in the track.
	RequiresFrameReordering() bool
	SetRequiresFrameReordering(value bool)
}

An interface definition for the METrackInfo class.

Inspecting track information

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo

type IMEVideoDecoderPixelBufferManager

type IMEVideoDecoderPixelBufferManager interface {
	objectivec.IObject

	// A dictionary that contains the attributes Video Toolbox uses to create a pixel buffer for the decoder.
	PixelBufferAttributes() foundation.INSDictionary
	SetPixelBufferAttributes(value foundation.INSDictionary)
	// Generates a pixel buffer using the session’s pixel buffer pool.
	CreatePixelBufferAndReturnError() (corevideo.CVImageBufferRef, error)

	RegisterCustomPixelFormat(customPixelFormat foundation.INSDictionary)
}

An interface definition for the MEVideoDecoderPixelBufferManager class.

Creating a pixel buffer

Registering Custom Pixel Formats

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderPixelBufferManager

type MEByteSource

type MEByteSource struct {
	objectivec.Object
}

Provides read access to the data in a media asset file.

Overview

Media Toolbox passes an MEByteSource instance for the media asset’s primary file when it initializes an MEFormatReader object. The format reader may call MEByteSource.ByteSourceForRelatedFileNameError to request additional byte sources for related files in the same directory as the primary file.

Inspecting a byte source

Performing operations on a byte source

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource

func MEByteSourceFromID

func MEByteSourceFromID(id objc.ID) MEByteSource

MEByteSourceFromID constructs a MEByteSource from an objc.ID.

Provides read access to the data in a media asset file.

func NewMEByteSource

func NewMEByteSource() MEByteSource

NewMEByteSource creates a new MEByteSource instance.

func (MEByteSource) Autorelease

func (m MEByteSource) Autorelease() MEByteSource

Autorelease adds the receiver to the current autorelease pool.

func (MEByteSource) AvailableLengthAtOffset

func (m MEByteSource) AvailableLengthAtOffset(offset int64) int64

Gets the number of available bytes from the offset within the byte source.

offset: The offset in bytes from the beginning of the byte source.

Return Value

An integer that specifies the number of available bytes.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/availableLength(at:)

func (MEByteSource) ByteSourceForRelatedFileNameError

func (m MEByteSource) ByteSourceForRelatedFileNameError(fileName string) (IMEByteSource, error)

Creates a new byte source for a related file.

fileName: The related file name that exists in the byte source’s parent directory.

Return Value

A byte source.

Discussion

Requests creation of a new MEByteSource for a file related to the receiving MEByteSource. Only file names returned by the MEByteSource.RelatedFileNamesInSameDirectory method may be accessed.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/byteSourceForRelatedFileName(_:)

func (MEByteSource) ContentType

func (m MEByteSource) ContentType() uniformtypeidentifiers.UTType

The format of the byte source file.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/contentType

func (MEByteSource) FileLength

func (m MEByteSource) FileLength() int64

The length of the byte source file.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/fileLength

func (MEByteSource) FileName

func (m MEByteSource) FileName() string

The name of the file for the byte source.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/fileName

func (MEByteSource) Init

func (m MEByteSource) Init() MEByteSource

Init initializes the instance.

func (MEByteSource) ReadDataOfLengthFromOffset

func (m MEByteSource) ReadDataOfLengthFromOffset(ctx context.Context, length uintptr, offset int64) (*foundation.NSData, error)

ReadDataOfLengthFromOffset is a synchronous wrapper around MEByteSource.ReadDataOfLengthFromOffsetCompletionHandler. It blocks until the completion handler fires or the context is cancelled.

func (MEByteSource) ReadDataOfLengthFromOffsetCompletionHandler

func (m MEByteSource) ReadDataOfLengthFromOffsetCompletionHandler(length uintptr, offset int64, completionHandler DataErrorHandler)

Reads bytes from a byte source into a data object.

length: The number of bytes to read.

offset: The relative offset in bytes from the beginning of the file from which to start reading.

completionHandler: The completion block to execute when the read operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/read(length:from:completionHandler:)

func (MEByteSource) RelatedFileNamesInSameDirectory

func (m MEByteSource) RelatedFileNamesInSameDirectory() []string

An array of related file names in the parent directory of the byte source file.

Discussion

The array of related files within the MEByteSource’s parent directory that are accessible to the MEByteSource. Only the relative file names are returned, not the paths. Only files with file extensions listed in the kMEFormatReaderFileNameExtensionArrayKey array in the format reader property list will be returned. If no related files are available, returns an empty array.

See: https://developer.apple.com/documentation/MediaExtension/MEByteSource/relatedFileNamesInSameDirectory

type MEByteSourceClass

type MEByteSourceClass struct {
	// contains filtered or unexported fields
}

func GetMEByteSourceClass

func GetMEByteSourceClass() MEByteSourceClass

GetMEByteSourceClass returns the class object for MEByteSource.

func (MEByteSourceClass) Alloc

func (mc MEByteSourceClass) Alloc() MEByteSource

Alloc allocates memory for a new instance of the class.

func (MEByteSourceClass) Class

func (mc MEByteSourceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type MEDecodeFrameOptions

type MEDecodeFrameOptions struct {
	objectivec.Object
}

An object that guides the video decoder operation on a per-frame basis.

Inspecting frame decoding options

See: https://developer.apple.com/documentation/MediaExtension/MEDecodeFrameOptions

func MEDecodeFrameOptionsFromID

func MEDecodeFrameOptionsFromID(id objc.ID) MEDecodeFrameOptions

MEDecodeFrameOptionsFromID constructs a MEDecodeFrameOptions from an objc.ID.

An object that guides the video decoder operation on a per-frame basis.

func NewMEDecodeFrameOptions

func NewMEDecodeFrameOptions() MEDecodeFrameOptions

NewMEDecodeFrameOptions creates a new MEDecodeFrameOptions instance.

func (MEDecodeFrameOptions) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MEDecodeFrameOptions) DoNotOutputFrame

func (m MEDecodeFrameOptions) DoNotOutputFrame() bool

A Boolean value that hints to the decoder whether or not it should emit an image buffer for the frame.

Discussion

If true, the decoder emits nil instead of a CVImageBuffer instance.

See: https://developer.apple.com/documentation/MediaExtension/MEDecodeFrameOptions/doNotOutputFrame

func (MEDecodeFrameOptions) Init

Init initializes the instance.

func (MEDecodeFrameOptions) RealTimePlayback

func (m MEDecodeFrameOptions) RealTimePlayback() bool

A Boolean value that hints to the decoder to use a low-power mode that can’t decode faster than 1x real-time.

Discussion

The system sets this value to false during all uses other than 1x forward real-time playback, including seeking, playback at other rates, and export.

This hint only applies to the current decode session. If multiple instances of a decoder operate at the same time, it may not be acceptable to use a low-power mode if the system can’t sustain real-time playback across all the streams.

See: https://developer.apple.com/documentation/MediaExtension/MEDecodeFrameOptions/realTimePlayback

func (MEDecodeFrameOptions) SetDoNotOutputFrame

func (m MEDecodeFrameOptions) SetDoNotOutputFrame(value bool)

func (MEDecodeFrameOptions) SetRealTimePlayback

func (m MEDecodeFrameOptions) SetRealTimePlayback(value bool)

type MEDecodeFrameOptionsClass

type MEDecodeFrameOptionsClass struct {
	// contains filtered or unexported fields
}

func GetMEDecodeFrameOptionsClass

func GetMEDecodeFrameOptionsClass() MEDecodeFrameOptionsClass

GetMEDecodeFrameOptionsClass returns the class object for MEDecodeFrameOptions.

func (MEDecodeFrameOptionsClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MEDecodeFrameOptionsClass) Class

Class returns the underlying Objective-C class pointer.

type MEDecodeFrameStatus

type MEDecodeFrameStatus uint

See: https://developer.apple.com/documentation/MediaExtension/MEDecodeFrameStatus

const (
	// MEDecodeFrameFrameDropped: A frame decode operation status that indicates the system dropped the output of the frame for a reason other than an error.
	MEDecodeFrameFrameDropped MEDecodeFrameStatus = 1
	MEDecodeFrameNoStatus     MEDecodeFrameStatus = 0
)

func (MEDecodeFrameStatus) String

func (e MEDecodeFrameStatus) String() string

type MEError

type MEError int

See: https://developer.apple.com/documentation/MediaExtension/MEError-swift.struct/Code

const (
	// MEErrorAllocationFailure: An error code that indicates the extension can’t allocate memory.
	MEErrorAllocationFailure MEError = -19321
	// MEErrorEndOfStream: An error code that indicates the extension reached the end of the source file.
	MEErrorEndOfStream MEError = -19329
	// MEErrorInternalFailure: An error code that indicates the extension encountered an internal operation failure, such as code loading.
	MEErrorInternalFailure MEError = -19324
	// MEErrorInvalidParameter: An error code that indicates the extension received an invalid parameter.
	MEErrorInvalidParameter MEError = -19322
	// MEErrorLocationNotAvailable: An error code that indicates specific sample isn’t contiguous, spans more than one file, or is for some other reason unsuitable for reading directly from a file.
	MEErrorLocationNotAvailable MEError = -19328
	// MEErrorNoSamples: An error code that indicates there are no samples in the track or a request to load a sample buffer fails.
	MEErrorNoSamples MEError = -19327
	// MEErrorNoSuchEdit: An error code that indicates the plug-in track reader received a request to return an edit that’s out of range.
	MEErrorNoSuchEdit MEError = -19326
	// MEErrorParsingFailure: An error code that indicates the extension encountered an error while parsing the media.
	MEErrorParsingFailure MEError = -19323
	// MEErrorPermissionDenied: An error code that indicates the extension received a request to perform an invalid operation on a byte source.
	MEErrorPermissionDenied MEError = -19330
	// MEErrorPropertyNotSupported: An error code that indicates the extension encountered a property it doesn’t support reading and writing to.
	MEErrorPropertyNotSupported MEError = -19325
	// MEErrorReferenceMissing: An error code that indicates the decoder received a request to decode a sample without decoding the required reference frame dependencies first.
	MEErrorReferenceMissing MEError = -19331
	// MEErrorUnsupportedFeature: An error code that indicates the extension doesn’t support an aspect of the media.
	MEErrorUnsupportedFeature MEError = -19320
)

func (MEError) String

func (e MEError) String() string

type MEEstimatedSampleLocation

type MEEstimatedSampleLocation struct {
	objectivec.Object
}

An object that provides information about the estimated sample location with the media.

Creating an estimated sample location

Inspecting an estimated sample location

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation

func MEEstimatedSampleLocationFromID

func MEEstimatedSampleLocationFromID(id objc.ID) MEEstimatedSampleLocation

MEEstimatedSampleLocationFromID constructs a MEEstimatedSampleLocation from an objc.ID.

An object that provides information about the estimated sample location with the media.

func NewMEEstimatedSampleLocation

func NewMEEstimatedSampleLocation() MEEstimatedSampleLocation

NewMEEstimatedSampleLocation creates a new MEEstimatedSampleLocation instance.

func NewMEEstimatedSampleLocationWithByteSourceEstimatedSampleLocationRefinementDataLocation

func NewMEEstimatedSampleLocationWithByteSourceEstimatedSampleLocationRefinementDataLocation(byteSource IMEByteSource, estimatedSampleLocation avfoundation.AVSampleCursorStorageRange, refinementDataLocation avfoundation.AVSampleCursorStorageRange) MEEstimatedSampleLocation

Creates an estimated sample location object with the byte source, sample location, and data location that you specify.

byteSource: The byte source to use to read the data for the sample.

estimatedSampleLocation: The estimated starting file offset and size in bytes of the sample.

refinementDataLocation: The starting file offset and size in bytes of the data necessary to provide an accurate sample location.

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation/init(byteSource:estimatedSampleLocation:refinementDataLocation:)

func (MEEstimatedSampleLocation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MEEstimatedSampleLocation) ByteSource

The byte source to use to read the data for the sample.

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation/byteSource

func (MEEstimatedSampleLocation) EstimatedSampleLocation

The estimated starting file offset and size in bytes of the sample.

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation/estimatedSampleLocation

func (MEEstimatedSampleLocation) Init

Init initializes the instance.

func (MEEstimatedSampleLocation) InitWithByteSourceEstimatedSampleLocationRefinementDataLocation

func (m MEEstimatedSampleLocation) InitWithByteSourceEstimatedSampleLocationRefinementDataLocation(byteSource IMEByteSource, estimatedSampleLocation avfoundation.AVSampleCursorStorageRange, refinementDataLocation avfoundation.AVSampleCursorStorageRange) MEEstimatedSampleLocation

Creates an estimated sample location object with the byte source, sample location, and data location that you specify.

byteSource: The byte source to use to read the data for the sample.

estimatedSampleLocation: The estimated starting file offset and size in bytes of the sample.

refinementDataLocation: The starting file offset and size in bytes of the data necessary to provide an accurate sample location.

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation/init(byteSource:estimatedSampleLocation:refinementDataLocation:)

func (MEEstimatedSampleLocation) RefinementDataLocation

The starting file offset and size in bytes of the data necessary to provide an accurate sample location.

Discussion

Pass this refinement data to the [RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError] to determine the exact sample location.

See: https://developer.apple.com/documentation/MediaExtension/MEEstimatedSampleLocation/refinementDataLocation

type MEEstimatedSampleLocationClass

type MEEstimatedSampleLocationClass struct {
	// contains filtered or unexported fields
}

func GetMEEstimatedSampleLocationClass

func GetMEEstimatedSampleLocationClass() MEEstimatedSampleLocationClass

GetMEEstimatedSampleLocationClass returns the class object for MEEstimatedSampleLocation.

func (MEEstimatedSampleLocationClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MEEstimatedSampleLocationClass) Class

Class returns the underlying Objective-C class pointer.

type MEFileInfo

type MEFileInfo struct {
	objectivec.Object
}

An object that contains file properties from the media asset.

Inspecting file properties

Instance Properties

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo

func MEFileInfoFromID

func MEFileInfoFromID(id objc.ID) MEFileInfo

MEFileInfoFromID constructs a MEFileInfo from an objc.ID.

An object that contains file properties from the media asset.

func NewMEFileInfo

func NewMEFileInfo() MEFileInfo

NewMEFileInfo creates a new MEFileInfo instance.

func (MEFileInfo) Autorelease

func (m MEFileInfo) Autorelease() MEFileInfo

Autorelease adds the receiver to the current autorelease pool.

func (MEFileInfo) Duration

func (m MEFileInfo) Duration() coremedia.CMTime

The duration of the media asset, if available.

Discussion

This value is invalid if the duration isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo/duration

func (MEFileInfo) FragmentsStatus

func (m MEFileInfo) FragmentsStatus() MEFileInfoFragmentsStatus

Indicates if the media asset contains fragments or is extendable by fragments.

Discussion

The default value is MEFileInfo.FragmentsStatus.couldNotContainFragments.

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo/fragmentsStatus-swift.property

func (MEFileInfo) Init

func (m MEFileInfo) Init() MEFileInfo

Init initializes the instance.

func (MEFileInfo) SetDuration

func (m MEFileInfo) SetDuration(value coremedia.CMTime)

func (MEFileInfo) SetFragmentsStatus

func (m MEFileInfo) SetFragmentsStatus(value MEFileInfoFragmentsStatus)

func (MEFileInfo) SetSidecarFileName

func (m MEFileInfo) SetSidecarFileName(value string)

func (MEFileInfo) SidecarFileName

func (m MEFileInfo) SidecarFileName() string

Discussion

The sidecar filename used by the MediaExtension.

Represents a new or existing sidecar file located in the same directory as the primary media file. The filename should include the file extension, and should not contain the file path, or contain any slashes. The file extension should be supported by the format reader, and present in the EXAppExtensionAttributes and UTExportedTypeDeclarations dictionaries in the MediaExtension format reader Info.plist.

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo/sidecarFileName

type MEFileInfoClass

type MEFileInfoClass struct {
	// contains filtered or unexported fields
}

func GetMEFileInfoClass

func GetMEFileInfoClass() MEFileInfoClass

GetMEFileInfoClass returns the class object for MEFileInfo.

func (MEFileInfoClass) Alloc

func (mc MEFileInfoClass) Alloc() MEFileInfo

Alloc allocates memory for a new instance of the class.

func (MEFileInfoClass) Class

func (mc MEFileInfoClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type MEFileInfoErrorHandler

type MEFileInfoErrorHandler = func(*MEFileInfo, error)

MEFileInfoErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type MEFileInfoFragmentsStatus

type MEFileInfoFragmentsStatus int

See: https://developer.apple.com/documentation/MediaExtension/MEFileInfo/FragmentsStatus-swift.enum

const (
	// MEFileInfoContainsFragments: The file is extendable by fragments and contains at least one fragment.
	MEFileInfoContainsFragments MEFileInfoFragmentsStatus = 1
	// MEFileInfoCouldContainButDoesNotContainFragments: The file is extendable by fragments, but doesn’t contain any fragments.
	MEFileInfoCouldContainButDoesNotContainFragments MEFileInfoFragmentsStatus = 2
	// MEFileInfoCouldNotContainFragments: The file isn’t extendable by fragments.
	MEFileInfoCouldNotContainFragments MEFileInfoFragmentsStatus = 0
)

func (MEFileInfoFragmentsStatus) String

func (e MEFileInfoFragmentsStatus) String() string

type MEFormatReader

type MEFormatReader interface {
	objectivec.IObject

	// Loads the file info object with the properties of the media asset.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadFileInfo(completionHandler:)
	LoadFileInfoWithCompletionHandler(completionHandler MEFileInfoErrorHandler)

	// Loads the array of metadata items from the media asset.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadMetadata(completionHandler:)
	LoadMetadataWithCompletionHandler(completionHandler AVMetadataItemArrayErrorHandler)

	// Loads the array of track readers that represent the tracks in the media asset.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadTrackReaders(completionHandler:)
	LoadTrackReadersWithCompletionHandler(completionHandler ErrorHandler)
}

A protocol that defines the requirements for a format reader, which represents a single media asset.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader

type MEFormatReaderExtension

type MEFormatReaderExtension interface {
	objectivec.IObject

	// Creates a new format reader with the byte source and options that you specify.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderExtension/formatReader(with:options:)
	FormatReaderWithByteSourceOptionsError(primaryByteSource IMEByteSource, options IMEFormatReaderInstantiationOptions) (MEFormatReader, error)
}

A protocol that defines a factory to create a new format reader with a byte source.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderExtension

type MEFormatReaderExtensionObject

type MEFormatReaderExtensionObject struct {
	objectivec.Object
}

MEFormatReaderExtensionObject wraps an existing Objective-C object that conforms to the MEFormatReaderExtension protocol.

func MEFormatReaderExtensionObjectFromID

func MEFormatReaderExtensionObjectFromID(id objc.ID) MEFormatReaderExtensionObject

MEFormatReaderExtensionObjectFromID constructs a MEFormatReaderExtensionObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MEFormatReaderExtensionObject) BaseObject

func (MEFormatReaderExtensionObject) FormatReaderWithByteSourceOptionsError

func (o MEFormatReaderExtensionObject) FormatReaderWithByteSourceOptionsError(primaryByteSource IMEByteSource, options IMEFormatReaderInstantiationOptions) (MEFormatReader, error)

Creates a new format reader with the byte source and options that you specify.

primaryByteSource: The primary byte source for the format reader.

options: The reader instantiation options.

Return Value

A new format reader.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderExtension/formatReader(with:options:)

type MEFormatReaderInstantiationOptions

type MEFormatReaderInstantiationOptions struct {
	objectivec.Object
}

An object that contains options to pass to a format reader extension.

Overview

This object is mutable with options set through instance properties.

Inspecting format reader extension options

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderInstantiationOptions

func MEFormatReaderInstantiationOptionsFromID

func MEFormatReaderInstantiationOptionsFromID(id objc.ID) MEFormatReaderInstantiationOptions

MEFormatReaderInstantiationOptionsFromID constructs a MEFormatReaderInstantiationOptions from an objc.ID.

An object that contains options to pass to a format reader extension.

func NewMEFormatReaderInstantiationOptions

func NewMEFormatReaderInstantiationOptions() MEFormatReaderInstantiationOptions

NewMEFormatReaderInstantiationOptions creates a new MEFormatReaderInstantiationOptions instance.

func (MEFormatReaderInstantiationOptions) AllowIncrementalFragmentParsing

func (m MEFormatReaderInstantiationOptions) AllowIncrementalFragmentParsing() bool

Enables support for parsing additional fragments.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderInstantiationOptions/allowIncrementalFragmentParsing

func (MEFormatReaderInstantiationOptions) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MEFormatReaderInstantiationOptions) Init

Init initializes the instance.

type MEFormatReaderInstantiationOptionsClass

type MEFormatReaderInstantiationOptionsClass struct {
	// contains filtered or unexported fields
}

func GetMEFormatReaderInstantiationOptionsClass

func GetMEFormatReaderInstantiationOptionsClass() MEFormatReaderInstantiationOptionsClass

GetMEFormatReaderInstantiationOptionsClass returns the class object for MEFormatReaderInstantiationOptions.

func (MEFormatReaderInstantiationOptionsClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MEFormatReaderInstantiationOptionsClass) Class

Class returns the underlying Objective-C class pointer.

type MEFormatReaderObject

type MEFormatReaderObject struct {
	objectivec.Object
}

MEFormatReaderObject wraps an existing Objective-C object that conforms to the MEFormatReader protocol.

func MEFormatReaderObjectFromID

func MEFormatReaderObjectFromID(id objc.ID) MEFormatReaderObject

MEFormatReaderObjectFromID constructs a MEFormatReaderObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MEFormatReaderObject) BaseObject

func (o MEFormatReaderObject) BaseObject() objectivec.Object

func (MEFormatReaderObject) LoadFileInfoWithCompletionHandler

func (o MEFormatReaderObject) LoadFileInfoWithCompletionHandler(completionHandler MEFileInfoErrorHandler)

Loads the file info object with the properties of the media asset.

completionHandler: The completion block to execute when the load operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadFileInfo(completionHandler:)

func (MEFormatReaderObject) LoadMetadataWithCompletionHandler

func (o MEFormatReaderObject) LoadMetadataWithCompletionHandler(completionHandler AVMetadataItemArrayErrorHandler)

Loads the array of metadata items from the media asset.

completionHandler: The completion block to execute when the load operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadMetadata(completionHandler:)

func (MEFormatReaderObject) LoadTrackReadersWithCompletionHandler

func (o MEFormatReaderObject) LoadTrackReadersWithCompletionHandler(completionHandler ErrorHandler)

Loads the array of track readers that represent the tracks in the media asset.

completionHandler: The completion block to execute when the load operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/loadTrackReaders(completionHandler:)

func (MEFormatReaderObject) ParseAdditionalFragmentsWithCompletionHandler

func (o MEFormatReaderObject) ParseAdditionalFragmentsWithCompletionHandler(completionHandler MEFormatReaderParseAdditionalFragmentsStatusErrorHandler)

Incorporates additional fragments that the file received after the last time the format reader parsed it.

completionHandler: The completion block to execute when the parse operation finishes.

Discussion

This method additional fragments of the media asset if they exist. Media asset formats that don’t support incremental fragments don’t need implement this method. Create the MEFormatReader object with the MEFormatReaderInstantiationOptions property MEFormatReaderInstantiationOptions.AllowIncrementalFragmentParsing set to true. This method does nothing if the value for MEFileInfo.FragmentsStatus is MEFileInfo.FragmentsStatus.containsFragments. Once this method returns an error, additional calls fail.

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReader/parseAdditionalFragments(completionHandler:)

type MEFormatReaderParseAdditionalFragmentsStatus

type MEFormatReaderParseAdditionalFragmentsStatus uint

See: https://developer.apple.com/documentation/MediaExtension/MEFormatReaderParseAdditionalFragmentsStatus

const (
	// MEFormatReaderParseAdditionalFragmentsStatusFragmentAdded: Indicates that the format reader received one or more fragments.
	MEFormatReaderParseAdditionalFragmentsStatusFragmentAdded MEFormatReaderParseAdditionalFragmentsStatus = 2
	// MEFormatReaderParseAdditionalFragmentsStatusFragmentsComplete: Indicates that the format reader can’t receive any more fragments.
	MEFormatReaderParseAdditionalFragmentsStatusFragmentsComplete MEFormatReaderParseAdditionalFragmentsStatus = 4
	// MEFormatReaderParseAdditionalFragmentsStatusSizeIncreased: Indicates that the format reader file size increased.
	MEFormatReaderParseAdditionalFragmentsStatusSizeIncreased MEFormatReaderParseAdditionalFragmentsStatus = 1
)

func (MEFormatReaderParseAdditionalFragmentsStatus) String

type MEFormatReaderParseAdditionalFragmentsStatusErrorHandler

type MEFormatReaderParseAdditionalFragmentsStatusErrorHandler = func(MEFormatReaderParseAdditionalFragmentsStatus, error)

MEFormatReaderParseAdditionalFragmentsStatusErrorHandler handles The completion block to execute when the parse operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

  • [MEFormatReader.ParseAdditionalFragmentsWithCompletionHandler]

type MEHEVCDependencyInfo

type MEHEVCDependencyInfo struct {
	objectivec.Object
}

An object that provides information about the HEVC dependency attributes of a sample.

Inspecting the HEVC dependency attributes of a sample

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo

func MEHEVCDependencyInfoFromID

func MEHEVCDependencyInfoFromID(id objc.ID) MEHEVCDependencyInfo

MEHEVCDependencyInfoFromID constructs a MEHEVCDependencyInfo from an objc.ID.

An object that provides information about the HEVC dependency attributes of a sample.

func NewMEHEVCDependencyInfo

func NewMEHEVCDependencyInfo() MEHEVCDependencyInfo

NewMEHEVCDependencyInfo creates a new MEHEVCDependencyInfo instance.

func (MEHEVCDependencyInfo) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MEHEVCDependencyInfo) ConstraintIndicatorFlags

func (m MEHEVCDependencyInfo) ConstraintIndicatorFlags() foundation.NSData

The HEVC constraint indicator flags (6 bytes), if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_ConstraintIndicatorFlags sample buffer attachment, and is `nil` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/constraintIndicatorFlags

func (MEHEVCDependencyInfo) Init

Init initializes the instance.

func (MEHEVCDependencyInfo) LevelIndex

func (m MEHEVCDependencyInfo) LevelIndex() int16

The HEVC level index, if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_LevelIndex sample buffer attachment, and is `-1` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/levelIndex

func (MEHEVCDependencyInfo) ProfileCompatibilityFlags

func (m MEHEVCDependencyInfo) ProfileCompatibilityFlags() foundation.NSData

The HEVC profile compatibility flags (4 bytes), if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_ProfileCompatibilityFlags sample buffer attachment, and is `nil` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/profileCompatibilityFlags

func (MEHEVCDependencyInfo) ProfileIndex

func (m MEHEVCDependencyInfo) ProfileIndex() int16

The HEVC profile index, if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_ProfileIndex sample buffer attachment, and is `-1` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/profileIndex

func (MEHEVCDependencyInfo) ProfileSpace

func (m MEHEVCDependencyInfo) ProfileSpace() int16

The HEVC profile space, if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_ProfileSpace sample buffer attachment, and is `-1` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/profileSpace

func (MEHEVCDependencyInfo) SetConstraintIndicatorFlags

func (m MEHEVCDependencyInfo) SetConstraintIndicatorFlags(value foundation.NSData)

func (MEHEVCDependencyInfo) SetLevelIndex

func (m MEHEVCDependencyInfo) SetLevelIndex(value int16)

func (MEHEVCDependencyInfo) SetProfileCompatibilityFlags

func (m MEHEVCDependencyInfo) SetProfileCompatibilityFlags(value foundation.NSData)

func (MEHEVCDependencyInfo) SetProfileIndex

func (m MEHEVCDependencyInfo) SetProfileIndex(value int16)

func (MEHEVCDependencyInfo) SetProfileSpace

func (m MEHEVCDependencyInfo) SetProfileSpace(value int16)

func (MEHEVCDependencyInfo) SetStepwiseTemporalSubLayerAccess

func (m MEHEVCDependencyInfo) SetStepwiseTemporalSubLayerAccess(value bool)

func (MEHEVCDependencyInfo) SetSyncSampleNALUnitType

func (m MEHEVCDependencyInfo) SetSyncSampleNALUnitType(value int16)

func (MEHEVCDependencyInfo) SetTemporalLevel

func (m MEHEVCDependencyInfo) SetTemporalLevel(value int16)

func (MEHEVCDependencyInfo) SetTemporalSubLayerAccess

func (m MEHEVCDependencyInfo) SetTemporalSubLayerAccess(value bool)

func (MEHEVCDependencyInfo) SetTierFlag

func (m MEHEVCDependencyInfo) SetTierFlag(value int16)

func (MEHEVCDependencyInfo) StepwiseTemporalSubLayerAccess

func (m MEHEVCDependencyInfo) StepwiseTemporalSubLayerAccess() bool

A Boolean value that indicates if the sample has an HEVC stepwise temporal sublayer access (STSA) picture.

Discussion

This value maps to the kCMSampleAttachmentKey_HEVCStepwiseTemporalSubLayerAccess sample buffer attachment.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/hasStepwiseTemporalSubLayerAccess

func (MEHEVCDependencyInfo) SyncSampleNALUnitType

func (m MEHEVCDependencyInfo) SyncSampleNALUnitType() int16

The NAL unit type for HEVC sync sample groups.

Discussion

This value maps to the kCMSampleAttachmentKey_HEVCSyncSampleNALUnitType sample buffer attachment.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/syncSampleNALUnitType

func (MEHEVCDependencyInfo) TemporalLevel

func (m MEHEVCDependencyInfo) TemporalLevel() int16

The HEVC temporal level, if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_TemporalLevel sample buffer attachment, and is `-1` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/temporalLevel

func (MEHEVCDependencyInfo) TemporalSubLayerAccess

func (m MEHEVCDependencyInfo) TemporalSubLayerAccess() bool

A Boolean value that indicates if the sample has an HEVC temporal sublayer access (TSA) picture.

Discussion

This value maps to the kCMSampleAttachmentKey_HEVCTemporalSubLayerAccess sample buffer attachment.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/hasTemporalSubLayerAccess

func (MEHEVCDependencyInfo) TierFlag

func (m MEHEVCDependencyInfo) TierFlag() int16

The HEVC tier level flag, if available.

Discussion

This value maps to the kCMHEVCTemporalLevelInfoKey_TierFlag sample buffer attachment, and is `-1` if this information isn’t available.

See: https://developer.apple.com/documentation/MediaExtension/MEHEVCDependencyInfo/tierFlag

type MEHEVCDependencyInfoClass

type MEHEVCDependencyInfoClass struct {
	// contains filtered or unexported fields
}

func GetMEHEVCDependencyInfoClass

func GetMEHEVCDependencyInfoClass() MEHEVCDependencyInfoClass

GetMEHEVCDependencyInfoClass returns the class object for MEHEVCDependencyInfo.

func (MEHEVCDependencyInfoClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MEHEVCDependencyInfoClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingBooleanParameter

type MERAWProcessingBooleanParameter struct {
	MERAWProcessingParameter
}

An object that describes a Boolean parameter of a RAW processor.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Boolean

func MERAWProcessingBooleanParameterFromID

func MERAWProcessingBooleanParameterFromID(id objc.ID) MERAWProcessingBooleanParameter

MERAWProcessingBooleanParameterFromID constructs a MERAWProcessingBooleanParameter from an objc.ID.

An object that describes a Boolean parameter of a RAW processor.

func NewMERAWProcessingBooleanParameter

func NewMERAWProcessingBooleanParameter() MERAWProcessingBooleanParameter

NewMERAWProcessingBooleanParameter creates a new MERAWProcessingBooleanParameter instance.

func (MERAWProcessingBooleanParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingBooleanParameter) CurrentValue

func (m MERAWProcessingBooleanParameter) CurrentValue() bool

Get or set the current value for this parameter.

Discussion

This property can be observed if appropriate in order to monitor changes to the set of [MERAWProcessingParameters] vended by the extension.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Boolean/currentValue

func (MERAWProcessingBooleanParameter) Init

Init initializes the instance.

func (MERAWProcessingBooleanParameter) InitialValue

func (m MERAWProcessingBooleanParameter) InitialValue() bool

The initial value for this parameter as defined in the sequence metadata.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Boolean/initialValue

func (MERAWProcessingBooleanParameter) SetCurrentValue

func (m MERAWProcessingBooleanParameter) SetCurrentValue(value bool)

type MERAWProcessingBooleanParameterClass

type MERAWProcessingBooleanParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingBooleanParameterClass

func GetMERAWProcessingBooleanParameterClass() MERAWProcessingBooleanParameterClass

GetMERAWProcessingBooleanParameterClass returns the class object for MERAWProcessingBooleanParameter.

func (MERAWProcessingBooleanParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingBooleanParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingFloatParameter

type MERAWProcessingFloatParameter struct {
	MERAWProcessingParameter
}

An object that describes a floating-point parameter of a RAW processor.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint

func MERAWProcessingFloatParameterFromID

func MERAWProcessingFloatParameterFromID(id objc.ID) MERAWProcessingFloatParameter

MERAWProcessingFloatParameterFromID constructs a MERAWProcessingFloatParameter from an objc.ID.

An object that describes a floating-point parameter of a RAW processor.

func NewMERAWProcessingFloatParameter

func NewMERAWProcessingFloatParameter() MERAWProcessingFloatParameter

NewMERAWProcessingFloatParameter creates a new MERAWProcessingFloatParameter instance.

func (MERAWProcessingFloatParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingFloatParameter) CurrentValue

func (m MERAWProcessingFloatParameter) CurrentValue() float32

Get or set the current value for this parameter.

Discussion

This property can be observed if appropriate in order to monitor changes to the set of [MERAWProcessingParameters] vended by the extension.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint/currentValue

func (MERAWProcessingFloatParameter) Init

Init initializes the instance.

func (MERAWProcessingFloatParameter) InitialValue

func (m MERAWProcessingFloatParameter) InitialValue() float32

The initial value for this parameter as defined in the sequence metadata.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint/initialValue

func (MERAWProcessingFloatParameter) MaximumValue

func (m MERAWProcessingFloatParameter) MaximumValue() float32

The maximum value for this parameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint/maximumValue

func (MERAWProcessingFloatParameter) MinimumValue

func (m MERAWProcessingFloatParameter) MinimumValue() float32

The minimum value for this parameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/FloatingPoint/minimumValue

func (MERAWProcessingFloatParameter) SetCurrentValue

func (m MERAWProcessingFloatParameter) SetCurrentValue(value float32)

type MERAWProcessingFloatParameterClass

type MERAWProcessingFloatParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingFloatParameterClass

func GetMERAWProcessingFloatParameterClass() MERAWProcessingFloatParameterClass

GetMERAWProcessingFloatParameterClass returns the class object for MERAWProcessingFloatParameter.

func (MERAWProcessingFloatParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingFloatParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingIntegerParameter

type MERAWProcessingIntegerParameter struct {
	MERAWProcessingParameter
}

An object that describes an integer parameter of a RAW processor.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer

func MERAWProcessingIntegerParameterFromID

func MERAWProcessingIntegerParameterFromID(id objc.ID) MERAWProcessingIntegerParameter

MERAWProcessingIntegerParameterFromID constructs a MERAWProcessingIntegerParameter from an objc.ID.

An object that describes an integer parameter of a RAW processor.

func NewMERAWProcessingIntegerParameter

func NewMERAWProcessingIntegerParameter() MERAWProcessingIntegerParameter

NewMERAWProcessingIntegerParameter creates a new MERAWProcessingIntegerParameter instance.

func (MERAWProcessingIntegerParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingIntegerParameter) CurrentValue

func (m MERAWProcessingIntegerParameter) CurrentValue() int

Get or set the current value for this parameter.

Discussion

This property can be observed if appropriate in order to monitor changes to the set of [MERAWProcessingParameters] vended by the extension.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer/currentValue

func (MERAWProcessingIntegerParameter) Init

Init initializes the instance.

func (MERAWProcessingIntegerParameter) InitialValue

func (m MERAWProcessingIntegerParameter) InitialValue() int

The initial value for this parameter as defined in the sequence metadata.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer/initialValue

func (MERAWProcessingIntegerParameter) MaximumValue

func (m MERAWProcessingIntegerParameter) MaximumValue() int

The maximum value for this parameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer/maximumValue

func (MERAWProcessingIntegerParameter) MinimumValue

func (m MERAWProcessingIntegerParameter) MinimumValue() int

The minimum value for this parameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/Integer/minimumValue

func (MERAWProcessingIntegerParameter) SetCurrentValue

func (m MERAWProcessingIntegerParameter) SetCurrentValue(value int)

type MERAWProcessingIntegerParameterClass

type MERAWProcessingIntegerParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingIntegerParameterClass

func GetMERAWProcessingIntegerParameterClass() MERAWProcessingIntegerParameterClass

GetMERAWProcessingIntegerParameterClass returns the class object for MERAWProcessingIntegerParameter.

func (MERAWProcessingIntegerParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingIntegerParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingListElementParameter

type MERAWProcessingListElementParameter struct {
	MERAWProcessingParameter
}

An object that describes a list element parameter of a RAW processor.

Overview

The [MERAWProcessingParameterListElement] protocol provides an interface for [VideoToolbox] to query descriptions of the different elements in a parameter list for a list element in a MERAWProcessingParameter. A distinct [MERAWProcessingParameterListElement] is created for each list element.

Creating a list element parameter object

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/ListElement

func MERAWProcessingListElementParameterFromID

func MERAWProcessingListElementParameterFromID(id objc.ID) MERAWProcessingListElementParameter

MERAWProcessingListElementParameterFromID constructs a MERAWProcessingListElementParameter from an objc.ID.

An object that describes a list element parameter of a RAW processor.

func NewMERAWProcessingListElementParameter

func NewMERAWProcessingListElementParameter() MERAWProcessingListElementParameter

NewMERAWProcessingListElementParameter creates a new MERAWProcessingListElementParameter instance.

func NewMERAWProcessingListElementParameterWithNameDescriptionElementID

func NewMERAWProcessingListElementParameterWithNameDescriptionElementID(name string, description string, elementID int) MERAWProcessingListElementParameter

Creates a list element parameter object with the element id value.

name: A localized human-readable name for the parameter, suitable for displaying in application UI.

description: A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.

elementID: A unique number in the list which represents this list option.

Return Value

An instance of MERAWProcessingListElementParameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/ListElement/init(name:description:elementID:)

func (MERAWProcessingListElementParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingListElementParameter) Init

Init initializes the instance.

func (MERAWProcessingListElementParameter) InitWithNameDescriptionElementID

func (m MERAWProcessingListElementParameter) InitWithNameDescriptionElementID(name string, description string, elementID int) MERAWProcessingListElementParameter

Creates a list element parameter object with the element id value.

name: A localized human-readable name for the parameter, suitable for displaying in application UI.

description: A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.

elementID: A unique number in the list which represents this list option.

Return Value

An instance of MERAWProcessingListElementParameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/ListElement/init(name:description:elementID:)

func (MERAWProcessingListElementParameter) ListElementID

func (m MERAWProcessingListElementParameter) ListElementID() int

A unique number in the list which represents this list option.

Discussion

The set of elements in the list may change depending on other configuration parameters, so while the index of an element in this list may change, this ID never changes and is used to report list element selection.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/ListElement/listElementID

type MERAWProcessingListElementParameterClass

type MERAWProcessingListElementParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingListElementParameterClass

func GetMERAWProcessingListElementParameterClass() MERAWProcessingListElementParameterClass

GetMERAWProcessingListElementParameterClass returns the class object for MERAWProcessingListElementParameter.

func (MERAWProcessingListElementParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingListElementParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingListParameter

type MERAWProcessingListParameter struct {
	MERAWProcessingParameter
}

An object that describes a list parameter of a RAW processor.

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/List

func MERAWProcessingListParameterFromID

func MERAWProcessingListParameterFromID(id objc.ID) MERAWProcessingListParameter

MERAWProcessingListParameterFromID constructs a MERAWProcessingListParameter from an objc.ID.

An object that describes a list parameter of a RAW processor.

func NewMERAWProcessingListParameter

func NewMERAWProcessingListParameter() MERAWProcessingListParameter

NewMERAWProcessingListParameter creates a new MERAWProcessingListParameter instance.

func (MERAWProcessingListParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingListParameter) CurrentValue

func (m MERAWProcessingListParameter) CurrentValue() int

Get or set the current value for this parameter.

Discussion

This property can be observed if appropriate in order to monitor changes to the set of [MERAWProcessingParameters] vended by the extension.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/List/currentValue

func (MERAWProcessingListParameter) Init

Init initializes the instance.

func (MERAWProcessingListParameter) InitialValue

func (m MERAWProcessingListParameter) InitialValue() int

The initial value for this parameter as defined in the sequence metadata.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/List/initialValue

func (MERAWProcessingListParameter) SetCurrentValue

func (m MERAWProcessingListParameter) SetCurrentValue(value int)

type MERAWProcessingListParameterClass

type MERAWProcessingListParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingListParameterClass

func GetMERAWProcessingListParameterClass() MERAWProcessingListParameterClass

GetMERAWProcessingListParameterClass returns the class object for MERAWProcessingListParameter.

func (MERAWProcessingListParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingListParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingParameter

type MERAWProcessingParameter struct {
	objectivec.Object
}

An object for the RAW processor to describe each processing parameter the processor exposes.

Discussion

This protocol provides an interface for Video Toolbox to query descriptions of the different parameters that can be used to influence RAW processor operation. A distinct MERAWProcessingParameter is created for each parameter supported by the RAW processor, and the set of supported parameters is returned by the [ProcessingParameters] interface.

Inspecting a processing parameter

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter

func MERAWProcessingParameterFromID

func MERAWProcessingParameterFromID(id objc.ID) MERAWProcessingParameter

MERAWProcessingParameterFromID constructs a MERAWProcessingParameter from an objc.ID.

An object for the RAW processor to describe each processing parameter the processor exposes.

func NewMERAWProcessingParameter

func NewMERAWProcessingParameter() MERAWProcessingParameter

NewMERAWProcessingParameter creates a new MERAWProcessingParameter instance.

func (MERAWProcessingParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingParameter) Enabled

func (m MERAWProcessingParameter) Enabled() bool

A Boolean value that indicates whether the extension enables the parameter.

Discussion

This parameter can only be modified by the extension. From the application-facing interface, [VTRAWProcessingSession], this is a read-only value which indicates whether the parameter should be grayed out and disabled in any UI being generated.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/enabled

func (MERAWProcessingParameter) Init

Init initializes the instance.

func (MERAWProcessingParameter) Key

A unique key string identifying the parameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/key

func (MERAWProcessingParameter) LongDescription

func (m MERAWProcessingParameter) LongDescription() string

A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/longDescription

func (MERAWProcessingParameter) Name

A localized human-readable name for the parameter, suitable for displaying in application UI.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/name

func (MERAWProcessingParameter) SetEnabled

func (m MERAWProcessingParameter) SetEnabled(value bool)

type MERAWProcessingParameterClass

type MERAWProcessingParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingParameterClass

func GetMERAWProcessingParameterClass() MERAWProcessingParameterClass

GetMERAWProcessingParameterClass returns the class object for MERAWProcessingParameter.

func (MERAWProcessingParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessingSubGroupParameter

type MERAWProcessingSubGroupParameter struct {
	MERAWProcessingParameter
}

An object that describes a sub group parameter of a RAW processor.

Overview

Sub groups are logical groupings of MERAWProcessingParameter objects that should be displayed together in an application user interface.

Creating a sub group parameter object

Properties

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/SubGroup

func MERAWProcessingSubGroupParameterFromID

func MERAWProcessingSubGroupParameterFromID(id objc.ID) MERAWProcessingSubGroupParameter

MERAWProcessingSubGroupParameterFromID constructs a MERAWProcessingSubGroupParameter from an objc.ID.

An object that describes a sub group parameter of a RAW processor.

func NewMERAWProcessingSubGroupParameter

func NewMERAWProcessingSubGroupParameter() MERAWProcessingSubGroupParameter

NewMERAWProcessingSubGroupParameter creates a new MERAWProcessingSubGroupParameter instance.

func NewMERAWProcessingSubGroupParameterWithNameDescriptionParameters

func NewMERAWProcessingSubGroupParameterWithNameDescriptionParameters(name string, description string, parameters []MERAWProcessingParameter) MERAWProcessingSubGroupParameter

Creates a sub group parameter object with the parameters value.

name: A localized human-readable name for the parameter, suitable for displaying in application UI.

description: A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.

parameters: The array of MERAWProcessingParameter objects in the sub group.

Return Value

An instance of MERAWProcessingSubGroupParameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/SubGroup/init(name:description:parameters:)

func (MERAWProcessingSubGroupParameter) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessingSubGroupParameter) Init

Init initializes the instance.

func (MERAWProcessingSubGroupParameter) InitWithNameDescriptionParameters

func (m MERAWProcessingSubGroupParameter) InitWithNameDescriptionParameters(name string, description string, parameters []MERAWProcessingParameter) MERAWProcessingSubGroupParameter

Creates a sub group parameter object with the parameters value.

name: A localized human-readable name for the parameter, suitable for displaying in application UI.

description: A localized description of the parameter, suitable for displaying in a tool tip or similar explanatory UI.

parameters: The array of MERAWProcessingParameter objects in the sub group.

Return Value

An instance of MERAWProcessingSubGroupParameter.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessingParameter/SubGroup/init(name:description:parameters:)

type MERAWProcessingSubGroupParameterClass

type MERAWProcessingSubGroupParameterClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessingSubGroupParameterClass

func GetMERAWProcessingSubGroupParameterClass() MERAWProcessingSubGroupParameterClass

GetMERAWProcessingSubGroupParameterClass returns the class object for MERAWProcessingSubGroupParameter.

func (MERAWProcessingSubGroupParameterClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessingSubGroupParameterClass) Class

Class returns the underlying Objective-C class pointer.

type MERAWProcessor

type MERAWProcessor interface {
	objectivec.IObject

	// Requests the processor to process a video frame.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/processFrame(fromImageBuffer:completionHandler:)
	ProcessFrameFromImageBufferCompletionHandler(inputFrame corevideo.CVImageBufferRef, completionHandler CVPixelBufferRefErrorHandler)

	// Requests the processor use the provided Metal device for processing.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/metalDeviceRegistryID
	MetalDeviceRegistryID() uint64
	SetMetalDeviceRegistryID(value uint64)

	// Returns the color-related Core Video image buffer keys and values that become attachments to the output pixel buffers.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/outputColorAttachments
	OutputColorAttachments() foundation.INSDictionary

	// Provides a list of processing parameters that can be changed by the client of Video Toolbox session to influence processing behavior.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/processingParameters
	ProcessingParameters() []MERAWProcessingParameter

	// Indicates the readiness of the processor to accept more sample buffers.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/isReadyForMoreMediaData
	IsReadyForMoreMediaData() bool

	// # Discussion  The metadata returned is a pre-formatted NSData that represents a fully-formed sidecar file, and should be compatible with the MediaExtension FormatReader.  The metadata will contain the initial processing parameters from the sidecar file, along with any adjustments made on the RAW processor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/metadataForSidecarFile
	MetadataForSidecarFile() foundation.NSData
}

A protocol that defines the requirements for a RAW processor.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor

type MERAWProcessorExtension

type MERAWProcessorExtension interface {
	objectivec.IObject

	// A factory method to create a video RAW processor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorExtension/makeProcessor(formatDescription:pixelBufferManager:)
	ProcessorWithFormatDescriptionExtensionPixelBufferManagerError(formatDescription coremedia.CMVideoFormatDescriptionRef, extensionPixelBufferManager IMERAWProcessorPixelBufferManager) (MERAWProcessor, error)
}

A protocol that defines a factory to create RAW processors for a codec type that the extension implements.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorExtension

type MERAWProcessorExtensionObject

type MERAWProcessorExtensionObject struct {
	objectivec.Object
}

MERAWProcessorExtensionObject wraps an existing Objective-C object that conforms to the MERAWProcessorExtension protocol.

func MERAWProcessorExtensionObjectFromID

func MERAWProcessorExtensionObjectFromID(id objc.ID) MERAWProcessorExtensionObject

MERAWProcessorExtensionObjectFromID constructs a MERAWProcessorExtensionObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MERAWProcessorExtensionObject) BaseObject

func (MERAWProcessorExtensionObject) ProcessorWithFormatDescriptionExtensionPixelBufferManagerError

func (o MERAWProcessorExtensionObject) ProcessorWithFormatDescriptionExtensionPixelBufferManagerError(formatDescription coremedia.CMVideoFormatDescriptionRef, extensionPixelBufferManager IMERAWProcessorPixelBufferManager) (MERAWProcessor, error)

A factory method to create a video RAW processor.

formatDescription: A [CMVideoFormatDescription] describing the video data that was decoded to produce the RAW input for the video RAW processor.

extensionPixelBufferManager: An MERAWProcessorPixelBufferManager instance that should be retained by the new MERAWProcessor instance and used for output pixelBuffer configuration and allocation.

Discussion

Creates a new MERAWProcessor matching the given [CMVideoFormatDescriptionRef]. If these parameters are not compatible with the MERAWProcessor, the call should fail, returning MEErrorUnsupportedFeature.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorExtension/makeProcessor(formatDescription:pixelBufferManager:)

type MERAWProcessorObject

type MERAWProcessorObject struct {
	objectivec.Object
}

MERAWProcessorObject wraps an existing Objective-C object that conforms to the MERAWProcessor protocol.

func MERAWProcessorObjectFromID

func MERAWProcessorObjectFromID(id objc.ID) MERAWProcessorObject

MERAWProcessorObjectFromID constructs a MERAWProcessorObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MERAWProcessorObject) BaseObject

func (o MERAWProcessorObject) BaseObject() objectivec.Object

func (MERAWProcessorObject) IsReadyForMoreMediaData

func (o MERAWProcessorObject) IsReadyForMoreMediaData() bool

Indicates the readiness of the processor to accept more sample buffers.

Discussion

An MERAWProcessor operates asynchronously and often has a fixed capacity for buffers in flight in the processor. This property allows the processor to signal to Video Toolbox that its internal buffers are full and cannot accept more samples. The processor must use MERAWProcessorReadyForMoreMediaDataDidChangeNotification to notify Video Toolbox when this property changes.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/isReadyForMoreMediaData

func (MERAWProcessorObject) MetadataForSidecarFile

func (o MERAWProcessorObject) MetadataForSidecarFile() foundation.NSData

Discussion

The metadata returned is a pre-formatted NSData that represents a fully-formed sidecar file, and should be compatible with the MediaExtension FormatReader.

The metadata will contain the initial processing parameters from the sidecar file, along with any adjustments made on the RAW processor.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/metadataForSidecarFile

func (MERAWProcessorObject) MetalDeviceRegistryID

func (o MERAWProcessorObject) MetalDeviceRegistryID() uint64

Requests the processor use the provided Metal device for processing.

Discussion

This optional property requests that MERAWProcessor use [MTLDevice] corresponding to this ID for any Metal-based processing. This is optional and doesn’t need to be implemented if the processor does not use Metal.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/metalDeviceRegistryID

func (MERAWProcessorObject) OutputColorAttachments

func (o MERAWProcessorObject) OutputColorAttachments() foundation.INSDictionary

Returns the color-related Core Video image buffer keys and values that become attachments to the output pixel buffers.

Discussion

This is an optional property. Only color-related keys from Image Buffer Attachment Keys are permitted in the returned dictionary.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/outputColorAttachments

func (MERAWProcessorObject) ProcessFrameFromImageBufferCompletionHandler

func (o MERAWProcessorObject) ProcessFrameFromImageBufferCompletionHandler(inputFrame corevideo.CVImageBufferRef, completionHandler CVPixelBufferRefErrorHandler)

Requests the processor to process a video frame.

inputFrame: A CVPixelBuffer that contains a video frame to process.

completionHandler: The handler is invoked when a frame processes and is ready to be sent back to the caller. This block does not need to be called in the order in which frames were submitted.

Discussion

The completionHandler block must be called for every [ProcessFrameFromImageBufferCompletionHandler] call when processing is complete. The completion handler block should return either a processed pixel buffer or an error.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/processFrame(fromImageBuffer:completionHandler:)

func (MERAWProcessorObject) ProcessingParameters

func (o MERAWProcessorObject) ProcessingParameters() []MERAWProcessingParameter

Provides a list of processing parameters that can be changed by the client of Video Toolbox session to influence processing behavior.

Discussion

This property value is an array of MERAWProcessingParameter objects, each describing the parameter and providing an interface where the processing parameter value may be modified.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessor/processingParameters

func (MERAWProcessorObject) SetMetalDeviceRegistryID

func (o MERAWProcessorObject) SetMetalDeviceRegistryID(value uint64)

type MERAWProcessorPixelBufferManager

type MERAWProcessorPixelBufferManager struct {
	objectivec.Object
}

Describes pixel buffer requirements and creates new pixel buffers.

Discussion

It contains the interfaces that the MERAWProcessor uses for two tasks. First, to declare its set of requirements for output CVPixelBuffer in the form of a pixelBufferAttributes dictionary. Second, create pixel buffers that match processor output requirements and satisfy Video Toolbox and client requirements.

Creating a pixel buffer

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorPixelBufferManager

func MERAWProcessorPixelBufferManagerFromID

func MERAWProcessorPixelBufferManagerFromID(id objc.ID) MERAWProcessorPixelBufferManager

MERAWProcessorPixelBufferManagerFromID constructs a MERAWProcessorPixelBufferManager from an objc.ID.

Describes pixel buffer requirements and creates new pixel buffers.

func NewMERAWProcessorPixelBufferManager

func NewMERAWProcessorPixelBufferManager() MERAWProcessorPixelBufferManager

NewMERAWProcessorPixelBufferManager creates a new MERAWProcessorPixelBufferManager instance.

func (MERAWProcessorPixelBufferManager) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MERAWProcessorPixelBufferManager) CreatePixelBufferAndReturnError

func (m MERAWProcessorPixelBufferManager) CreatePixelBufferAndReturnError() (corevideo.CVImageBufferRef, error)

Generates a pixel buffer using the session’s pixel buffer pool.

Return Value

A pixel buffer that’s compatible with the extension’s most recently set pixel buffer attributes.

See: https://developer.apple.com/documentation/MediaExtension/MERAWProcessorPixelBufferManager/makePixelBuffer()

func (MERAWProcessorPixelBufferManager) Init

Init initializes the instance.

func (MERAWProcessorPixelBufferManager) PixelBufferAttributes

func (m MERAWProcessorPixelBufferManager) PixelBufferAttributes() foundation.INSDictionary

A dictionary that contains the attributes Video Toolbox uses to create a pixel buffer for the video RAW processor.

See: https://developer.apple.com/documentation/mediaextension/merawprocessorpixelbuffermanager/pixelbufferattributes-4fe69

func (MERAWProcessorPixelBufferManager) SetPixelBufferAttributes

func (m MERAWProcessorPixelBufferManager) SetPixelBufferAttributes(value foundation.INSDictionary)

type MERAWProcessorPixelBufferManagerClass

type MERAWProcessorPixelBufferManagerClass struct {
	// contains filtered or unexported fields
}

func GetMERAWProcessorPixelBufferManagerClass

func GetMERAWProcessorPixelBufferManagerClass() MERAWProcessorPixelBufferManagerClass

GetMERAWProcessorPixelBufferManagerClass returns the class object for MERAWProcessorPixelBufferManager.

func (MERAWProcessorPixelBufferManagerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MERAWProcessorPixelBufferManagerClass) Class

Class returns the underlying Objective-C class pointer.

type MESampleCursor

type MESampleCursor interface {
	objectivec.IObject
	foundation.NSCopying

	// Moves the cursor a given number of samples in decode order.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/stepInDecodeOrder(by:completionHandler:)
	StepInDecodeOrderByCountCompletionHandler(stepCount int64, completionHandler int64_tErrorHandler)

	// Moves the cursor a given number of samples in presentation order.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/stepInPresentationOrder(by:completionHandler:)
	StepInPresentationOrderByCountCompletionHandler(stepCount int64, completionHandler int64_tErrorHandler)

	// The presentation timestamp (PTS) of the sample at the current position of the cursor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/presentationTimeStamp
	PresentationTimeStamp() coremedia.CMTime

	// The decode timestamp (DTS) of the sample at the current position of the cursor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/decodeTimeStamp
	DecodeTimeStamp() coremedia.CMTime

	// The decode duration of the sample at the current position.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/currentSampleDuration
	CurrentSampleDuration() coremedia.CMTime

	// The format description for the sample at the current position of the cursor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/currentSampleFormatDescription
	CurrentSampleFormatDescription() coremedia.CMFormatDescriptionRef

	// Decoder synchronization information about the sample the cursor points to.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/syncInfo
	SyncInfo() avfoundation.AVSampleCursorSyncInfo

	// Dependency information about the sample the cursor points to.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/dependencyInfo
	DependencyInfo() avfoundation.AVSampleCursorDependencyInfo

	// Additional information that’s necessary to recover complete sample dependency information.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/hevcDependencyInfo
	HevcDependencyInfo() IMEHEVCDependencyInfo

	// The duration of the playable content starting from the cursor position.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/decodeTimeOfLastSampleReachableByForwardSteppingThatIsAlreadyLoadedByByteSource
	DecodeTimeOfLastSampleReachableByForwardSteppingThatIsAlreadyLoadedByByteSource() coremedia.CMTime
}

A protocol that defines the information to provide about samples within a track of a media asset, and enables stepping through samples in the track in decode or presentation order.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor

type MESampleCursorChunk

type MESampleCursorChunk struct {
	objectivec.Object
}

An object that provides information about the chunk of media at the location of a sample.

Overview

The [ChunkDetailsReturningError] method returns an instance of this class.

Creating a sample cursor chunk

Inspecting a chunk

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk

func MESampleCursorChunkFromID

func MESampleCursorChunkFromID(id objc.ID) MESampleCursorChunk

MESampleCursorChunkFromID constructs a MESampleCursorChunk from an objc.ID.

An object that provides information about the chunk of media at the location of a sample.

func NewMESampleCursorChunk

func NewMESampleCursorChunk() MESampleCursorChunk

NewMESampleCursorChunk creates a new MESampleCursorChunk instance.

func NewMESampleCursorChunkWithByteSourceChunkStorageRangeChunkInfoSampleIndexWithinChunk

func NewMESampleCursorChunkWithByteSourceChunkStorageRangeChunkInfoSampleIndexWithinChunk(byteSource IMEByteSource, chunkStorageRange avfoundation.AVSampleCursorStorageRange, chunkInfo avfoundation.AVSampleCursorChunkInfo, sampleIndexWithinChunk corefoundation.CFIndex) MESampleCursorChunk

Creates a new sample cursor chunk with byte source and chunk data that you provide.

byteSource: The byte source to use to read the data for the sample.

chunkStorageRange: The offset location and length of the sample’s chunk within the byte source.

chunkInfo: An object that provides details about the chunk in the media.

sampleIndexWithinChunk: The offset index of the sample within the chunk, in samples.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/init(byteSource:chunkStorageRange:chunkInfo:sampleIndexWithinChunk:)

func (MESampleCursorChunk) Autorelease

func (m MESampleCursorChunk) Autorelease() MESampleCursorChunk

Autorelease adds the receiver to the current autorelease pool.

func (MESampleCursorChunk) ByteSource

func (m MESampleCursorChunk) ByteSource() IMEByteSource

The byte source to use to read the data for the sample.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/byteSource

func (MESampleCursorChunk) ChunkInfo

An object that provides details about the chunk in the media.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/chunkInfo

func (MESampleCursorChunk) ChunkStorageRange

The offset location and length of the sample’s chunk within the byte source.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/chunkStorageRange

func (MESampleCursorChunk) Init

Init initializes the instance.

func (MESampleCursorChunk) InitWithByteSourceChunkStorageRangeChunkInfoSampleIndexWithinChunk

func (m MESampleCursorChunk) InitWithByteSourceChunkStorageRangeChunkInfoSampleIndexWithinChunk(byteSource IMEByteSource, chunkStorageRange avfoundation.AVSampleCursorStorageRange, chunkInfo avfoundation.AVSampleCursorChunkInfo, sampleIndexWithinChunk corefoundation.CFIndex) MESampleCursorChunk

Creates a new sample cursor chunk with byte source and chunk data that you provide.

byteSource: The byte source to use to read the data for the sample.

chunkStorageRange: The offset location and length of the sample’s chunk within the byte source.

chunkInfo: An object that provides details about the chunk in the media.

sampleIndexWithinChunk: The offset index of the sample within the chunk, in samples.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/init(byteSource:chunkStorageRange:chunkInfo:sampleIndexWithinChunk:)

func (MESampleCursorChunk) SampleIndexWithinChunk

func (m MESampleCursorChunk) SampleIndexWithinChunk() corefoundation.CFIndex

The offset index of the sample within the chunk, in samples.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursorChunk/sampleIndexWithinChunk

type MESampleCursorChunkClass

type MESampleCursorChunkClass struct {
	// contains filtered or unexported fields
}

func GetMESampleCursorChunkClass

func GetMESampleCursorChunkClass() MESampleCursorChunkClass

GetMESampleCursorChunkClass returns the class object for MESampleCursorChunk.

func (MESampleCursorChunkClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MESampleCursorChunkClass) Class

func (mc MESampleCursorChunkClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type MESampleCursorErrorHandler

type MESampleCursorErrorHandler = func(MESampleCursor, error)

MESampleCursorErrorHandler handles The completion block to execute when the generate operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type MESampleCursorObject

type MESampleCursorObject struct {
	foundation.NSCopyingObject
}

MESampleCursorObject wraps an existing Objective-C object that conforms to the MESampleCursor protocol.

func MESampleCursorObjectFromID

func MESampleCursorObjectFromID(id objc.ID) MESampleCursorObject

MESampleCursorObjectFromID constructs a MESampleCursorObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MESampleCursorObject) BaseObject

func (o MESampleCursorObject) BaseObject() objectivec.Object

func (MESampleCursorObject) ChunkDetailsReturningError

func (o MESampleCursorObject) ChunkDetailsReturningError() (IMESampleCursorChunk, error)

Returns information about the chunk that holds the sample indicated by the cursor.

Return Value

A sample cursor chunk.

Discussion

If the sample resides in a contiguous chunk of the file among similar samples, this method returns information about that chunk.

It may not be practical to use this method with some media assets. In this case, or if the cursor doesn’t support this method, it returns MEError.Code.locationNotAvailable, which indicates to use [LoadSampleBufferContainingSamplesToEndCursorCompletionHandler] to load the sample data instead.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/chunkDetails()

func (MESampleCursorObject) CurrentSampleDuration

func (o MESampleCursorObject) CurrentSampleDuration() coremedia.CMTime

The decode duration of the sample at the current position.

Discussion

This value is indefinite if the system needs to advance the sample past its current position to determine the decode duration. This can occur with streaming formats such as MPEG-2 transport streams.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/currentSampleDuration

func (MESampleCursorObject) CurrentSampleFormatDescription

func (o MESampleCursorObject) CurrentSampleFormatDescription() coremedia.CMFormatDescriptionRef

The format description for the sample at the current position of the cursor.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/currentSampleFormatDescription

func (MESampleCursorObject) DecodeTimeOfLastSampleReachableByForwardSteppingThatIsAlreadyLoadedByByteSource

func (o MESampleCursorObject) DecodeTimeOfLastSampleReachableByForwardSteppingThatIsAlreadyLoadedByByteSource() coremedia.CMTime

The duration of the playable content starting from the cursor position.

Discussion

Indicates the time difference between the current cursor decode timestamp (DTS) and the last reachable sample DTS. This is necessary to play certain assets such as those with HTTP URLs, because it indicates what samples the byte source has already loaded.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/decodeTimeOfLastSampleReachableByForwardSteppingThatIsAlreadyLoadedByByteSource

func (MESampleCursorObject) DecodeTimeStamp

func (o MESampleCursorObject) DecodeTimeStamp() coremedia.CMTime

The decode timestamp (DTS) of the sample at the current position of the cursor.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/decodeTimeStamp

func (MESampleCursorObject) DependencyInfo

Dependency information about the sample the cursor points to.

Discussion

This value includes any valid flags set. Don’t implement this property if this kind of dependency information doesn’t make sense for the sequence of samples.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/dependencyInfo

func (MESampleCursorObject) EstimatedSampleLocationReturningError

func (o MESampleCursorObject) EstimatedSampleLocationReturningError() (IMEEstimatedSampleLocation, error)

Returns an estimate of the sample location indicated by the cursor.

Return Value

An object that provides information about the estimated sample location.

Discussion

Some formats may need to read some data on a per-sample basis to produce the exact sample location. For these formats, it’s more efficient to read a larger chunk of data that contains both the data to produce the exact sample location and the actual sample data.

Pass the value this method returns to [RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError] to obtain the exact sample location.

To indicate that refinement isn’t necessary, return a value for MEEstimatedSampleLocation.RefinementDataLocation that has a zero length. If MEEstimatedSampleLocation.RefinementDataLocation has a non-zero length, the range for the estimated sample location needs to fully cover the refined range that [RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError] returns, and the refinement data location.

This method fails with the error MEError.Code.locationNotAvailable if the sample location indicated by the cursor isn’t contiguous or the method isn’t supported. In this case, use [LoadSampleBufferContainingSamplesToEndCursorCompletionHandler] to load the sample data.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/estimatedSampleLocation()

func (MESampleCursorObject) HevcDependencyInfo

func (o MESampleCursorObject) HevcDependencyInfo() IMEHEVCDependencyInfo

Additional information that’s necessary to recover complete sample dependency information.

Discussion

This is an optional property that provides additional sample dependency information that [SyncInfo] and [DependencyInfo] don’t provide. Examples of this are the NAL unit type of an HEVC sync sample or the number of samples necessary to refresh the decoder after a USAC independent frame. Don’t implement this property for formats where this information doesn’t make sense.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/hevcDependencyInfo

func (MESampleCursorObject) LoadSampleBufferContainingSamplesToEndCursorCompletionHandler

func (o MESampleCursorObject) LoadSampleBufferContainingSamplesToEndCursorCompletionHandler(endSampleCursor MESampleCursor, completionHandler CMSampleBufferRefErrorHandler)

Builds a sample buffer that contains the samples at the cursor that you specify.

endSampleCursor: If not `nil`, this cursor indicates the last sample that the new sample buffer should contain.

completionHandler: The completion block to execute when the load operation finishes.

Discussion

Plugin format readers that don’t implement [SampleLocationReturningError] or that always load sample data to answer cursor queries need to implement this method. If a plug-in format reader implements [SampleLocationReturningError], implementing [LoadSampleBufferContainingSamplesToEndCursorCompletionHandler] is optional.

If there’s no sample data between the sample cursor and `endSampleCursor`, the sample buffer is empty. If an error occurs, the sample buffer is `nil`.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/loadSampleBufferContainingSamples(to:completionHandler:)

func (MESampleCursorObject) PresentationTimeStamp

func (o MESampleCursorObject) PresentationTimeStamp() coremedia.CMTime

The presentation timestamp (PTS) of the sample at the current position of the cursor.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/presentationTimeStamp

func (MESampleCursorObject) RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError

func (o MESampleCursorObject) RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError(estimatedSampleLocation avfoundation.AVSampleCursorStorageRange, refinementData *uint8, refinementDataLength uintptr, refinedLocationOut *avfoundation.AVSampleCursorStorageRange) (bool, error)

Produces an exact sample location based on the estimated sample location and refinement data that you specify.

estimatedSampleLocation: The estimated sample location.

refinementData: The refinement data.

refinementDataLength: The length of the refinement data in bytes.

refinedLocationOut: The starting file offset and size of the sample in bytes.

Discussion

Use [EstimatedSampleLocationReturningError] to obtain the estimated sample location to pass to this method.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)

func (MESampleCursorObject) SampleLocationReturningError

func (o MESampleCursorObject) SampleLocationReturningError() (IMESampleLocation, error)

Returns the location and byte source of the sample indicated by the cursor.

Return Value

A sample location.

Discussion

Sample data needs to be contiguous. If the sample data isn’t contiguous or the cursor doesn’t support this method, it fails with the error MEError.Code.locationNotAvailable. In this case, use [LoadSampleBufferContainingSamplesToEndCursorCompletionHandler] to load the data.

If it’s not possible to implement this method, implement [EstimatedSampleLocationReturningError] to get an estimated sample location, and [RefineSampleLocationRefinementDataRefinementDataLengthRefinedLocationError] to analyze this data and provide precise location and size info.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/sampleLocation()

func (MESampleCursorObject) SamplesWithEarlierDTSsMayHaveLaterPTSsThanCursor

func (o MESampleCursorObject) SamplesWithEarlierDTSsMayHaveLaterPTSsThanCursor(cursor MESampleCursor) bool

Tests for an earlier boundary in sample reordering.

cursor: A sample cursor to use to test the sample reordering boundary.

Return Value

true if it’s possible that earlier samples in decode order can have a later presentation timestamp than that of the specified cursor; otherwise false.

Discussion

This method tests for a boundary in the reordering from decode order to presentation order. This determines when it’s possible for any sample earlier in decode order than the current sample to have a later presentation time than the current sample of the specified cursor. You can use this test to limit backward scans, such as to start forward playback. For example, with the argument cursor fixed, step the cursor backward until it’s impossible for any earlier-in-decode-order samples to be later-in-presentation-order than the argument cursor sample.

Don’t implement this method for formats where sample reordering doesn’t make sense for the track content, which also indicates that the samples aren’t reordered.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/samplesWithEarlierDTSsMayHaveLaterPTSs(than:)

func (MESampleCursorObject) SamplesWithLaterDTSsMayHaveEarlierPTSsThanCursor

func (o MESampleCursorObject) SamplesWithLaterDTSsMayHaveEarlierPTSsThanCursor(cursor MESampleCursor) bool

Tests for a later boundary in sample reordering.

cursor: A sample cursor to use to test the sample reordering boundary.

Return Value

true if it’s possible that later samples in decode order can have an earlier presentation timestamp than that of the specified cursor; otherwise false.

Discussion

This method tests for a boundary in the reordering from decode order to presentation order. This determines when it’s possible for any sample later in decode order than the current sample to have an earllier presentation time than the current sample of the specified cursor. You can use this test to limit backward scans, such as to start forward playback. For example, with the argument cursor fixed, step the cursor forward until it’s impossible for any later-in-decode-order samples to be earlier-in-presentation-order than the argument cursor sample.

Don’t implement this method for formats where sample reordering doesn’t make sense for the track content, which also indicates that the samples aren’t reordered.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/samplesWithLaterDTSsMayHaveEarlierPTSs(than:)

func (MESampleCursorObject) StepInDecodeOrderByCountCompletionHandler

func (o MESampleCursorObject) StepInDecodeOrderByCountCompletionHandler(stepCount int64, completionHandler int64_tErrorHandler)

Moves the cursor a given number of samples in decode order.

stepCount: The number of samples to move. If positive, the cursor steps forward. If negative, the cursor steps backward.

completionHandler: The completion block to execute when the move operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/stepInDecodeOrder(by:completionHandler:)

func (MESampleCursorObject) StepInPresentationOrderByCountCompletionHandler

func (o MESampleCursorObject) StepInPresentationOrderByCountCompletionHandler(stepCount int64, completionHandler int64_tErrorHandler)

Moves the cursor a given number of samples in presentation order.

stepCount: The number of samples to move. If positive, the cursor steps forward. If negative, the cursor steps backward.

completionHandler: The completion block to execute when the move operation finishes.

Discussion

If the request would advance the cursor past the last sample or before the first sample, the cursor points to that limiting sample and `actualStepCount` is equal to the number of samples the cursor moved. If decode order and presentation order are the same, in other words, the samples aren’t reordered, this method has the same effect as stepInDecodeOrder(byCount:).

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/stepInPresentationOrder(by:completionHandler:)

func (MESampleCursorObject) SyncInfo

Decoder synchronization information about the sample the cursor points to.

Discussion

This value includes any valid flags set. Don’t implement this property if this kind of synchronization information doesn’t make sense for the sequence of samples.

See: https://developer.apple.com/documentation/MediaExtension/MESampleCursor/syncInfo

type MESampleLocation

type MESampleLocation struct {
	objectivec.Object
}

An object that provides information about the sample location with the media.

Creating a sample location

Inspecting a sample location

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation

func MESampleLocationFromID

func MESampleLocationFromID(id objc.ID) MESampleLocation

MESampleLocationFromID constructs a MESampleLocation from an objc.ID.

An object that provides information about the sample location with the media.

func NewMESampleLocation

func NewMESampleLocation() MESampleLocation

NewMESampleLocation creates a new MESampleLocation instance.

func NewMESampleLocationWithByteSourceSampleLocation

func NewMESampleLocationWithByteSourceSampleLocation(byteSource IMEByteSource, sampleLocation avfoundation.AVSampleCursorStorageRange) MESampleLocation

Creates a sample location object with the byte source and sample location that you specify.

byteSource: The byte source to use to read the data for the sample.

sampleLocation: The starting file offset and size in bytes of the sample.

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation/init(byteSource:sampleLocation:)

func (MESampleLocation) Autorelease

func (m MESampleLocation) Autorelease() MESampleLocation

Autorelease adds the receiver to the current autorelease pool.

func (MESampleLocation) ByteSource

func (m MESampleLocation) ByteSource() IMEByteSource

The byte source to use to read the data for the sample.

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation/byteSource

func (MESampleLocation) Init

Init initializes the instance.

func (MESampleLocation) InitWithByteSourceSampleLocation

func (m MESampleLocation) InitWithByteSourceSampleLocation(byteSource IMEByteSource, sampleLocation avfoundation.AVSampleCursorStorageRange) MESampleLocation

Creates a sample location object with the byte source and sample location that you specify.

byteSource: The byte source to use to read the data for the sample.

sampleLocation: The starting file offset and size in bytes of the sample.

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation/init(byteSource:sampleLocation:)

func (MESampleLocation) SampleLocation

The starting file offset and size in bytes of the sample.

See: https://developer.apple.com/documentation/MediaExtension/MESampleLocation/sampleLocation

type MESampleLocationClass

type MESampleLocationClass struct {
	// contains filtered or unexported fields
}

func GetMESampleLocationClass

func GetMESampleLocationClass() MESampleLocationClass

GetMESampleLocationClass returns the class object for MESampleLocation.

func (MESampleLocationClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MESampleLocationClass) Class

func (mc MESampleLocationClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type METrackInfo

type METrackInfo struct {
	objectivec.Object
}

An object that includes track properties parsed from the media asset.

Inspecting track information

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo

func METrackInfoFromID

func METrackInfoFromID(id objc.ID) METrackInfo

METrackInfoFromID constructs a METrackInfo from an objc.ID.

An object that includes track properties parsed from the media asset.

func NewMETrackInfo

func NewMETrackInfo() METrackInfo

NewMETrackInfo creates a new METrackInfo instance.

func (METrackInfo) Autorelease

func (m METrackInfo) Autorelease() METrackInfo

Autorelease adds the receiver to the current autorelease pool.

func (METrackInfo) ExtendedLanguageTag

func (m METrackInfo) ExtendedLanguageTag() string

A string that indicates the language tag associated with the track, as an IETF BCP 47 (RFC 4646) language identifier.

Discussion

[MediaToolbox] uses this property to group similar language tracks together or to match audio and caption tracks. Set this value to `nil` if the track doesn’t have a language tag.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/extendedLanguageTag

func (METrackInfo) Init

func (m METrackInfo) Init() METrackInfo

Init initializes the instance.

func (METrackInfo) IsEnabled

func (m METrackInfo) IsEnabled() bool

A Boolean value that indicates whether the track is enabled by default.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/isEnabled

func (METrackInfo) MediaType

func (m METrackInfo) MediaType() coremedia.CMMediaType

The media type of the track.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/mediaType

func (METrackInfo) NaturalSize

func (m METrackInfo) NaturalSize() corefoundation.CGSize

Indicates the natural dimensions of the media data referenced by the track.

Discussion

This property is only valid for tracks with visual media types and is zero for other track types.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/naturalSize

func (METrackInfo) NaturalTimescale

func (m METrackInfo) NaturalTimescale() coremedia.CMTimeScale

The natural timescale of the track.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/naturalTimescale

func (METrackInfo) NominalFrameRate

func (m METrackInfo) NominalFrameRate() float32

The frame rate of the track in frames per second, as a 32-bit floating point number.

Discussion

For field-based video tracks that carry one field per media sample, the value of this property is the field rate, not the frame rate. [MediaToolbox] uses this property to calculate the maximum playback speed.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/nominalFrameRate

func (METrackInfo) PreferredTransform

func (m METrackInfo) PreferredTransform() corefoundation.CGAffineTransform

Indicates the preferred affine display transform of the track media for visual display.

Discussion

This property is only valid for tracks with visual media types and is CGAffineTransformIdentity for other track types.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/preferredTransform

func (METrackInfo) RequiresFrameReordering

func (m METrackInfo) RequiresFrameReordering() bool

A Boolean value that indicates whether frame reordering occurs in the track.

Discussion

The value is true if frame reordering occurs, otherwise false. This property is only valid for tracks with video media type and is false for other track types.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/requiresFrameReordering

func (METrackInfo) SetEnabled

func (m METrackInfo) SetEnabled(value bool)

func (METrackInfo) SetExtendedLanguageTag

func (m METrackInfo) SetExtendedLanguageTag(value string)

func (METrackInfo) SetNaturalSize

func (m METrackInfo) SetNaturalSize(value corefoundation.CGSize)

func (METrackInfo) SetNaturalTimescale

func (m METrackInfo) SetNaturalTimescale(value coremedia.CMTimeScale)

func (METrackInfo) SetNominalFrameRate

func (m METrackInfo) SetNominalFrameRate(value float32)

func (METrackInfo) SetPreferredTransform

func (m METrackInfo) SetPreferredTransform(value corefoundation.CGAffineTransform)

func (METrackInfo) SetRequiresFrameReordering

func (m METrackInfo) SetRequiresFrameReordering(value bool)

func (METrackInfo) TrackID

An integer that identifies the track within the media asset.

Discussion

The track ID uniquely identifes the track within a MEFormatReader object. Track IDs must be unique within a media asset but don’t need to be unique across assets. If a media format doesn’t have a native concept of track IDs, track IDs can start from `1`. However, track ID `0` is a reserved value to indicate an invalid track ID.

See: https://developer.apple.com/documentation/MediaExtension/METrackInfo/trackID

type METrackInfoClass

type METrackInfoClass struct {
	// contains filtered or unexported fields
}

func GetMETrackInfoClass

func GetMETrackInfoClass() METrackInfoClass

GetMETrackInfoClass returns the class object for METrackInfo.

func (METrackInfoClass) Alloc

func (mc METrackInfoClass) Alloc() METrackInfo

Alloc allocates memory for a new instance of the class.

func (METrackInfoClass) Class

func (mc METrackInfoClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type METrackInfoErrorHandler

type METrackInfoErrorHandler = func(*METrackInfo, error)

METrackInfoErrorHandler handles The completion block to execute when the load operation finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.

Used by:

type METrackReader

type METrackReader interface {
	objectivec.IObject

	// Loads the track info object with the properties of the media asset track.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/METrackReader/loadTrackInfo(completionHandler:)
	LoadTrackInfoWithCompletionHandler(completionHandler METrackInfoErrorHandler)

	// Provides a new sample cursor that points to the sample at or near the specified presentation timestamp.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursor(atPresentationTimeStamp:completionHandler:)
	GenerateSampleCursorAtPresentationTimeStampCompletionHandler(presentationTimeStamp coremedia.CMTime, completionHandler MESampleCursorErrorHandler)

	// Provides a new sample cursor that points to the first sample in decode order.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursorAtFirstSampleInDecodeOrder(completionHandler:)
	GenerateSampleCursorAtFirstSampleInDecodeOrderWithCompletionHandler(completionHandler MESampleCursorErrorHandler)

	// Provides a new sample cursor that points to the last sample in decode order.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursorAtLastSampleInDecodeOrder(completionHandler:)
	GenerateSampleCursorAtLastSampleInDecodeOrderWithCompletionHandler(completionHandler MESampleCursorErrorHandler)
}

A protocol that defines the information to provide about a track within a media asset.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader

type METrackReaderObject

type METrackReaderObject struct {
	objectivec.Object
}

METrackReaderObject wraps an existing Objective-C object that conforms to the METrackReader protocol.

func METrackReaderObjectFromID

func METrackReaderObjectFromID(id objc.ID) METrackReaderObject

METrackReaderObjectFromID constructs a METrackReaderObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (METrackReaderObject) BaseObject

func (o METrackReaderObject) BaseObject() objectivec.Object

func (METrackReaderObject) GenerateSampleCursorAtFirstSampleInDecodeOrderWithCompletionHandler

func (o METrackReaderObject) GenerateSampleCursorAtFirstSampleInDecodeOrderWithCompletionHandler(completionHandler MESampleCursorErrorHandler)

Provides a new sample cursor that points to the first sample in decode order.

completionHandler: The completion block to execute when the generate operation finishes.

Discussion

The new sample cursor points to the first sample in decode order, regardless of presentation time stamp (PTS).

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursorAtFirstSampleInDecodeOrder(completionHandler:)

func (METrackReaderObject) GenerateSampleCursorAtLastSampleInDecodeOrderWithCompletionHandler

func (o METrackReaderObject) GenerateSampleCursorAtLastSampleInDecodeOrderWithCompletionHandler(completionHandler MESampleCursorErrorHandler)

Provides a new sample cursor that points to the last sample in decode order.

completionHandler: The completion block to execute when the generate operation finishes.

Discussion

The new sample cursor points to the last sample in decode order, regardless of presentation time stamp (PTS).

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursorAtLastSampleInDecodeOrder(completionHandler:)

func (METrackReaderObject) GenerateSampleCursorAtPresentationTimeStampCompletionHandler

func (o METrackReaderObject) GenerateSampleCursorAtPresentationTimeStampCompletionHandler(presentationTimeStamp coremedia.CMTime, completionHandler MESampleCursorErrorHandler)

Provides a new sample cursor that points to the sample at or near the specified presentation timestamp.

presentationTimeStamp: The presentation time stamp.

completionHandler: The completion block to execute when the generate operation finishes.

Discussion

The new sample cursor points to the last sample with a presentation time stamp (PTS) less than or equal to `presentationTimeStamp`, or if there are no such samples, the first sample in PTS order.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/generateSampleCursor(atPresentationTimeStamp:completionHandler:)

func (METrackReaderObject) LoadEstimatedDataRateWithCompletionHandler

func (o METrackReaderObject) LoadEstimatedDataRateWithCompletionHandler(completionHandler Float32ErrorHandler)

Loads the approximate data rate of the track in bytes per second.

completionHandler: The completion block to execute when the load operation finishes.

Discussion

If this method fails, it sets `estimatedDataRate` to `0.0` and the error contains information about the failure.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/loadEstimatedDataRate(completionHandler:)

func (METrackReaderObject) LoadMetadataWithCompletionHandler

func (o METrackReaderObject) LoadMetadataWithCompletionHandler(completionHandler AVMetadataItemArrayErrorHandler)

Loads the array of metadata items from the media asset track.

completionHandler: The completion block to execute when the load operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/loadMetadata(completionHandler:)

func (METrackReaderObject) LoadTotalSampleDataLengthWithCompletionHandler

func (o METrackReaderObject) LoadTotalSampleDataLengthWithCompletionHandler(completionHandler int64_tErrorHandler)

Loads the total size in bytes of all the samples in the track.

completionHandler: The completion block to execute when the load operation finishes.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/loadTotalSampleDataLength(completionHandler:)

func (METrackReaderObject) LoadTrackInfoWithCompletionHandler

func (o METrackReaderObject) LoadTrackInfoWithCompletionHandler(completionHandler METrackInfoErrorHandler)

Loads the track info object with the properties of the media asset track.

completionHandler: The completion block to execute when the load operation finishes.

Discussion

If this method fails to create a track info object, it returns `nil` and the error contains information about the failure.

See: https://developer.apple.com/documentation/MediaExtension/METrackReader/loadTrackInfo(completionHandler:)

type MEVideoDecoder

type MEVideoDecoder interface {
	objectivec.IObject

	// Requests the extension to decode a video frame.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/decodeFrame(from:options:completionHandler:)
	DecodeFrameFromSampleBufferOptionsCompletionHandler(sampleBuffer coremedia.CMSampleBufferRef, options IMEDecodeFrameOptions, completionHandler CVImageBufferRefMEDecodeFrameStatusErrorHandler)

	// A Boolean that specifies whether the content has interframe dependencies, if the decoder knows.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/contentHasInterframeDependencies
	ContentHasInterframeDependencies() bool

	// The recommended number of threads for the decoder to use.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/recommendedThreadCount
	RecommendedThreadCount() int
	SetRecommendedThreadCount(value int)

	// The actual number of threads the decoder uses.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/actualThreadCount
	ActualThreadCount() int

	// Provides hints about quality tradeoffs between pixel formats.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/supportedPixelFormatsOrderedByQuality
	SupportedPixelFormatsOrderedByQuality() []foundation.NSNumber

	// A request to decode at a lower resolution than full-size.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/reducedResolution
	ReducedResolution() corefoundation.CGSize
	SetReducedResolution(value corefoundation.CGSize)

	// Provides a list of output pixel formats where the decoder supports reduced resolution decoding.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/pixelFormatsWithReducedResolutionDecodeSupport
	PixelFormatsWithReducedResolutionDecodeSupport() []foundation.NSNumber

	// Indicates whether the decoder produces RAW output which requires the use of a RAW processor.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/producesRAWOutput
	ProducesRAWOutput() bool

	// A Boolean value that indicates the readiness of the decoder to accept more sample buffers.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/isReadyForMoreMediaData
	IsReadyForMoreMediaData() bool
}

A protocol that defines the requirements for a video decoder.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder

type MEVideoDecoderExtension

type MEVideoDecoderExtension interface {
	objectivec.IObject

	// Creates a new video decoder that matches the codec type, format description, decoder specifications, and pixel buffer manager that you specify.
	//
	// See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderExtension/makeVideoDecoder(codecType:videoFormatDescription:videoDecoderSpecifications:pixelBufferManager:)
	VideoDecoderWithCodecTypeVideoFormatDescriptionVideoDecoderSpecificationsExtensionDecoderPixelBufferManagerError(codecType coremedia.CMVideoCodecType, videoFormatDescription coremedia.CMVideoFormatDescriptionRef, videoDecoderSpecifications foundation.INSDictionary, extensionDecoderPixelBufferManager IMEVideoDecoderPixelBufferManager) (MEVideoDecoder, error)
}

A protocol that defines a factory to create new video decoders for a codec type that the extension implements.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderExtension

type MEVideoDecoderExtensionObject

type MEVideoDecoderExtensionObject struct {
	objectivec.Object
}

MEVideoDecoderExtensionObject wraps an existing Objective-C object that conforms to the MEVideoDecoderExtension protocol.

func MEVideoDecoderExtensionObjectFromID

func MEVideoDecoderExtensionObjectFromID(id objc.ID) MEVideoDecoderExtensionObject

MEVideoDecoderExtensionObjectFromID constructs a MEVideoDecoderExtensionObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MEVideoDecoderExtensionObject) BaseObject

func (MEVideoDecoderExtensionObject) VideoDecoderWithCodecTypeVideoFormatDescriptionVideoDecoderSpecificationsExtensionDecoderPixelBufferManagerError

func (o MEVideoDecoderExtensionObject) VideoDecoderWithCodecTypeVideoFormatDescriptionVideoDecoderSpecificationsExtensionDecoderPixelBufferManagerError(codecType coremedia.CMVideoCodecType, videoFormatDescription coremedia.CMVideoFormatDescriptionRef, videoDecoderSpecifications foundation.INSDictionary, extensionDecoderPixelBufferManager IMEVideoDecoderPixelBufferManager) (MEVideoDecoder, error)

Creates a new video decoder that matches the codec type, format description, decoder specifications, and pixel buffer manager that you specify.

codecType: The codec type for the requested decoder.

videoFormatDescription: An object that describes the video data.

videoDecoderSpecifications: A dictionary that contains video decoder specification values, which may be empty. See Decompression Properties for a list of keys to use.

extensionDecoderPixelBufferManager: A pixel buffer manager.

Return Value

A new MEVideoDecoder.

Discussion

The `videoDecoderSpecifications` parameter accepts the following keys:

- kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder - kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder - kVTVideoDecoderSpecification_RequiredDecoderGPURegistryID - kVTVideoDecoderSpecification_PreferredDecoderGPURegistryID

If the parameter values aren’t compatible with the video decoder, this method fails with the error MEError.Code.unsupportedFeature.

The video decoder needs to retain the pixel buffer manager and use it to allocate and configure output pixel buffers.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderExtension/makeVideoDecoder(codecType:videoFormatDescription:videoDecoderSpecifications:pixelBufferManager:)

type MEVideoDecoderObject

type MEVideoDecoderObject struct {
	objectivec.Object
}

MEVideoDecoderObject wraps an existing Objective-C object that conforms to the MEVideoDecoder protocol.

func MEVideoDecoderObjectFromID

func MEVideoDecoderObjectFromID(id objc.ID) MEVideoDecoderObject

MEVideoDecoderObjectFromID constructs a MEVideoDecoderObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (MEVideoDecoderObject) ActualThreadCount

func (o MEVideoDecoderObject) ActualThreadCount() int

The actual number of threads the decoder uses.

Discussion

The system queries this property on the extension when Video Toolbox queries the kVTDecompressionPropertyKey_ThreadCount on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/actualThreadCount

func (MEVideoDecoderObject) BaseObject

func (o MEVideoDecoderObject) BaseObject() objectivec.Object

func (MEVideoDecoderObject) CanAcceptFormatDescription

func (o MEVideoDecoderObject) CanAcceptFormatDescription(formatDescription coremedia.CMFormatDescriptionRef) bool

Asks the extension whether the decoder can decode frames with the format description that you specify.

formatDescription: The new format description to evaluate.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/canAccept(_:)

func (MEVideoDecoderObject) ContentHasInterframeDependencies

func (o MEVideoDecoderObject) ContentHasInterframeDependencies() bool

A Boolean that specifies whether the content has interframe dependencies, if the decoder knows.

Discussion

The system queries this property on the extension when Video Toolbox queries the kVTDecompressionPropertyKey_ContentHasInterframeDependencies on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/contentHasInterframeDependencies

func (MEVideoDecoderObject) DecodeFrameFromSampleBufferOptionsCompletionHandler

func (o MEVideoDecoderObject) DecodeFrameFromSampleBufferOptionsCompletionHandler(sampleBuffer coremedia.CMSampleBufferRef, options IMEDecodeFrameOptions, completionHandler CVImageBufferRefMEDecodeFrameStatusErrorHandler)

Requests the extension to decode a video frame.

sampleBuffer: A sample buffer that contains one video frame.

options: Specific decode options for the frame.

completionHandler: The completion block to execute when the decode operation finishes.

Discussion

This method calls the completion handler for every sample buffer frame when decoding completes, but not necessarily in display order. The completion handler receives a decoded pixel buffer, a decode status that indicates a frame dropped, or an error. Use MEVideoDecoderPixelBufferManager to allocate an image buffer. If an error occurs that’s external to MediaExtensionErrorDomain, the VTDecompressionSession receives it as kVTVideoDecoderUnknownErr.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/decodeFrame(from:options:completionHandler:)

func (MEVideoDecoderObject) IsReadyForMoreMediaData

func (o MEVideoDecoderObject) IsReadyForMoreMediaData() bool

A Boolean value that indicates the readiness of the decoder to accept more sample buffers.

Discussion

Video decoders which operate asynchronously often have a fixed capacity for buffers in flight in the decoder. This property allows the decoder to signal to Video Toolbox that its internal buffers are full and it can’t accept more samples. The decoder needs to use MEVideoDecoderReadyForMoreMediaDataDidChangeNotification to notify Video Toolbox when this property changes.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/isReadyForMoreMediaData

func (MEVideoDecoderObject) PixelFormatsWithReducedResolutionDecodeSupport

func (o MEVideoDecoderObject) PixelFormatsWithReducedResolutionDecodeSupport() []foundation.NSNumber

Provides a list of output pixel formats where the decoder supports reduced resolution decoding.

Discussion

This array contains CMPixelFormatType values. The system queries this property on the extension when Video Toolbox queries the kVTDecompressionPropertyKey_PixelFormatsWithReducedResolutionSupport on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/pixelFormatsWithReducedResolutionDecodeSupport

func (MEVideoDecoderObject) ProducesRAWOutput

func (o MEVideoDecoderObject) ProducesRAWOutput() bool

Indicates whether the decoder produces RAW output which requires the use of a RAW processor.

Discussion

The extension should implement this property returning YES if the decoder produces RAW output which requires the use of an MERAWProcessor for post-decode processing to produce renderable output.

This optional property is queried on the extension when a Video Toolbox client queries the kVTDecompressionPropertyKey_DecoderProducesRAWOutput property on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/producesRAWOutput

func (MEVideoDecoderObject) RecommendedThreadCount

func (o MEVideoDecoderObject) RecommendedThreadCount() int

The recommended number of threads for the decoder to use.

Discussion

The system sets this property on the extension when Video Toolbox sets kVTDecompressionPropertyKey_ThreadCount on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/recommendedThreadCount

func (MEVideoDecoderObject) ReducedResolution

func (o MEVideoDecoderObject) ReducedResolution() corefoundation.CGSize

A request to decode at a lower resolution than full-size.

Discussion

This optional property conveys a request for reduced resolution for decoding. Decoders that only support a fixed set of resolutions should pick the smallest resolution greater than or equal to the requested width and height. If the output CVPixelBuffer is not in a format where reduced resolution decoding is supported, this setting should be disregarded. This property is set on the extension when a Video Toolbox client sets the kVTDecompressionPropertyKey_ReducedResolutionDecode property on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/reducedResolution

func (MEVideoDecoderObject) SetRecommendedThreadCount

func (o MEVideoDecoderObject) SetRecommendedThreadCount(value int)

func (MEVideoDecoderObject) SetReducedResolution

func (o MEVideoDecoderObject) SetReducedResolution(value corefoundation.CGSize)

func (MEVideoDecoderObject) SupportedPixelFormatsOrderedByQuality

func (o MEVideoDecoderObject) SupportedPixelFormatsOrderedByQuality() []foundation.NSNumber

Provides hints about quality tradeoffs between pixel formats.

Discussion

This array contains CMPixelFormatType values, ordered by quality from best to worst. The system queries this property on the extension when Video Toolbox queries the kVTDecompressionPropertyKey_SupportedPixelFormatsOrderedByQuality on the hosting VTDecompressionSession.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoder/supportedPixelFormatsOrderedByQuality

type MEVideoDecoderPixelBufferManager

type MEVideoDecoderPixelBufferManager struct {
	objectivec.Object
}

Describes pixel buffer requirements and creates new pixel buffers.

Discussion

Contains the interfaces that the MEVideoDecoder uses for two tasks. First, to declare its set of requirements for output [CVPixelBuffer] objects in the form of a MEVideoDecoderPixelBufferManager.PixelBufferAttributes dictionary. Second, to create pixel buffers that match decoder output requirements but also satisfy Video Toolbox and client requirements.

Creating a pixel buffer

Registering Custom Pixel Formats

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderPixelBufferManager

func MEVideoDecoderPixelBufferManagerFromID

func MEVideoDecoderPixelBufferManagerFromID(id objc.ID) MEVideoDecoderPixelBufferManager

MEVideoDecoderPixelBufferManagerFromID constructs a MEVideoDecoderPixelBufferManager from an objc.ID.

Describes pixel buffer requirements and creates new pixel buffers.

func NewMEVideoDecoderPixelBufferManager

func NewMEVideoDecoderPixelBufferManager() MEVideoDecoderPixelBufferManager

NewMEVideoDecoderPixelBufferManager creates a new MEVideoDecoderPixelBufferManager instance.

func (MEVideoDecoderPixelBufferManager) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (MEVideoDecoderPixelBufferManager) CreatePixelBufferAndReturnError

func (m MEVideoDecoderPixelBufferManager) CreatePixelBufferAndReturnError() (corevideo.CVImageBufferRef, error)

Generates a pixel buffer using the session’s pixel buffer pool.

Return Value

A pixel buffer that’s compatible with the extension’s most recently set pixel buffer attributes.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderPixelBufferManager/makePixelBuffer()

func (MEVideoDecoderPixelBufferManager) Init

Init initializes the instance.

func (MEVideoDecoderPixelBufferManager) PixelBufferAttributes

func (m MEVideoDecoderPixelBufferManager) PixelBufferAttributes() foundation.INSDictionary

A dictionary that contains the attributes Video Toolbox uses to create a pixel buffer for the decoder.

Discussion

The decoder can update this dictionary before it requests a new pixel buffer.

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderPixelBufferManager/pixelBufferAttributes

func (MEVideoDecoderPixelBufferManager) RegisterCustomPixelFormat

func (m MEVideoDecoderPixelBufferManager) RegisterCustomPixelFormat(customPixelFormat foundation.INSDictionary)

customPixelFormat: A dictionary containing a set of keys and values as described in CVPixelFormatDescription suitable for providing as the ‘description’ parameter to CVPixelFormatDescriptionCreateWithPixelFormatType(_:_:). This must contain the custom pixel format fourCC as the value for the `kCVPixelFormatCodecType` key.

Discussion

This property is appropriate for decoders which produce output in a custom pixel format. This will generally only be used by decoders which produce RAW output, where the decoder’s output buffers will only be consumed by an MERAWProcessor extension which registers the same pixel format. The MERAWProcessor needs to manually register the custom pixel format using CVPixelFormatDescriptionCreateWithPixelFormatType(_:_:).

See: https://developer.apple.com/documentation/MediaExtension/MEVideoDecoderPixelBufferManager/registerCustomPixelFormat(_:)

func (MEVideoDecoderPixelBufferManager) SetPixelBufferAttributes

func (m MEVideoDecoderPixelBufferManager) SetPixelBufferAttributes(value foundation.INSDictionary)

type MEVideoDecoderPixelBufferManagerClass

type MEVideoDecoderPixelBufferManagerClass struct {
	// contains filtered or unexported fields
}

func GetMEVideoDecoderPixelBufferManagerClass

func GetMEVideoDecoderPixelBufferManagerClass() MEVideoDecoderPixelBufferManagerClass

GetMEVideoDecoderPixelBufferManagerClass returns the class object for MEVideoDecoderPixelBufferManager.

func (MEVideoDecoderPixelBufferManagerClass) Alloc

Alloc allocates memory for a new instance of the class.

func (MEVideoDecoderPixelBufferManagerClass) Class

Class returns the underlying Objective-C class pointer.

type StringidDictionaryErrorHandler

type StringidDictionaryErrorHandler = func(*foundation.INSDictionary, error)

StringidDictionaryErrorHandler handles The handler that will be invoked when the method completes.

Used by:

  • [MESampleCursor.LoadPostDecodeProcessingMetadataWithCompletionHandler]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL