Skip to main content
Version: 10 Jul 2024

MLNativeSurfaceOnFrameAvailableCallback

Module: Media Player

Callbacks for notifying when an output frame is available for consumption. More...

#include <ml_native_surface.h>

Public Attributes

TypeName
uint32_tversion
void()(MLHandle handle, const MLNativeSurfaceFrameAvailableInfo info)on_frame_available
This callback is invoked when the raw video frame is available for consumption on client side.

Detailed Description

struct MLNativeSurfaceOnFrameAvailableCallback;

Callbacks for notifying when an output frame is available for consumption.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

Public Attributes Documentation

version

uint32_t version;

Version of this structure.


on_frame_available

void(*)(MLHandle handle, const MLNativeSurfaceFrameAvailableInfo *info) on_frame_available;

This callback is invoked when the raw video frame is available for consumption on client side.

TypeDescription
void()(MLHandle handle, const MLNativeSurfaceFrameAvailableInfo info))(MLHandle handle, const MLNativeSurfaceFrameAvailableInfo *info)

Parameters

handleMLNativeSurface or MLNativeSurfaceTexture handle for which callback was called.
infoOutput Frame availability info as MLNativeSurfaceFrameAvailableInfo.

Client should implement this callback when they want to use raw video frame as a texture mapped to 3D geometry, for example.

This callback is typically fired when the when a raw frame is available for consumption, such as when the decoded output buffer has been released by the decoder OR camera produces a frame.