Add HW fallback option to software decoding.

Permits falling back to software decoding for unsupported resolutions in
bitstreams.

BUG=4625, chromium:487934
R=mflodman@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9209}
This commit is contained in:
Peter Boström
2015-05-18 19:42:03 +02:00
parent b26198972c
commit 7252a2ba80
10 changed files with 360 additions and 23 deletions

View File

@@ -2223,6 +2223,21 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream(
SetRecvCodecs(recv_codecs);
}
WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder::
AllocatedDecoder(webrtc::VideoDecoder* decoder,
webrtc::VideoCodecType type,
bool external)
: decoder(decoder),
external_decoder(nullptr),
type(type),
external(external) {
if (external) {
external_decoder = decoder;
this->decoder =
new webrtc::VideoDecoderSoftwareFallbackWrapper(type, external_decoder);
}
}
WebRtcVideoChannel2::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() {
call_->DestroyVideoReceiveStream(stream_);
ClearDecoders(&allocated_decoders_);
@@ -2330,10 +2345,9 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders(
for (size_t i = 0; i < allocated_decoders->size(); ++i) {
if ((*allocated_decoders)[i].external) {
external_decoder_factory_->DestroyVideoDecoder(
(*allocated_decoders)[i].decoder);
} else {
delete (*allocated_decoders)[i].decoder;
(*allocated_decoders)[i].external_decoder);
}
delete (*allocated_decoders)[i].decoder;
}
allocated_decoders->clear();
}

View File

@@ -430,9 +430,10 @@ class WebRtcVideoChannel2 : public rtc::MessageHandler,
struct AllocatedDecoder {
AllocatedDecoder(webrtc::VideoDecoder* decoder,
webrtc::VideoCodecType type,
bool external)
: decoder(decoder), type(type), external(external) {}
bool external);
webrtc::VideoDecoder* decoder;
// Decoder wrapped into a fallback decoder to permit software fallback.
webrtc::VideoDecoder* external_decoder;
webrtc::VideoCodecType type;
bool external;
};