mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-03 09:21:29 +00:00
FS-10527: [mod_av] AV tweaks
This commit is contained in:
parent
6a73479e7f
commit
38f568d343
@ -373,7 +373,7 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec
|
|||||||
{
|
{
|
||||||
AVCodecContext *c;
|
AVCodecContext *c;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
int threads = switch_core_cpu_count();
|
//int threads = switch_core_cpu_count();
|
||||||
int buffer_bytes = 2097152; /* 2 mb */
|
int buffer_bytes = 2097152; /* 2 mb */
|
||||||
int fps = 15;
|
int fps = 15;
|
||||||
|
|
||||||
@ -402,9 +402,9 @@ GCC_DIAG_OFF(deprecated-declarations)
|
|||||||
GCC_DIAG_ON(deprecated-declarations)
|
GCC_DIAG_ON(deprecated-declarations)
|
||||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "id:%d den:%d num:%d\n", mst->st->id, mst->st->time_base.den, mst->st->time_base.num);
|
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "id:%d den:%d num:%d\n", mst->st->id, mst->st->time_base.den, mst->st->time_base.num);
|
||||||
|
|
||||||
if (threads > 4) {
|
//if (threads > 4) {
|
||||||
threads = 4;
|
// threads = 4;
|
||||||
}
|
// }
|
||||||
|
|
||||||
switch ((*codec)->type) {
|
switch ((*codec)->type) {
|
||||||
case AVMEDIA_TYPE_AUDIO:
|
case AVMEDIA_TYPE_AUDIO:
|
||||||
@ -461,7 +461,7 @@ GCC_DIAG_ON(deprecated-declarations)
|
|||||||
c->time_base.num = 1;
|
c->time_base.num = 1;
|
||||||
c->gop_size = 25; /* emit one intra frame every x frames at mmst */
|
c->gop_size = 25; /* emit one intra frame every x frames at mmst */
|
||||||
c->pix_fmt = AV_PIX_FMT_YUV420P;
|
c->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||||
c->thread_count = threads;
|
//c->thread_count = threads;
|
||||||
c->rc_initial_buffer_occupancy = buffer_bytes * 8;
|
c->rc_initial_buffer_occupancy = buffer_bytes * 8;
|
||||||
|
|
||||||
if (codec_id == AV_CODEC_ID_H264) {
|
if (codec_id == AV_CODEC_ID_H264) {
|
||||||
@ -585,10 +585,10 @@ GCC_DIAG_OFF(deprecated-declarations)
|
|||||||
AVCodecContext *c = mst->st->codec;
|
AVCodecContext *c = mst->st->codec;
|
||||||
GCC_DIAG_ON(deprecated-declarations)
|
GCC_DIAG_ON(deprecated-declarations)
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
int threads = switch_core_cpu_count();
|
//int threads = switch_core_cpu_count();
|
||||||
|
|
||||||
if (threads > 4) threads = 4;
|
// if (threads > 4) threads = 4;
|
||||||
c->thread_count = threads;
|
// c->thread_count = threads;
|
||||||
|
|
||||||
/* open the codec */
|
/* open the codec */
|
||||||
ret = avcodec_open2(c, codec, NULL);
|
ret = avcodec_open2(c, codec, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user