提交 99971677 编写于 作者: Z Zhang Rui

option: introduce max-buffer-size

上级 01a5ae35
...@@ -105,6 +105,9 @@ static const AVOption ffp_context_options[] = { ...@@ -105,6 +105,9 @@ static const AVOption ffp_context_options[] = {
VIDEO_PICTURE_QUEUE_SIZE_MIN, VIDEO_PICTURE_QUEUE_SIZE_MIN,
VIDEO_PICTURE_QUEUE_SIZE_MAX) }, VIDEO_PICTURE_QUEUE_SIZE_MAX) },
{ "max-buffer-size", "max buffer size should be pre-read",
OPTION_OFFSET(max_buffer_size), OPTION_INT(MAX_QUEUE_SIZE, 0, MAX_QUEUE_SIZE) },
{ NULL } { NULL }
}; };
#undef OPTION_INT #undef OPTION_INT
...@@ -3088,14 +3091,6 @@ void ffp_set_overlay_format(FFPlayer *ffp, int chroma_fourcc) ...@@ -3088,14 +3091,6 @@ void ffp_set_overlay_format(FFPlayer *ffp, int chroma_fourcc)
} }
} }
void ffp_set_max_buffer_size(FFPlayer *ffp, int max_buffer_size)
{
if (max_buffer_size < 0 || max_buffer_size > MAX_QUEUE_SIZE)
ffp->max_buffer_size = MAX_QUEUE_SIZE;
else
ffp->max_buffer_size = max_buffer_size;
}
int ffp_get_video_codec_info(FFPlayer *ffp, char **codec_info) int ffp_get_video_codec_info(FFPlayer *ffp, char **codec_info)
{ {
if (!codec_info) if (!codec_info)
......
...@@ -47,8 +47,6 @@ void ffp_set_format_callback(FFPlayer *ffp, ijk_format_control_message cb, ...@@ -47,8 +47,6 @@ void ffp_set_format_callback(FFPlayer *ffp, ijk_format_control_message cb,
void ffp_set_option(FFPlayer *ffp, int opt_category, const char *name, const char *value); void ffp_set_option(FFPlayer *ffp, int opt_category, const char *name, const char *value);
void ffp_set_option_int(FFPlayer *ffp, int opt_category, const char *name, int64_t value); void ffp_set_option_int(FFPlayer *ffp, int opt_category, const char *name, int64_t value);
void ffp_set_max_buffer_size(FFPlayer *ffp, int max_buffer_size);
int ffp_get_video_codec_info(FFPlayer *ffp, char **codec_info); int ffp_get_video_codec_info(FFPlayer *ffp, char **codec_info);
int ffp_get_audio_codec_info(FFPlayer *ffp, char **codec_info); int ffp_get_audio_codec_info(FFPlayer *ffp, char **codec_info);
......
...@@ -233,11 +233,7 @@ void ijkmp_set_max_buffer_size(IjkMediaPlayer *mp, int max_buffer_size) ...@@ -233,11 +233,7 @@ void ijkmp_set_max_buffer_size(IjkMediaPlayer *mp, int max_buffer_size)
{ {
assert(mp); assert(mp);
MPTRACE("%s(%d)\n", __func__, max_buffer_size); ijkmp_set_option_int(mp, IJKMP_OPT_CATEGORY_PLAYER, "max-buffer-size", max_buffer_size);
pthread_mutex_lock(&mp->mutex);
ffp_set_max_buffer_size(mp->ffplayer, max_buffer_size);
pthread_mutex_unlock(&mp->mutex);
MPTRACE("%s()=void\n", __func__);
} }
int ijkmp_get_video_codec_info(IjkMediaPlayer *mp, char **codec_info) int ijkmp_get_video_codec_info(IjkMediaPlayer *mp, char **codec_info)
......
...@@ -184,6 +184,7 @@ attribute_deprecated ...@@ -184,6 +184,7 @@ attribute_deprecated
void ijkmp_set_framedrop(IjkMediaPlayer *mp, int framedrop); void ijkmp_set_framedrop(IjkMediaPlayer *mp, int framedrop);
attribute_deprecated attribute_deprecated
void ijkmp_set_auto_play_on_prepared(IjkMediaPlayer *mp, int auto_play_on_prepared); void ijkmp_set_auto_play_on_prepared(IjkMediaPlayer *mp, int auto_play_on_prepared);
attribute_deprecated
void ijkmp_set_max_buffer_size(IjkMediaPlayer *mp, int max_buffer_size); void ijkmp_set_max_buffer_size(IjkMediaPlayer *mp, int max_buffer_size);
int ijkmp_get_video_codec_info(IjkMediaPlayer *mp, char **codec_info); int ijkmp_get_video_codec_info(IjkMediaPlayer *mp, char **codec_info);
......
...@@ -307,7 +307,7 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url, ...@@ -307,7 +307,7 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
if (!_mediaPlayer) if (!_mediaPlayer)
return; return;
ijkmp_set_max_buffer_size(_mediaPlayer, maxBufferSize); ijkmp_set_option_int(_mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "max-buffer-size", maxBufferSize);
} }
+ (void)setLogReport:(BOOL)preferLogReport + (void)setLogReport:(BOOL)preferLogReport
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "max-fps", _maxFps); ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "max-fps", _maxFps);
ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "framedrop", _frameDrop); ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "framedrop", _frameDrop);
ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "video-pictq-size", _frameBufferCount); ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "video-pictq-size", _frameBufferCount);
ijkmp_set_option_int(mediaPlayer, IJKMP_OPT_CATEGORY_PLAYER, "max-buffer-size", 123);
ijkmp_ios_set_videotoolbox_enabled(mediaPlayer, _videotoolboxEnabled); ijkmp_ios_set_videotoolbox_enabled(mediaPlayer, _videotoolboxEnabled);
ijkmp_ios_set_frame_max_width(mediaPlayer, _frameMaxWidth); ijkmp_ios_set_frame_max_width(mediaPlayer, _frameMaxWidth);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册