diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-27 23:45:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-27 23:45:22 +0100 |
commit | c94ed2a729649f614dc433032b3b3ca189057644 (patch) | |
tree | 60aba0aaf5da0547d85e06855eb8f621e66fc753 /libavformat | |
parent | 673ce8e46ae229c0f1c72fc9a48ce16dd360e3ab (diff) | |
parent | ded6b3af41cd5d41f4df728ced4b194cf0426105 (diff) | |
download | ffmpeg-c94ed2a729649f614dc433032b3b3ca189057644.tar.gz |
Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master:
lavd: add opengl device
lavd: add avdevice_dev_to_app_control_message API
lavd: add avdevice_app_to_dev_control_message API
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 29 | ||||
-rw-r--r-- | libavformat/utils.c | 2 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a495ee0b79..002b015255 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -453,6 +453,11 @@ typedef struct AVOutputFormat { void (*get_output_timestamp)(struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall); + /** + * Allows sending messages from application to device. + */ + int (*control_message)(struct AVFormatContext *s, int type, + void *data, size_t data_size); } AVOutputFormat; /** * @} @@ -948,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. */ @@ -1355,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); @@ -1366,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. diff --git a/libavformat/utils.c b/libavformat/utils.c index d425b5bc61..ac9236b18f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -107,6 +107,8 @@ MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, video_codec) MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, audio_codec) MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, subtitle_codec) MAKE_ACCESSORS(AVFormatContext, format, int, metadata_header_padding) +MAKE_ACCESSORS(AVFormatContext, format, void *, opaque) +MAKE_ACCESSORS(AVFormatContext, format, av_format_control_message, control_message_cb) static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id) { diff --git a/libavformat/version.h b/libavformat/version.h index a0e5a7cee9..92f81a93b1 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 55 -#define LIBAVFORMAT_VERSION_MINOR 26 +#define LIBAVFORMAT_VERSION_MINOR 28 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |