diff options
author | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-01-19 16:12:07 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-01-27 15:18:17 +0100 |
commit | 102bd641687a6ec4704ce2b3f259e895b68d8e4b (patch) | |
tree | d6ba6f1c686036af9c9077543624b5adebd72a18 /libavformat/avformat.h | |
parent | 7151411b9cf74ce43ab56f0ff8577b8031b997d9 (diff) | |
download | ffmpeg-102bd641687a6ec4704ce2b3f259e895b68d8e4b.tar.gz |
lavd: add avdevice_dev_to_app_control_message API
New API allows to send messages from devices to application.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 09eea74ad9..002b015255 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -953,6 +953,13 @@ typedef struct AVChapter { /** + * Callback used by devices to communicate with application. + */ +typedef int (*av_format_control_message)(struct AVFormatContext *s, int type, + void *data, size_t data_size); + + +/** * The duration of a video can be estimated through various ways, and this enum can be used * to know how the duration was estimated. */ @@ -1360,6 +1367,19 @@ typedef struct AVFormatContext { * Muxing: Set by user via av_format_set_metadata_header_padding. */ int metadata_header_padding; + + /** + * User data. + * This is a place for some private data of the user. + * Mostly usable with control_message_cb or any future callbacks in device's context. + */ + void *opaque; + + /** + * Callback used by devices to communicate with application. + */ + av_format_control_message control_message_cb; + } AVFormatContext; int av_format_get_probe_score(const AVFormatContext *s); @@ -1371,6 +1391,10 @@ AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s); void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c); int av_format_get_metadata_header_padding(const AVFormatContext *s); void av_format_set_metadata_header_padding(AVFormatContext *s, int c); +void * av_format_get_opaque(const AVFormatContext *s); +void av_format_set_opaque(AVFormatContext *s, void *opaque); +av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s); +void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback); /** * Returns the method used to set ctx->duration. |