mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-19 02:31:53 +00:00
FS-7500 FS-7513: add video bandwidth control function and use it in mod_conference
This commit is contained in:
@@ -307,6 +307,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_codec_control(switch_core_sess
|
||||
#define switch_core_media_gen_key_frame(_session) switch_core_media_codec_control(_session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_IO_WRITE, \
|
||||
SCC_VIDEO_REFRESH, SCCT_NONE, NULL, NULL, NULL) \
|
||||
|
||||
#define switch_core_media_write_bandwidth(_session, _val) switch_core_media_codec_control(_session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_IO_WRITE, \
|
||||
SCC_VIDEO_BANDWIDTH, SCCT_STRING, _val, NULL, NULL) \
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_timer_t *) switch_core_media_get_timer(switch_core_session_t *session, switch_media_type_t mtype);
|
||||
SWITCH_DECLARE(void) switch_core_media_start_video_function(switch_core_session_t *session, switch_video_function_t video_function, void *user_data);
|
||||
|
||||
@@ -2192,11 +2192,14 @@ typedef switch_status_t (*switch_core_codec_video_encode_func_t) (switch_codec_t
|
||||
typedef switch_status_t (*switch_core_codec_video_decode_func_t) (switch_codec_t *codec, switch_frame_t *frame);
|
||||
|
||||
typedef enum {
|
||||
SCC_VIDEO_REFRESH = 0
|
||||
SCC_VIDEO_REFRESH = 0,
|
||||
SCC_VIDEO_BANDWIDTH
|
||||
} switch_codec_control_command_t;
|
||||
|
||||
typedef enum {
|
||||
SCCT_NONE = 0
|
||||
SCCT_NONE = 0,
|
||||
SCCT_STRING,
|
||||
SCCT_INT,
|
||||
} switch_codec_control_type_t;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -985,7 +985,9 @@ static inline uint32_t switch_parse_bandwidth_string(const char *bwv)
|
||||
if (bwv && (bw = (int32_t) atol(bwv))) {
|
||||
if (bw < 0) return 0;
|
||||
|
||||
if (switch_stristr("KB", bwv)) {
|
||||
if (!strcasecmp(bwv, "auto")) {
|
||||
return -1;
|
||||
} else if (switch_stristr("KB", bwv)) {
|
||||
bw *= 8;
|
||||
} else if (switch_stristr("mb", bwv)) {
|
||||
bw *= 1024;
|
||||
|
||||
Reference in New Issue
Block a user