Reinitialize cdm video decoder only when codec change#1001
Reinitialize cdm video decoder only when codec change#1001glennguy merged 2 commits intoxbmc:Nexusfrom
Conversation
glennguy
left a comment
There was a problem hiding this comment.
Amazing, looks really good!
|
So does this then solve the issue we would have on amlogic/CE devices where video is lost after the first stream change? |
|
yes tested (with n@tflix) on CoreElec when DEMUX_SPECIALID is signaled not stuck the playback anymore, comparing to Windows build, the quality switching: |
|
Great! It's certainly better than no picture at all. Maybe some improvements on Kodi side can make it more seamless. |
OpenVideoDecoderis called each time that the stream quality change and currently force callInitializeVideoDecoderin the cdm during playback, at least with N@tflix this cause cdm errors when the stream quality is switched during the playback, so freeze the playbackA possible solution is call
DeinitializeDecoderbefore recallInitializeVideoDecoder,but as is implemented now cause a delay (image freezed for some secs),
from a search on chromium sources seem that they allow call
InitializeVideoDecoderduring playback, but only in the situation that the codec change,
trying to do this i can see that the playback now works when stream quality change,
we will see if someone report a regression but it should not
Since i compared the sources, i took the opportunity to do some cleaning, and to make some parts more similar to chromium conterpart. Changes:
DecodeVideomethod is now splitted in to:DecryptAndDecodeVideo,VideoFrameDataToPicturehostglobal variable to new Helper.h, to allow have access to log methods without being restricted by each class (in a future prospective to have the main/ssd projects merged)WV_CencSingleSampleDecrypterin favour of simple vectorsSSD_SAMPLEstruct, to have fullDEMUX_PACKETcrypto dataThe only functional change in the cleanup is that the
cdm::InputBuffer_2 cdm_in;defined in to previousDecodeVideomethodis now constructed by using all info of SSD_SAMPLE (DEMUX_PACKET) data, instead of take some info from members variables like m_CryptBlocks, m_SkipBlocks, m_EncryptionScheme
WIP: not done android side cleanups