2015-09-23 11:58:57 -05:00
|
|
|
|
2012-12-18 10:50:43 -06:00
|
|
|
/*
|
|
|
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
2014-02-05 15:02:28 -06:00
|
|
|
* Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
|
2012-12-18 10:50:43 -06:00
|
|
|
*
|
|
|
|
* Version: MPL 1.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Anthony Minessale II <anthm@freeswitch.org>
|
|
|
|
* Portions created by the Initial Developer are Copyright (C)
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Anthony Minessale II <anthm@freeswitch.org>
|
|
|
|
*
|
|
|
|
* switch_core_media.c -- Core Media
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-12-18 16:06:29 -06:00
|
|
|
#ifndef SWITCH_CORE_MEDIA_H
|
|
|
|
#define SWITCH_CORE_MEDIA_H
|
2012-12-18 10:50:43 -06:00
|
|
|
|
2012-12-20 22:57:47 -06:00
|
|
|
|
2012-12-18 10:50:43 -06:00
|
|
|
#include <switch.h>
|
|
|
|
|
|
|
|
SWITCH_BEGIN_EXTERN_C
|
|
|
|
|
2013-01-09 22:31:25 -06:00
|
|
|
#define SWITCH_MAX_CAND_ACL 25
|
2016-03-08 12:10:43 +01:00
|
|
|
#define SWITCH_NO_CRYPTO_TAG -1
|
2013-01-09 22:31:25 -06:00
|
|
|
|
2012-12-20 22:57:47 -06:00
|
|
|
typedef enum {
|
2016-03-23 09:55:43 -05:00
|
|
|
DTMF_AUTO,
|
2012-12-20 22:57:47 -06:00
|
|
|
DTMF_2833,
|
|
|
|
DTMF_INFO,
|
|
|
|
DTMF_NONE
|
|
|
|
} switch_core_media_dtmf_t;
|
|
|
|
|
2012-12-18 16:06:29 -06:00
|
|
|
typedef enum {
|
|
|
|
SM_NDLB_ALLOW_BAD_IANANAME = (1 << 0),
|
|
|
|
SM_NDLB_ALLOW_NONDUP_SDP = (1 << 1),
|
2012-12-18 20:35:44 -06:00
|
|
|
SM_NDLB_ALLOW_CRYPTO_IN_AVP = (1 << 2),
|
2012-12-21 16:57:59 -06:00
|
|
|
SM_NDLB_DISABLE_SRTP_AUTH = (1 << 3),
|
2014-05-21 03:31:45 +05:00
|
|
|
SM_NDLB_SENDRECV_IN_SESSION = (1 << 4),
|
|
|
|
SM_NDLB_NEVER_PATCH_REINVITE = (1 << 5)
|
2012-12-18 16:06:29 -06:00
|
|
|
} switch_core_media_NDLB_t;
|
|
|
|
|
2012-12-19 22:42:03 -06:00
|
|
|
typedef enum {
|
2012-12-20 22:57:47 -06:00
|
|
|
SCMF_RUNNING,
|
|
|
|
SCMF_DISABLE_TRANSCODING,
|
|
|
|
SCMF_AUTOFIX_TIMING,
|
|
|
|
SCMF_CODEC_GREEDY,
|
|
|
|
SCMF_CODEC_SCROOGE,
|
|
|
|
SCMF_DISABLE_HOLD,
|
|
|
|
SCMF_RENEG_ON_HOLD,
|
|
|
|
SCMF_RENEG_ON_REINVITE,
|
|
|
|
SCMF_LIBERAL_DTMF,
|
|
|
|
SCMF_SUPPRESS_CNG,
|
2012-12-21 14:22:25 -06:00
|
|
|
SCMF_DISABLE_RTP_AUTOADJ,
|
|
|
|
SCMF_PASS_RFC2833,
|
|
|
|
SCMF_AUTOFLUSH,
|
|
|
|
SCMF_REWRITE_TIMESTAMPS,
|
2012-12-22 11:51:03 -06:00
|
|
|
SCMF_RTP_AUTOFLUSH_DURING_BRIDGE,
|
2013-11-08 03:48:00 +05:00
|
|
|
SCMF_MULTI_ANSWER_AUDIO,
|
|
|
|
SCMF_MULTI_ANSWER_VIDEO,
|
2016-07-18 11:11:32 -05:00
|
|
|
SCMF_RECV_SDP,
|
2012-12-20 22:57:47 -06:00
|
|
|
SCMF_MAX
|
2012-12-19 22:42:03 -06:00
|
|
|
} switch_core_media_flag_t;
|
|
|
|
|
2012-12-18 16:06:29 -06:00
|
|
|
struct switch_media_handle_s;
|
|
|
|
|
2012-12-19 22:42:03 -06:00
|
|
|
typedef enum {
|
2012-12-21 14:22:25 -06:00
|
|
|
STUN_FLAG_SET = (1 << 0),
|
|
|
|
STUN_FLAG_PING = (1 << 1),
|
|
|
|
STUN_FLAG_FUNNY = (1 << 2)
|
|
|
|
} STUNFLAGS;
|
2012-12-19 22:42:03 -06:00
|
|
|
|
|
|
|
typedef enum {
|
2012-12-21 14:22:25 -06:00
|
|
|
VAD_IN = (1 << 0),
|
|
|
|
VAD_OUT = (1 << 1)
|
|
|
|
} switch_core_media_vflag_t;
|
|
|
|
|
|
|
|
typedef struct switch_core_media_params_s {
|
|
|
|
uint32_t rtp_timeout_sec;
|
|
|
|
uint32_t rtp_hold_timeout_sec;
|
|
|
|
uint32_t dtmf_delay;
|
|
|
|
uint32_t codec_flags;
|
2012-12-21 21:30:14 -06:00
|
|
|
|
2012-12-21 14:22:25 -06:00
|
|
|
switch_core_media_NDLB_t ndlb;
|
|
|
|
switch_rtp_bug_flag_t auto_rtp_bugs;
|
|
|
|
|
|
|
|
char *inbound_codec_string;
|
|
|
|
char *outbound_codec_string;
|
|
|
|
|
|
|
|
char *timer_name;
|
|
|
|
|
|
|
|
char *remote_sdp_str;
|
|
|
|
char *early_sdp;
|
|
|
|
char *local_sdp_str;
|
|
|
|
char *last_sdp_str;
|
2014-06-02 19:09:48 -05:00
|
|
|
char *last_sdp_response;
|
2015-09-23 11:58:57 -05:00
|
|
|
char *prev_sdp_str;
|
|
|
|
char *prev_sdp_response;
|
2012-12-21 14:22:25 -06:00
|
|
|
|
|
|
|
char *stun_ip;
|
|
|
|
switch_port_t stun_port;
|
|
|
|
uint32_t stun_flags;
|
|
|
|
|
|
|
|
char *jb_msec;
|
|
|
|
|
|
|
|
switch_core_media_vflag_t vflags;
|
|
|
|
|
|
|
|
switch_rtp_bug_flag_t manual_rtp_bugs;
|
|
|
|
switch_rtp_bug_flag_t manual_video_rtp_bugs;
|
|
|
|
|
|
|
|
char *rtcp_audio_interval_msec;
|
|
|
|
char *rtcp_video_interval_msec;
|
|
|
|
|
|
|
|
|
|
|
|
char *extrtpip;
|
|
|
|
char *rtpip;
|
2015-05-28 18:02:21 -05:00
|
|
|
char *rtpip4;
|
|
|
|
char *rtpip6;
|
|
|
|
|
2012-12-21 14:22:25 -06:00
|
|
|
|
|
|
|
char *remote_ip;
|
|
|
|
int remote_port;
|
2012-12-19 22:42:03 -06:00
|
|
|
|
2012-12-21 14:22:25 -06:00
|
|
|
char *extsipip;
|
|
|
|
char *local_network;
|
2012-12-21 16:57:59 -06:00
|
|
|
|
2012-12-21 21:30:14 -06:00
|
|
|
char *sipip;
|
|
|
|
|
2012-12-21 16:57:59 -06:00
|
|
|
char *sdp_username;
|
|
|
|
|
2012-12-22 22:19:58 -06:00
|
|
|
switch_payload_t te;
|
|
|
|
switch_payload_t recv_te;
|
2015-07-30 18:11:08 -05:00
|
|
|
unsigned long te_rate;
|
|
|
|
unsigned long cng_rate;
|
2012-12-21 21:30:14 -06:00
|
|
|
|
|
|
|
char *adv_sdp_audio_ip;
|
2012-12-19 22:42:03 -06:00
|
|
|
|
2012-12-22 22:19:58 -06:00
|
|
|
int num_codecs;
|
|
|
|
int hold_laps;
|
|
|
|
switch_core_media_dtmf_t dtmf_type;
|
2013-01-08 12:59:02 -06:00
|
|
|
switch_payload_t cng_pt;
|
2012-12-22 11:51:03 -06:00
|
|
|
|
2014-02-13 14:56:07 +08:00
|
|
|
|
2014-11-12 08:39:35 +08:00
|
|
|
/* a core_video_thread will be started automatically
|
|
|
|
when uses rtp based media,
|
|
|
|
external_video_source should be set to SWITCH_TRUE and
|
2014-11-18 16:39:32 -06:00
|
|
|
switch_core_session_start_video_thread()
|
2014-11-12 08:39:35 +08:00
|
|
|
should be explicitly called to start the video thread
|
|
|
|
if uses the media handle for non-rtp based media
|
|
|
|
*/
|
2014-02-13 14:56:07 +08:00
|
|
|
|
2014-11-12 08:39:35 +08:00
|
|
|
switch_bool_t external_video_source;
|
|
|
|
|
2014-11-14 19:01:56 -06:00
|
|
|
uint32_t video_key_freq;
|
|
|
|
uint32_t video_key_first;
|
|
|
|
|
2016-02-23 22:01:38 -06:00
|
|
|
switch_thread_t *video_write_thread;
|
|
|
|
|
2012-12-21 14:22:25 -06:00
|
|
|
} switch_core_media_params_t;
|
2012-12-19 22:42:03 -06:00
|
|
|
|
2012-12-21 16:57:59 -06:00
|
|
|
static inline const char *switch_media_type2str(switch_media_type_t type)
|
|
|
|
{
|
|
|
|
switch(type) {
|
|
|
|
case SWITCH_MEDIA_TYPE_AUDIO:
|
|
|
|
return "audio";
|
|
|
|
case SWITCH_MEDIA_TYPE_VIDEO:
|
|
|
|
return "video";
|
|
|
|
default:
|
|
|
|
return "!ERR";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2012-12-19 22:42:03 -06:00
|
|
|
|
2012-12-18 16:06:29 -06:00
|
|
|
|
2012-12-21 14:22:25 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_media_handle_create(switch_media_handle_t **smhp, switch_core_session_t *session, switch_core_media_params_t *params);
|
2012-12-22 17:34:08 -06:00
|
|
|
SWITCH_DECLARE(void) switch_media_handle_destroy(switch_core_session_t *session);
|
2012-12-18 16:06:29 -06:00
|
|
|
SWITCH_DECLARE(switch_media_handle_t *) switch_core_session_get_media_handle(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_session_clear_media_handle(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_session_media_handle_ready(switch_core_session_t *session);
|
2012-12-19 22:42:03 -06:00
|
|
|
SWITCH_DECLARE(void) switch_media_handle_set_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
|
|
|
|
SWITCH_DECLARE(void) switch_media_handle_clear_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
|
|
|
|
SWITCH_DECLARE(int32_t) switch_media_handle_test_media_flag(switch_media_handle_t *smh, switch_core_media_flag_t flag);
|
2012-12-20 22:57:47 -06:00
|
|
|
SWITCH_DECLARE(void) switch_media_handle_set_media_flags(switch_media_handle_t *smh, switch_core_media_flag_t flags[]);
|
2014-03-06 07:33:05 +05:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_check_outgoing_crypto(switch_core_session_t *session);
|
2012-12-18 20:40:00 -06:00
|
|
|
SWITCH_DECLARE(const char *) switch_core_session_local_crypto_key(switch_core_session_t *session, switch_media_type_t type);
|
2012-12-18 20:35:44 -06:00
|
|
|
SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_session_t *session,
|
|
|
|
const char *varname,
|
2013-05-17 15:39:21 -05:00
|
|
|
switch_media_type_t type, const char *crypto, int crypto_tag, switch_sdp_type_t sdp_type);
|
2012-12-18 20:35:44 -06:00
|
|
|
|
|
|
|
|
2015-04-09 18:18:45 -05:00
|
|
|
SWITCH_DECLARE(uint32_t) switch_core_media_get_video_fps(switch_core_session_t *session);
|
2012-12-18 20:35:44 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_rtp_session(switch_core_session_t *session, switch_media_type_t type, switch_rtp_t *rtp_session);
|
2012-12-18 10:50:43 -06:00
|
|
|
|
2012-12-19 22:42:03 -06:00
|
|
|
SWITCH_DECLARE(const char *)switch_core_media_get_codec_string(switch_core_session_t *session);
|
2012-12-20 22:57:47 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str);
|
|
|
|
SWITCH_DECLARE(switch_t38_options_t *) switch_core_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(const char *) switch_core_media_get_zrtp_hash(switch_core_session_t *session, switch_media_type_t type, switch_bool_t local);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session);
|
|
|
|
SWITCH_DECLARE(int) switch_core_media_toggle_hold(switch_core_session_t *session, int sendonly);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session);
|
2013-05-17 15:39:21 -05:00
|
|
|
SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *session, const char *r_sdp, uint8_t *proceed, switch_sdp_type_t sdp_type);
|
2012-12-21 14:22:25 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_codec(switch_core_session_t *session, int force);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_set_codec(switch_core_session_t *session, int force, uint32_t codec_flags);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_check_video_codecs(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session_t *session, switch_frame_t **frame,
|
|
|
|
switch_io_flag_t flags, int stream_id, switch_media_type_t type);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_write_frame(switch_core_session_t *session,
|
|
|
|
switch_frame_t *frame, switch_io_flag_t flags, int stream_id, switch_media_type_t type);
|
|
|
|
SWITCH_DECLARE(int) switch_core_media_check_nat(switch_media_handle_t *smh, const char *network_ip);
|
2012-12-19 22:42:03 -06:00
|
|
|
|
2012-12-21 16:57:59 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_choose_port(switch_core_session_t *session, switch_media_type_t type, int force);
|
2013-10-16 02:24:32 +05:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_choose_ports(switch_core_session_t *session, switch_bool_t audio, switch_bool_t video);
|
2012-12-21 21:30:14 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_check_dtmf_type(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_absorb_sdp(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_session_t *session, const char *sdp_str);
|
2016-07-14 17:54:59 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_parse_media_flags(switch_core_session_t *session);
|
2012-12-21 21:30:14 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_deactivate_rtp(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_ext_address_lookup(switch_core_session_t *session, char **ip, switch_port_t *port, const char *sourceip);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_process_t38_passthru(switch_core_session_t *session,
|
|
|
|
switch_core_session_t *other_session, switch_t38_options_t *t38_options);
|
2013-11-08 03:48:00 +05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *session, switch_sdp_type_t sdp_type,
|
|
|
|
const char *ip, switch_port_t port, const char *sr, int force);
|
2012-12-21 23:56:53 -06:00
|
|
|
SWITCH_DECLARE(void)switch_core_media_set_local_sdp(switch_core_session_t *session, const char *sdp_str, switch_bool_t dup);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session);
|
2013-02-04 11:02:35 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_udptl_image_sdp(switch_core_session_t *session, switch_t38_options_t *t38_options, int insist);
|
2013-10-16 02:24:32 +05:00
|
|
|
SWITCH_DECLARE(switch_core_media_params_t *) switch_core_media_get_mparams(switch_media_handle_t *smh);
|
2012-12-21 23:56:53 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *session, switch_bool_t force);
|
2012-12-22 11:51:03 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_start_udptl(switch_core_session_t *session, switch_t38_options_t *t38_options);
|
2014-10-27 15:13:36 -04:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_hard_mute(switch_core_session_t *session, switch_bool_t on);
|
2012-12-22 11:51:03 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg);
|
2012-12-21 23:56:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-22 16:54:35 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_break(switch_core_session_t *session, switch_media_type_t type);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_kill_socket(switch_core_session_t *session, switch_media_type_t type);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833(switch_core_session_t *session, switch_media_type_t type, const switch_dtmf_t *dtmf);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833_in(switch_core_session_t *session, switch_media_type_t type, const switch_dtmf_t *dtmf);
|
|
|
|
SWITCH_DECLARE(uint8_t) switch_core_media_ready(switch_core_session_t *session, switch_media_type_t type);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_telephony_event(switch_core_session_t *session, switch_media_type_t type, switch_payload_t te);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_telephony_recv_event(switch_core_session_t *session, switch_media_type_t type, switch_payload_t te);
|
|
|
|
SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_stats(switch_core_session_t *session, switch_media_type_t type, switch_memory_pool_t *pool);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_udptl_mode(switch_core_session_t *session, switch_media_type_t type);
|
2016-02-05 11:56:44 -06:00
|
|
|
SWITCH_DECLARE(switch_bool_t) switch_core_media_check_udptl_mode(switch_core_session_t *session, switch_media_type_t type);
|
2012-12-22 16:54:35 -06:00
|
|
|
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_rtp_flag(switch_core_session_t *session, switch_media_type_t type, switch_rtp_flag_t flag);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_clear_rtp_flag(switch_core_session_t *session, switch_media_type_t type, switch_rtp_flag_t flag);
|
2015-09-11 11:37:01 -05:00
|
|
|
SWITCH_DECLARE(switch_jb_t *) switch_core_media_get_jb(switch_core_session_t *session, switch_media_type_t type);
|
2012-12-22 16:54:35 -06:00
|
|
|
SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_core_session_t *session, switch_media_type_t type, switch_memory_pool_t *pool);
|
2012-12-21 16:57:59 -06:00
|
|
|
|
2012-12-22 17:34:08 -06:00
|
|
|
|
2013-11-12 00:11:23 +05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_sdp_codec_string(switch_core_session_t *session, const char *r_sdp, switch_sdp_type_t sdp_type);
|
2013-07-29 10:18:05 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_reset_autofix(switch_core_session_t *session, switch_media_type_t type);
|
2013-02-27 14:16:00 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_t *session, switch_core_session_t *o_session);
|
2012-12-22 22:19:58 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_codec_chosen(switch_core_session_t *session, switch_media_type_t media);
|
2012-12-23 21:20:03 -06:00
|
|
|
SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *session);
|
2013-01-09 22:31:25 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_add_ice_acl(switch_core_session_t *session, switch_media_type_t type, const char *acl_name);
|
2013-01-24 15:13:17 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_set_ice(switch_core_session_t *session);
|
2014-06-13 06:06:14 -04:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_clear_ice(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_pause(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_resume(switch_core_session_t *session);
|
2013-01-14 08:34:07 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_init(void);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_deinit(void);
|
2013-04-26 09:31:28 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_set_stats(switch_core_session_t *session);
|
2016-03-31 19:25:56 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_sync_stats(switch_core_session_t *session);
|
2013-06-17 19:52:37 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_wake_video_thread(switch_core_session_t *session);
|
2013-10-16 02:24:32 +05:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_clear_crypto(switch_core_session_t *session);
|
2013-11-10 07:53:11 +05:00
|
|
|
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core_session_t *session,
|
|
|
|
switch_media_type_t type,
|
|
|
|
const char *iananame,
|
2014-09-08 14:26:58 +00:00
|
|
|
uint32_t rate,
|
2016-05-19 16:32:47 -05:00
|
|
|
const char *fmtp_in,
|
2013-11-10 07:53:11 +05:00
|
|
|
switch_payload_t *ptP,
|
2013-11-20 05:20:01 +05:00
|
|
|
switch_payload_t *recv_ptP,
|
|
|
|
char **fmtpP);
|
2013-11-10 07:53:11 +05:00
|
|
|
|
2013-11-08 03:48:00 +05:00
|
|
|
SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_session_t *session,
|
|
|
|
switch_media_type_t type,
|
|
|
|
const char *name,
|
2015-03-19 14:26:47 -05:00
|
|
|
const char *modname,
|
2013-11-19 00:43:30 +05:00
|
|
|
const char *fmtp,
|
2013-11-08 03:48:00 +05:00
|
|
|
switch_sdp_type_t sdp_type,
|
|
|
|
uint32_t pt,
|
|
|
|
uint32_t rate,
|
2014-06-13 01:49:10 -04:00
|
|
|
uint32_t ptime,
|
|
|
|
uint32_t channels,
|
2013-11-08 03:48:00 +05:00
|
|
|
uint8_t negotiated);
|
2013-01-14 08:34:07 -06:00
|
|
|
|
2015-03-26 17:48:39 -05:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_check_autoadj(switch_core_session_t *session);
|
2014-02-26 04:02:47 +05:00
|
|
|
SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str);
|
|
|
|
SWITCH_DECLARE(const char *) switch_core_media_crypto_type2str(switch_rtp_crypto_key_type_t type);
|
|
|
|
SWITCH_DECLARE(int) switch_core_media_crypto_keylen(switch_rtp_crypto_key_type_t type);
|
2014-10-01 01:28:10 +05:00
|
|
|
SWITCH_DECLARE(char *) switch_core_media_filter_sdp(const char *sdp, const char *cmd, const char *arg);
|
2014-10-01 13:03:50 -05:00
|
|
|
SWITCH_DECLARE(char *) switch_core_media_process_sdp_filter(const char *sdp, const char *cmd_buf, switch_core_session_t *session);
|
2014-11-12 21:30:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_codec_control(switch_core_session_t *session,
|
|
|
|
switch_media_type_t mtype,
|
|
|
|
switch_io_type_t iotype,
|
|
|
|
switch_codec_control_command_t cmd,
|
|
|
|
switch_codec_control_type_t ctype,
|
|
|
|
void *cmd_data,
|
2015-09-11 11:37:01 -05:00
|
|
|
switch_codec_control_type_t atype,
|
|
|
|
void *cmd_arg,
|
2014-11-12 21:30:39 -06:00
|
|
|
switch_codec_control_type_t *rtype,
|
|
|
|
void **ret_data);
|
|
|
|
|
2014-11-14 19:01:56 -06:00
|
|
|
|
|
|
|
#define switch_core_media_gen_key_frame(_session) switch_core_media_codec_control(_session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_IO_WRITE, \
|
2015-09-21 14:08:32 -05:00
|
|
|
SCC_VIDEO_GEN_KEYFRAME, SCCT_NONE, NULL, SCCT_NONE, NULL, NULL, NULL) \
|
2014-11-14 19:01:56 -06:00
|
|
|
|
2015-02-06 16:13:32 -06:00
|
|
|
#define switch_core_media_write_bandwidth(_session, _val) switch_core_media_codec_control(_session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_IO_WRITE, \
|
2015-09-11 11:37:01 -05:00
|
|
|
SCC_VIDEO_BANDWIDTH, SCCT_STRING, _val, SCCT_NONE, NULL, NULL, NULL) \
|
2015-02-06 16:13:32 -06:00
|
|
|
|
2014-11-14 19:01:56 -06:00
|
|
|
|
2014-11-13 20:52:57 -06:00
|
|
|
SWITCH_DECLARE(switch_timer_t *) switch_core_media_get_timer(switch_core_session_t *session, switch_media_type_t mtype);
|
2014-11-18 16:39:32 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_media_start_video_function(switch_core_session_t *session, switch_video_function_t video_function, void *user_data);
|
|
|
|
SWITCH_DECLARE(void) switch_core_media_end_video_function(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_session_start_video_thread(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(int) switch_core_media_check_video_function(switch_core_session_t *session);
|
2014-11-24 18:39:10 -05:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_video_reinit(switch_core_session_t *session);
|
2014-12-02 11:51:21 -05:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_read_lock_unlock(switch_core_session_t *session, switch_media_type_t type, switch_bool_t lock);
|
|
|
|
|
|
|
|
#define switch_core_media_read_lock(_s, _t) switch_core_media_read_lock_unlock(_s, _t, SWITCH_TRUE)
|
|
|
|
#define switch_core_media_read_unlock(_s, _t) switch_core_media_read_lock_unlock(_s, _t, SWITCH_FALSE)
|
|
|
|
|
2015-01-24 02:47:17 -06:00
|
|
|
SWITCH_DECLARE(void) switch_core_session_stop_media(switch_core_session_t *session);
|
2015-02-19 17:08:05 -06:00
|
|
|
SWITCH_DECLARE(switch_media_flow_t) switch_core_session_media_flow(switch_core_session_t *session, switch_media_type_t type);
|
2015-02-25 21:11:16 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_get_vid_params(switch_core_session_t *session, switch_vid_params_t *vid_params);
|
2016-03-07 19:59:03 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_lock_video_file(switch_core_session_t *session, switch_rw_t rw);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_unlock_video_file(switch_core_session_t *session, switch_rw_t rw);
|
2015-02-27 13:55:54 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_set_video_file(switch_core_session_t *session, switch_file_handle_t *fh, switch_rw_t rw);
|
2015-06-13 02:57:50 -05:00
|
|
|
SWITCH_DECLARE(switch_file_handle_t *) switch_core_media_get_video_file(switch_core_session_t *session, switch_rw_t rw);
|
2015-03-11 11:56:28 -05:00
|
|
|
SWITCH_DECLARE(switch_bool_t) switch_core_session_in_video_thread(switch_core_session_t *session);
|
2015-06-04 20:37:15 -05:00
|
|
|
SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t *session, switch_media_type_t type);
|
2015-10-03 13:34:09 -05:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_set_outgoing_bitrate(switch_core_session_t *session, switch_media_type_t type, uint32_t bitrate);
|
2015-12-23 16:03:35 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_media_reset_jb(switch_core_session_t *session, switch_media_type_t type);
|
2016-03-08 18:53:55 -06:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_core_session_wait_for_video_input_params(switch_core_session_t *session, uint32_t timeout_ms);
|
2015-12-23 16:03:35 -06:00
|
|
|
|
2012-12-18 10:50:43 -06:00
|
|
|
SWITCH_END_EXTERN_C
|
|
|
|
#endif
|
|
|
|
/* For Emacs:
|
|
|
|
* Local Variables:
|
|
|
|
* mode:c
|
|
|
|
* indent-tabs-mode:t
|
|
|
|
* tab-width:4
|
|
|
|
* c-basic-offset:4
|
|
|
|
* End:
|
|
|
|
* For VIM:
|
2013-06-25 11:50:17 -05:00
|
|
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
|
2012-12-18 10:50:43 -06:00
|
|
|
*/
|
2012-12-22 11:51:03 -06:00
|
|
|
|