mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 22:08:33 +00:00
FS-7503 FS-7514: First crack at recording mp4 <action application="capture_video" data="vlc://#transcode{vcodec=h264,acodec=mp3}:std{access=file,mux=mp4,dst=/var/www/sounds/file.mp4}"/>
This commit is contained in:
1 parent
c59874cbff
commit
4bcc6e6d64
7 files changed
+452
-75
No files matched your search
@@ -202,6 +202,7 @@ struct switch_media_handle_s {
|
||||
switch_video_function_t video_function;
|
||||
void *video_user_data;
|
||||
int8_t video_function_running;
|
||||
switch_vid_params_t vid_params;
|
||||
};
|
||||
|
||||
|
||||
@@ -490,7 +491,20 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_check_autoadj(switch_core_sess
|
||||
return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_get_vid_params(switch_core_session_t *session, switch_vid_params_t *vid_params)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
switch_assert(session);
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
*vid_params = smh->vid_params;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_t38_options_t *) switch_core_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp)
|
||||
{
|
||||
@@ -4654,6 +4668,14 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (read_frame->img) {
|
||||
switch_channel_set_flag(channel, CF_VIDEO_READY);
|
||||
smh->vid_params.width = read_frame->img->d_w;
|
||||
smh->vid_params.height = read_frame->img->d_h;
|
||||
}
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_VIDEO_ECHO)) {
|
||||
switch_core_session_write_video_frame(session, read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user