Made video decoder configuration changes into a non-fatal condition.

Issued warning rather than exiting with an error so that playback
may (hopefully) continue. We see this type of situation with the
Envivio encoders, which effect trivial changes in encoding midstream.

Change-Id: Ifa552066f602157adbfa0b882cb75e479b067645
This commit is contained in:
Thomas Inskip 2014-05-29 13:21:28 -07:00
parent d7d307ff56
commit fe744f4724
2 changed files with 11 additions and 6 deletions

View File

@ -52,6 +52,8 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
void set_duration(int duration) { duration_ = duration; }
void set_extra_data(const std::vector<uint8>& data) { extra_data_ = data; }
protected:
friend class base::RefCountedThreadSafe<StreamInfo>;
virtual ~StreamInfo();

View File

@ -316,13 +316,16 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
}
if (last_video_decoder_config_) {
// Verify that the video decoder config has not changed.
if (last_video_decoder_config_->extra_data() == decoder_config_record) {
// Video configuration has not changed.
return true;
if (last_video_decoder_config_->extra_data() != decoder_config_record) {
// Video configuration has changed. Issue warning.
// TODO(tinskip): Check the nature of the configuration change. Only
// minor configuration changes (such as frame ordering) can be handled
// gracefully by decoders without notification. Major changes (such as
// video resolution changes) should be treated as errors.
LOG(WARNING) << "H.264 decoder configuration has changed.";
last_video_decoder_config_->set_extra_data(decoder_config_record);
}
NOTIMPLEMENTED() << "Varying video configurations are not supported.";
return false;
return true;
}
// TODO: a MAP unit can be either 16 or 32 pixels.