mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
FS-7500: major refactoring pass. Push concepts from mod_vlc as deep as possible and flesh out api to use everywhere else. Round 2 will be to convert the bridge and other places using the same code
This commit is contained in:
committed by
Michael Jerris
parent
765fff3d75
commit
365a5dd820
@@ -190,6 +190,10 @@ struct switch_core_session {
|
||||
uint32_t decoder_errors;
|
||||
switch_core_video_thread_callback_func_t *_video_thread_callback;
|
||||
void *_video_thread_user_data;
|
||||
//switch_time_t last_video_write_time;
|
||||
|
||||
switch_image_write_callback_t image_write_callback;
|
||||
void *image_write_callback_user_data;
|
||||
};
|
||||
|
||||
struct switch_media_bug {
|
||||
|
||||
@@ -1275,6 +1275,26 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(_In_ switch_core_
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(_In_ switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags,
|
||||
int stream_id);
|
||||
|
||||
/*!
|
||||
\brief Write a video image to a session using a video frame
|
||||
\param session the session to write to
|
||||
\param frame a pointer to a frame to use for write with proper codec
|
||||
\param img the image structure with the image data
|
||||
\param the size for packetization
|
||||
\param flag pointer to frame flags to pass in / out
|
||||
\return SWITCH_STATUS_SUCCESS a if the image was written
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_image(switch_core_session_t *session, switch_frame_t *frame,
|
||||
switch_image_t *img, switch_size_t size, uint32_t *flag);
|
||||
/*!
|
||||
\brief set a callback to be called after each frame of an image is written
|
||||
\param session the session to write to
|
||||
\param callback the function to call
|
||||
\param user_data the user data pointer to pass as an arguement to the callback
|
||||
\return void
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_core_session_set_image_write_callback(switch_core_session_t *session, switch_image_write_callback_t callback, void *user_data);
|
||||
|
||||
/*!
|
||||
\brief Write a video frame to a session
|
||||
\param session the session to write to
|
||||
|
||||
@@ -305,6 +305,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_codec_control(switch_core_sess
|
||||
switch_codec_control_type_t *rtype,
|
||||
void **ret_data);
|
||||
|
||||
SWITCH_DECLARE(switch_timer_t *) switch_core_media_get_timer(switch_core_session_t *session, switch_media_type_t mtype);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
/* For Emacs:
|
||||
|
||||
@@ -217,6 +217,7 @@ struct switch_timer {
|
||||
switch_size_t diff;
|
||||
switch_time_t start;
|
||||
uint64_t tick;
|
||||
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -268,6 +268,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_session, int send_rate, switch_port_t remote_port, switch_bool_t mux);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_timer_t *) switch_rtp_get_media_timer(switch_rtp_t *rtp_session);
|
||||
|
||||
/*!
|
||||
\brief Acvite a jitter buffer on an RTP session
|
||||
\param rtp_session the rtp session
|
||||
@@ -285,6 +288,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_deactivate_jitter_buffer(switch_rtp_t
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_pause_jitter_buffer(switch_rtp_t *rtp_session, switch_bool_t pause);
|
||||
SWITCH_DECLARE(stfu_instance_t *) switch_rtp_get_jitter_buffer(switch_rtp_t *rtp_session);
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief Set an RTP Flag
|
||||
\param rtp_session the RTP session
|
||||
|
||||
@@ -226,6 +226,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_DTMF_LOG_LEN 1000
|
||||
#define SWITCH_MAX_TRANS 2000
|
||||
#define SWITCH_CORE_SESSION_MAX_PRIVATES 2
|
||||
#define SWITCH_DEFAULT_VIDEO_SIZE 1500
|
||||
|
||||
/* Jitter */
|
||||
#define JITTER_VARIANCE_THRESHOLD 400.0
|
||||
@@ -1494,7 +1495,8 @@ typedef enum {
|
||||
SFF_NOT_AUDIO = (1 << 9),
|
||||
SFF_RTCP = (1 << 10),
|
||||
SFF_MARKER = (1 << 11),
|
||||
SFF_WAIT_KEY_FRAME = (1 << 12)
|
||||
SFF_WAIT_KEY_FRAME = (1 << 12),
|
||||
SFF_RAW_RTP_PARSE_FRAME = (1 << 13)
|
||||
} switch_frame_flag_enum_t;
|
||||
typedef uint32_t switch_frame_flag_t;
|
||||
|
||||
@@ -2196,6 +2198,8 @@ typedef switch_status_t (*switch_core_codec_control_func_t) (switch_codec_t *cod
|
||||
void **ret_data);
|
||||
|
||||
|
||||
typedef switch_status_t (*switch_image_write_callback_t) (switch_core_session_t *session, switch_frame_t *frame, switch_image_t *img, void *user_data);
|
||||
|
||||
typedef switch_status_t (*switch_core_codec_init_func_t) (switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings);
|
||||
typedef switch_status_t (*switch_core_codec_fmtp_parse_func_t) (const char *fmtp, switch_codec_fmtp_t *codec_fmtp);
|
||||
typedef switch_status_t (*switch_core_codec_destroy_func_t) (switch_codec_t *);
|
||||
|
||||
Reference in New Issue
Block a user