[FFmpeg-devel] [PATCH 1/2] lavf: add control message API

Lukasz M lukasz.m.luki at gmail.com
Tue Jan 21 13:28:58 CET 2014

On 21 January 2014 13:06, Stefano Sabatini <stefasab at gmail.com> wrote:

> On date Sunday 2014-01-19 17:33:26 +0100, Lukasz M encoded:
> > On 19 January 2014 12:21, Nicolas George <george at nsup.org> wrote:
> [...]
> > From 9bd80a1cb97948c3ce29bc413fe617116ab49670 Mon Sep 17 00:00:00 2001
> > From: Lukasz Marek <lukasz.m.luki at gmail.com>
> > Date: Sun, 19 Jan 2014 16:11:09 +0100
> > Subject: [PATCH 1/3] lavf: add avformat_dev_control_message API
> >
> > New API allows to send messages from application to devices.
> Can you shortly describe an use case?

Not sure you meant to add description to commit message or just on mailing

In general this API allow to communicate between application and devices.
First patch allow to send messages from app to device and the second one
from device to app.

The specific use case is application may provide window with opengl context
and device may render into it.
To make it working properly application need to send messages when window
is resized or need to be repainted.

Device may need to send message to inform application that buffers need to
be swapped etc.

You may also refer
and opengl device thread

> Also, is this specific of devices? In this case we should probably
> move it to libavdevice.

It is specific to devices.
It can be moved to libavdevice, but changes to AVOutputFormat and
AVFormatContext are required anyway.
Enum would need to be replaced with int if you want to move typedefs too.

+    int (*control_message)(struct AVFormatContext *s, enum
AVDeviceMessageType type,
+                           void *data, size_t data_size);

More information about the ffmpeg-devel mailing list