Platforms to show: All Mac Windows Linux Cross-Platform
Back to AVSampleBufferDisplayLayerMBS class.
AVSampleBufferDisplayLayerMBS.Constructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
AVSampleBufferDisplayLayerMBS.enqueueSampleBuffer(sampleBuffer as CMSampleBufferMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If sampleBuffer has the kCMSampleAttachmentKey_DoNotDisplay attachment set to True, the frame will be decoded but not displayed. Otherwise, if sampleBuffer has the kCMSampleAttachmentKey_DisplayImmediately attachment set to True, the decoded image will be displayed as soon as possible, replacing all previously enqueued images regardless of their timestamps. Otherwise, the decoded image will be displayed at sampleBuffer's output presentation timestamp, as interpreted by the control timebase (or the mach_absolute_time timeline if there is no control timebase). To schedule the removal of previous images at a specific timestamp, enqueue a marker sample buffer containing no samples, with the kCMSampleBufferAttachmentKey_EmptyMedia attachment set to kCFBooleanTrue. IMPORTANT NOTE: attachments with the kCMSampleAttachmentKey_ prefix must be set via CMSampleBufferGetSampleAttachmentsArray and CFDictionarySetValue. Attachments with the kCMSampleBufferAttachmentKey_ prefix must be set via CMSetAttachment.
AVSampleBufferDisplayLayerMBS.flush
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
It is not possible to determine which sample buffers have been decoded, so the next frame passed to enqueueSampleBuffer should be an IDR frame (also known as a key frame or sync sample).
AVSampleBufferDisplayLayerMBS.flushAndRemoveImage
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
It is not possible to determine which sample buffers have been decoded, so the next frame passed to enqueueSampleBuffer should be an IDR frame (also known as a key frame or sync sample).
AVSampleBufferDisplayLayerMBS.requestMediaDataWhenReady(tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The block should enqueue sample buffers to the layer either until the layer's readyForMoreMediaData property becomes false or until there is no more data to supply. When the layer has decoded enough of the media data it has received that it becomes ready for more media data again, it will invoke the block again in order to obtain more. If this function is called multiple times, only the last call is effective.
Call stopRequestingMediaData to cancel this request.
Each call to requestMediaDataWhenReady should be paired
with a corresponding call to stopRequestingMediaData. Releasing the
AVSampleBufferDisplayLayer without a call to stopRequestingMediaData will result in undefined behavior.
Calls SampleBufferDisplayLayerMediaDataWhenReady event on AVFoundationMBS class.
With tag you can pass any value you like to the event later. This can be for example an object reference or a number in an array. Be aware that the reference to this tag value is kept until the event is called and can cause memory reference cycles.
AVSampleBufferDisplayLayerMBS.stopRequestingMediaData
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This method may be called from outside the block or from within the block.
The items on this page are in the following plugins: MBS AVFoundation Plugin.