Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d4a5ebf9
提交
d4a5ebf9
authored
11月 12, 2014
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7500 FS-7517 FS-7508 FS-7514: chrome working on most, bria working on some
上级
9fdb5476
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
23 行删除
+30
-23
mod_openh264.cpp
src/mod/codecs/mod_openh264/mod_openh264.cpp
+3
-2
mod_vpx.c
src/mod/codecs/mod_vpx/mod_vpx.c
+8
-5
mod_vlc.c
src/mod/formats/mod_vlc/mod_vlc.c
+19
-16
没有找到文件。
src/mod/codecs/mod_openh264/mod_openh264.cpp
浏览文件 @
d4a5ebf9
...
...
@@ -395,8 +395,9 @@ static switch_status_t switch_h264_encode(switch_codec_t *codec,
return
nalu_slice
(
context
,
encoded_data
,
encoded_data_len
,
flag
);
}
width
=
img
->
d_w
;
height
=
img
->
d_h
;
//d_w and d_h are corrupt
width
=
img
->
w
;
height
=
img
->
h
;
//switch_assert(width > 0 && (width % 2 == 0));
//switch_assert(height > 0 && (height % 2 == 0));
...
...
src/mod/codecs/mod_vpx/mod_vpx.c
浏览文件 @
d4a5ebf9
...
...
@@ -108,9 +108,10 @@ static switch_status_t switch_vpx_init(switch_codec_t *codec, switch_codec_flag_
return
SWITCH_STATUS_FALSE
;
}
context
->
width
=
352
;
context
->
height
=
288
;
context
->
bitrate
=
38400
;
// very big defaults till we know why scaling segs it
context
->
width
=
3840
;
context
->
height
=
2160
;
context
->
bitrate
=
3840000
;
// settings
config
->
g_profile
=
1
;
...
...
@@ -329,8 +330,10 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_image_t *
return
consume_partition
(
context
,
encoded_data
,
encoded_data_len
,
flag
);
}
width
=
img
->
d_w
;
height
=
img
->
d_h
;
//d_w and d_h are messed up
width
=
img
->
w
;
height
=
img
->
h
;
//switch_assert(width > 0 && (width % 4 == 0));
//switch_assert(height > 0 && (height % 4 == 0));
...
...
src/mod/formats/mod_vlc/mod_vlc.c
浏览文件 @
d4a5ebf9
...
...
@@ -115,6 +115,7 @@ struct vlc_video_context {
int
force_width
;
int
force_height
;
int
video_refresh_req
;
int
channels
;
};
typedef
struct
vlc_video_context
vlc_video_context_t
;
...
...
@@ -204,7 +205,7 @@ void vlc_play_audio_callback(void *data, const void *samples, unsigned count, in
switch_buffer_toss
(
context
->
audio_buffer
,
bytes
-
VLC_BUFFER_SIZE
);
}
switch_buffer_write
(
context
->
audio_buffer
,
samples
,
count
*
2
);
switch_buffer_write
(
context
->
audio_buffer
,
samples
,
count
*
2
*
context
->
channels
);
if
(
!
context
->
playing
)
{
context
->
playing
=
1
;
...
...
@@ -266,8 +267,8 @@ static void vlc_video_unlock_callback(void *data, void *id, void *const *p_pixel
}
//printf("WTF VLC d_w=%d d_h=%d w=%d h=%d\n", context->img->d_w, context->img->d_h, context->img->w, context->img->h);
context
->
img
->
d_w
=
context
->
img
->
w
;
context
->
img
->
d_h
=
context
->
img
->
h
;
//
context->img->d_w = context->img->w;
//
context->img->d_h = context->img->h;
switch_core_codec_encode_video
(
codec
,
context
->
img
,
frame
->
data
,
&
encoded_data_len
,
&
flag
);
...
...
@@ -640,8 +641,9 @@ static switch_status_t vlc_file_read(switch_file_handle_t *handle, void *data, s
memset
(
data
,
0
,
read
);
}
if
(
read
)
*
len
=
read
/
2
;
if
(
read
)
{
*
len
=
read
/
2
/
handle
->
channels
;
}
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -649,7 +651,7 @@ static switch_status_t vlc_file_read(switch_file_handle_t *handle, void *data, s
static
switch_status_t
vlc_file_write
(
switch_file_handle_t
*
handle
,
void
*
data
,
size_t
*
len
)
{
vlc_file_context_t
*
context
=
handle
->
private_info
;
size_t
bytes
=
*
len
*
sizeof
(
int16_t
);
size_t
bytes
=
*
len
*
sizeof
(
int16_t
)
*
handle
->
channels
;
switch_mutex_lock
(
context
->
audio_mutex
);
context
->
samples
+=
*
len
;
...
...
@@ -718,7 +720,7 @@ SWITCH_STANDARD_APP(play_video_function)
switch_size_t
audio_datalen
;
switch_channel_
set_flag
(
channel
,
CF_VIDEO_PASSIVE
);
switch_channel_
clear_flag
(
channel
,
CF_VIDEO_ECHO
);
context
=
switch_core_session_alloc
(
session
,
sizeof
(
vlc_video_context_t
));
switch_assert
(
context
);
...
...
@@ -783,6 +785,7 @@ SWITCH_STANDARD_APP(play_video_function)
}
context
->
pt
=
pt
;
context
->
channels
=
read_impl
.
number_of_channels
;
audio_frame
.
codec
=
&
codec
;
video_frame
.
codec
=
read_vid_codec
;
video_frame
.
packet
=
context
->
video_packet
;
...
...
@@ -802,7 +805,7 @@ SWITCH_STANDARD_APP(play_video_function)
NULL
,
read_impl
.
actual_samples_per_second
,
read_impl
.
microseconds_per_packet
/
1000
,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
read_impl
.
number_of_channels
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
switch_core_session_get_pool
(
session
))
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Audio Codec Activation Success
\n
"
);
}
else
{
...
...
@@ -811,7 +814,7 @@ SWITCH_STANDARD_APP(play_video_function)
goto
end
;
}
audio_datalen
=
codec
.
implementation
->
actual_samples_per_second
/
1000
*
(
read_impl
.
microseconds_per_packet
/
1000
);
audio_datalen
=
read_impl
.
decoded_bytes_per_packet
;
//
codec.implementation->actual_samples_per_second / 1000 * (read_impl.microseconds_per_packet / 1000);
context
->
session
=
session
;
context
->
pool
=
pool
;
...
...
@@ -857,7 +860,7 @@ SWITCH_STANDARD_APP(play_video_function)
context
->
mp
=
libvlc_media_player_new_from_media
(
context
->
m
);
libvlc_audio_set_format
(
context
->
mp
,
"S16N"
,
read_impl
.
actual_samples_per_second
,
1
);
libvlc_audio_set_format
(
context
->
mp
,
"S16N"
,
read_impl
.
actual_samples_per_second
,
read_impl
.
number_of_channels
);
libvlc_audio_set_callbacks
(
context
->
mp
,
vlc_play_audio_callback
,
NULL
,
NULL
,
NULL
,
NULL
,
(
void
*
)
context
);
if
(
switch_channel_test_flag
(
channel
,
CF_VIDEO
))
{
...
...
@@ -917,15 +920,15 @@ SWITCH_STANDARD_APP(play_video_function)
}
}
if
(
switch_buffer_inuse
(
context
->
audio_buffer
)
>=
audio_datalen
*
2
)
{
if
(
switch_buffer_inuse
(
context
->
audio_buffer
)
>=
audio_datalen
)
{
const
void
*
decoded_data
;
//
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%d %d\n", (int)switch_buffer_inuse(context->audio_buffer), (int)audio_datalen * 2
);
//
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%d %d\n", (int)switch_buffer_inuse(context->audio_buffer), (int)audio_datalen
);
switch_buffer_peek_zerocopy
(
context
->
audio_buffer
,
&
decoded_data
);
audio_frame
.
data
=
(
void
*
)
decoded_data
;
audio_frame
.
datalen
=
audio_datalen
*
2
;
audio_frame
.
buflen
=
audio_datalen
*
2
;
audio_frame
.
datalen
=
audio_datalen
;
;
audio_frame
.
buflen
=
audio_datalen
;
switch_core_session_write_frame
(
context
->
session
,
&
audio_frame
,
SWITCH_IO_FLAG_NONE
,
0
);
switch_buffer_toss
(
context
->
audio_buffer
,
audio_datalen
*
2
);
switch_buffer_toss
(
context
->
audio_buffer
,
audio_datalen
);
}
}
...
...
@@ -954,7 +957,7 @@ end:
switch_core_codec_destroy
(
&
codec
);
}
switch_c
hannel_clear_flag
(
channel
,
CF_VIDEO_PASSIVE
);
switch_c
ore_session_video_reset
(
session
);
}
static
switch_status_t
channel_on_init
(
switch_core_session_t
*
session
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论