Skip to main content

FREMediaBufferLock

Function FREMediaBufferLock 

Source
pub unsafe extern "C" fn FREMediaBufferLock(
    ctx: FREContext,
    mediaBuffer: FREObject,
    pData: *mut FREBytes,
    pWidth: *mut u32,
    pHeight: *mut u32,
    pStride: *mut u32,
    pFormat: *mut u32,
) -> FREResult
Expand description

Locks a MediaBuffer bitmap and returns information about the data storage.

Note that for every call to FREMediaBufferLock, a corresponding call to FREMediaBufferUnlock must be made. Ideally this would be as swift as possible, as locking a media buffer would impact rendering of any bitmap it contains. The unlock must be called prior to returning from the ANE function call though.

§Parameters

  • ctx: The FREContext for the native extension instance.
  • mediaBuffer: The AS3 MediaBuffer object for which the image data is requested.
  • pData: Pointer to a byte pointer that will be set to the internal image data.
  • pWidth: Pointer to a value that will be set to the width of the image data.
  • pHeight: Pointer to a value that will be set to the height of the image data.
  • pStride: Pointer to a value that will be set to the stride i.e. number of bytes between the start of each row on the image.
  • pFormat: Pointer to a value that will be set to a format value (for future usage: currently images are ARGB format).

§Returns