Loading...
Searching...
No Matches
AVMediaCodecDeviceContext Struct Reference

MediaCodec details. More...

`#include <libavutil/hwcontext_mediacodec.h>`

## Data Fields

void * | surface
| android/view/Surface handle, to be filled by the user.
void * | native_window
| Pointer to ANativeWindow.
int | create_window
| Enable createPersistentInputSurface automatically.

## Detailed Description

MediaCodec details.

Allocated as AVHWDeviceContext.hwctx

Definition at line 27 of file hwcontext_mediacodec.h.

## Field Documentation

## surface

void* AVMediaCodecDeviceContext::surface

android/view/Surface handle, to be filled by the user.

This is the default surface used by decoders on this device.

Definition at line 33 of file hwcontext_mediacodec.h.

## native_window

void* AVMediaCodecDeviceContext::native_window

Pointer to ANativeWindow.

It both surface and native_window is NULL, try to create it automatically if create_window is true and OS support createPersistentInputSurface.

It can be used as output surface for decoder and input surface for encoder.

Definition at line 45 of file hwcontext_mediacodec.h.

## create_window

int AVMediaCodecDeviceContext::create_window

Enable createPersistentInputSurface automatically.

Disabled by default.

It can be enabled by setting this flag directly, or by setting AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key. The second method is useful for ffmpeg cmdline, e.g., we can enable it via: -init_hw_device mediacodec=mediacodec,create_window=1

Definition at line 58 of file hwcontext_mediacodec.h.

The documentation for this struct was generated from the following file:

- libavutil/hwcontext_mediacodec.h