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:
parent
d7d307ff56
commit
fe744f4724
|
@ -52,6 +52,8 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
|
||||||
|
|
||||||
void set_duration(int duration) { duration_ = duration; }
|
void set_duration(int duration) { duration_ = duration; }
|
||||||
|
|
||||||
|
void set_extra_data(const std::vector<uint8>& data) { extra_data_ = data; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class base::RefCountedThreadSafe<StreamInfo>;
|
friend class base::RefCountedThreadSafe<StreamInfo>;
|
||||||
virtual ~StreamInfo();
|
virtual ~StreamInfo();
|
||||||
|
|
|
@ -316,13 +316,16 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_video_decoder_config_) {
|
if (last_video_decoder_config_) {
|
||||||
// Verify that the video decoder config has not changed.
|
if (last_video_decoder_config_->extra_data() != decoder_config_record) {
|
||||||
if (last_video_decoder_config_->extra_data() == decoder_config_record) {
|
// Video configuration has changed. Issue warning.
|
||||||
// Video configuration has not changed.
|
// TODO(tinskip): Check the nature of the configuration change. Only
|
||||||
return true;
|
// 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 true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: a MAP unit can be either 16 or 32 pixels.
|
// TODO: a MAP unit can be either 16 or 32 pixels.
|
||||||
|
|
Loading…
Reference in New Issue