diff options
author | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-01-19 16:11:09 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki@gmail.com> | 2014-01-27 15:18:17 +0100 |
commit | 7151411b9cf74ce43ab56f0ff8577b8031b997d9 (patch) | |
tree | be9ee49037847eb427cc8d36d78c96b1bcdc3548 /libavdevice/avdevice.h | |
parent | bceeccc648baf94a02b7b2c53e44bf77a47773ef (diff) | |
download | ffmpeg-7151411b9cf74ce43ab56f0ff8577b8031b997d9.tar.gz |
lavd: add avdevice_app_to_dev_control_message API
New API allows to send messages from application to devices.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Diffstat (limited to 'libavdevice/avdevice.h')
-rw-r--r-- | libavdevice/avdevice.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 93a044f270..1bc91e4d0f 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -66,4 +66,56 @@ const char *avdevice_license(void); */ void avdevice_register_all(void); +typedef struct AVDeviceRect { + int x; /**< x coordinate of top left corner */ + int y; /**< y coordinate of top left corner */ + int width; /**< width */ + int height; /**< height */ +} AVDeviceRect; + +/** + * Message types used by avdevice_app_to_dev_control_message(). + */ +enum AVAppToDevMessageType { + /** + * Dummy message. + */ + AV_APP_TO_DEV_NONE = MKBETAG('N','O','N','E'), + + /** + * Window size change message. + * + * Message is sent to the device every time the application changes the size + * of the window device renders to. + * Message should also be sent right after window is created. + * + * data: AVDeviceRect: new window size. + */ + AV_APP_TO_DEV_WINDOW_SIZE = MKBETAG('G','E','O','M'), + + /** + * Repaint request message. + * + * Message is sent to the device when window have to be rapainted. + * + * data: AVDeviceRect: area required to be repainted. + * NULL: whole area is required to be repainted. + */ + AV_APP_TO_DEV_WINDOW_REPAINT = MKBETAG('R','E','P','A') +}; + +/** + * Send control message from application to device. + * + * @param s device context. + * @param type message type. + * @param data message data. Exact type depends on message type. + * @param data_size size of message data. + * @return >= 0 on success, negative on error. + * AVERROR(ENOSYS) when device doesn't implement handler of the message. + */ +int avdevice_app_to_dev_control_message(struct AVFormatContext *s, + enum AVAppToDevMessageType type, + void *data, size_t data_size); + #endif /* AVDEVICE_AVDEVICE_H */ |