mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
android: improve vp8 video streaming
During a VP8 video call on the android client, the peer video freezes. Optimizes android video buffers using an array instead of a vector. Lets VP8 decide when to send a keyframe. Change-Id: I19893c2ac080782daee72958fb6c174eea42037a Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
This commit is contained in:

committed by
Guillaume Roguez

parent
ec2f1ebe43
commit
3e5d652eba
@ -181,11 +181,10 @@ MediaEncoder::openOutput(const char *filename,
|
||||
av_opt_set_int(encoderCtx_->priv_data, "error-resilient", 1, 0);
|
||||
av_opt_set_int(encoderCtx_->priv_data, "cpu-used", 3, 0);
|
||||
av_opt_set_int(encoderCtx_->priv_data, "lag-in-frames", 0, 0);
|
||||
// don't set encoderCtx_->gop_size: let libvpx decide when to insert a keyframe
|
||||
encoderCtx_->slices = 2; // VP8E_SET_TOKEN_PARTITIONS
|
||||
encoderCtx_->qmin = 4;
|
||||
encoderCtx_->qmax = 56;
|
||||
encoderCtx_->gop_size = 999999;
|
||||
|
||||
encoderCtx_->rc_buffer_size = maxBitrate;
|
||||
encoderCtx_->bit_rate = maxBitrate;
|
||||
if (crf != SystemCodecInfo::DEFAULT_NO_QUALITY) {
|
||||
|
@ -57,7 +57,7 @@ VideoInput::VideoInput()
|
||||
std::bind(&VideoInput::process, this),
|
||||
std::bind(&VideoInput::cleanup, this))
|
||||
#if defined(__ANDROID__) || defined(RING_UWP)
|
||||
, mutex_(), frame_cv_(), buffers_(8)
|
||||
, mutex_(), frame_cv_(), buffers_()
|
||||
#endif
|
||||
{}
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <array>
|
||||
|
||||
namespace ring {
|
||||
class MediaDecoder;
|
||||
@ -132,7 +133,7 @@ private:
|
||||
|
||||
/* Get notified when libav is done with this buffer */
|
||||
void releaseBufferCb(uint8_t* ptr);
|
||||
std::vector<struct VideoFrameBuffer> buffers_;
|
||||
std::array<struct VideoFrameBuffer, 8> buffers_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user