| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef CONSOLE_VIDEO_H |
| 24 |
#define CONSOLE_VIDEO_H |
| 25 |
|
| 26 |
#if !defined(HAVE_VIDEO_CONSOLE) || !defined(HAVE_FFMPEG) |
| 27 |
#define CONSOLE_VIDEO_CMDS \ |
| 28 |
"console {device}" |
| 29 |
#else |
| 30 |
|
| •31 |
#include <libavcodec/avcodec.h> |
| 32 |
#ifndef OLD_FFMPEG |
| •33 |
#include <libswscale/swscale.h> |
| 34 |
#endif |
| 35 |
|
| 36 |
#define CONSOLE_VIDEO_CMDS \ |
| 37 |
"console {videodevice|videocodec" \ |
| 38 |
"|video_size|bitrate|fps|qmin" \ |
| 39 |
"|sendvideo|keypad" \ |
| 40 |
"|sdl_videodriver" \ |
| 41 |
"|device|startgui|stopgui" \ |
| 42 |
"}" |
| 43 |
|
| 44 |
#endif |
| 45 |
|
| 46 |
#define SRC_WIN_W 80 |
| 47 |
#define SRC_WIN_H 60 |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
#define MAX_VIDEO_SOURCES 9 |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
struct fbuf_t { |
| 60 |
uint8_t *data; |
| 61 |
|
| 62 |
int size; |
| 63 |
int used; |
| 64 |
int ebit; |
| 65 |
int x; |
| 66 |
int y; |
| 67 |
int w; |
| 68 |
int h; |
| 69 |
int pix_fmt; |
| 70 |
|
| 71 |
int win_x; |
| 72 |
int win_y; |
| 73 |
int win_w; |
| 74 |
int win_h; |
| 75 |
}; |
| 76 |
|
| 77 |
void fbuf_free(struct fbuf_t *); |
| 78 |
|
| 79 |
|
| 80 |
struct grab_desc { |
| 81 |
const char *name; |
| 82 |
void *(*open)(const char *name, struct fbuf_t *geom, int fps); |
| 83 |
struct fbuf_t *(*read)(void *d); |
| 84 |
void (*move)(void *d, int dx, int dy); |
| 85 |
void *(*close)(void *d); |
| 86 |
}; |
| 87 |
|
| 88 |
extern struct grab_desc *console_grabbers[]; |
| 89 |
|
| 90 |
struct video_desc; |
| 91 |
struct video_desc *get_video_desc(struct ast_channel *c); |
| 92 |
|
| 93 |
|
| 94 |
int console_write_video(struct ast_channel *chan, struct ast_frame *f); |
| 95 |
extern int console_video_formats; |
| 96 |
int console_video_cli(struct video_desc *env, const char *var, int fd); |
| 97 |
int console_video_config(struct video_desc **penv, const char *var, const char *val); |
| 98 |
void console_video_uninit(struct video_desc *env); |
| 99 |
void console_video_start(struct video_desc *env, struct ast_channel *owner); |
| 100 |
int get_gui_startup(struct video_desc* env); |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
enum kb_output { |
| 106 |
KO_NONE, |
| 107 |
KO_INPUT, |
| 108 |
KO_DIALED, |
| 109 |
KO_MESSAGE, |
| 110 |
}; |
| 111 |
|
| 112 |
enum drag_window { |
| 113 |
DRAG_NONE, |
| 114 |
DRAG_LOCAL, |
| 115 |
DRAG_REMOTE, |
| 116 |
DRAG_DIALED, |
| 117 |
DRAG_INPUT, |
| 118 |
DRAG_MESSAGE, |
| 119 |
DRAG_PIP, |
| 120 |
}; |
| 121 |
|
| 122 |
|
| 123 |
struct drag_info { |
| 124 |
int x_start; |
| 125 |
int y_start; |
| 126 |
enum drag_window drag_window; |
| 127 |
}; |
| 128 |
|
| 129 |
struct board; |
| 130 |
|
| 131 |
void move_message_board(struct board *b, int dy); |
| 132 |
int print_message(struct board *b, const char *s); |
| 133 |
|
| 134 |
|
| 135 |
const char *read_message(const struct board *b); |
| 136 |
|
| 137 |
|
| 138 |
int reset_board(struct board *b); |
| 139 |
|
| 140 |
|
| 141 |
void delete_board(struct board *b); |
| 142 |
#endif |
| 143 |
|