📄 readme.encoderwatchdog
字号:
Reason for an encoder watchdog------------------------------On one hand, the SM2288 encoder will not crash easily, but highbitrate and perturbed video input will make it more sensible tocrashing.On the other hand, it's not acceptable that a user recording a 2hmovie gets it half for a few seconds signal quality defect.As a consequence, private/encoderprivate.c contains some code torestart the encoder automatically when it is in a state where itshould output data but does not.This is an emergency measure only and the system stream at thejunction between bogus termination and emergency restart _will not be_compliant with standards. We hope the decoding software will beerror-resilient enough to skip the defect.In the worst case about five seconds of video will be lost.What are the conditions to trigger the watchdog?------------------------------------------------The watchdog is run in the following cases:1- immediately, if one of the following TX_FIFO message occurs: case 0x01e0: // ? case 0xaff4: // discarded gop case 0xeeb0: // VOBU error case 0xeeb4: // VOBU error case 0xeef3: // end frame flag lackingbecause they have proved to stall encoder immediately anyways.2- every ENCODER_WATCHDOG_UPDATE_PERIOD_US microseconds (currently,5000000 microseconds), the byte count is compared to the previous testbyte count. If both numbers are equal, the encoder is considered asstalled (crashed). What does the watchdog?-----------------------The watchdog runs encoderprivate_softreset(), meaning the currentencoding parameters are kept as close as possible to the parametersthat were used before crashing (they are not reset to params.h). Thismeans an error-resilient decoder will go on demuxing the same systemtype, decoding same audio type, etc.The watchdog is entirely handled in kernel mode. From the userapplication point of view, the bitstream will be invalid at somepoint, and the happening REALMAGICHWL_HAPPENING_ENCODER_CRASH may betested regularly to get ready for some woes. The user can choose tonever test REALMAGICHWL_HAPPENING_ENCODER_CRASH and trust the recoveryabilities of its playback software.Details of implementation (see code in private/encoderprivate.c)----------------------------------------------------------------The test 2- is, of course, disabled when the encoder is in STOP modeor PAUSE mode. `pE->eW.encoderRunning' is used to distinguish betweenthese cases.Since it's not possible to run START before having uploaded a correctparameter list (RUA_ENCODER_RESET() or ENCODER_PARAMSAPPLY property),the situation when 0xfeed is received and pE->eW.encoderRunning==1 isthe valid test to enter // actual encoder watchdog part IITo disable the watchdog, replace:// actual encoder watchdog part I if (triggerSoftReset) {by// actual encoder watchdog part I if (0) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -