When content is encrypted, we cannot properly parse buffers
to check if it contains bidirectional frame. Before this
patch is assumed that in such situations, bidirectional
frames existance flag should be set, but some codecs doesn't
have them at all. Enabling additional logic might degrade
performance and stability of playback.
Bug: https://jira-eu.sec.samsung.net/browse/VDGAME-707
Change-Id: I2b89ee406cdb59515b72a49afba907913cd1736f
Signed-off-by: Jakub Gajownik <j.gajownik2@samsung.com>
}
return 0;
}
+
+bool CanCodecHaveBidirectionalFrames(MediaVideoCodec codec) {
+ return MaxForwardReferenceFrameDistance(codec) > 0;
+}
} // namespace
void DecodedCollectionOnGpu::NotifyModeChange(gfx::VideoOutputMode mode) {
const DecoderBuffer& buffer) {
UpdateConfig(&config_,
base::span<const uint8_t>(buffer.data(), buffer.data_size()));
- if (buffer.is_encrypted() && !config_.has_bidirectional_frames) {
+ if (buffer.is_encrypted() && !config_.has_bidirectional_frames &&
+ CanCodecHaveBidirectionalFrames(codec_)) {
TIZEN_MEDIA_LOG(INFO)
<< "Encrypted buffer, assume it has bidirectional frames";
config_.has_bidirectional_frames = true;