Setup encoders inexpensively before first frame.

Modifies WebRtcVideoSendStream to use a default width/height of 16px.
This significantly reduces SetRemoteDescription time under
WebRtcVideoEngine2. Also preventing (expensive) reconfigurations due to
incoming frames when the channel is not sending yet.

Tests have been modified to generate a frame before expecting a certain
encoder size to have been configured.

Also adding tracing to WebRtcVideoSendStream::InputFrame as it can lead
to reconfigurations of the encoder which is expensive and it should show
up in chrome://tracing.

BUG=1788
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42369004

Cr-Commit-Position: refs/heads/master@{#8381}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8381 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2015-02-16 21:02:00 +00:00
parent 34509d9f33
commit 86196c4f48
4 changed files with 55 additions and 13 deletions

View File

@ -126,6 +126,11 @@ SimulcastEncoderAdapter::~SimulcastEncoderAdapter() {
}
int SimulcastEncoderAdapter::Release() {
// TODO(pbos): Keep the last encoder instance but call ::Release() on it, then
// re-use this instance in ::InitEncode(). This means that changing
// resolutions doesn't require reallocation of the first encoder, but only
// reinitialization, which makes sense. Then Destroy this instance instead in
// ~SimulcastEncoderAdapter().
while (!streaminfos_.empty()) {
VideoEncoder* encoder = streaminfos_.back().encoder;
factory_->Destroy(encoder);