Implement decoding=Keyframes + OnDemand

pull/3482/head
Isaac Connor 2022-05-10 14:25:34 -04:00
parent 3bcd0447a7
commit 997c1197cf
5 changed files with 8 additions and 1 deletions

View File

@ -461,7 +461,7 @@ CREATE TABLE `Monitors` (
`Recording` enum('None', 'OnMotion', 'Always') NOT NULL default 'Always',
`Enabled` tinyint(3) unsigned NOT NULL default '1',
`DecodingEnabled` tinyint(3) unsigned NOT NULL default '1',
`Decoding` enum('None','Ondemand','KeyFrames','Always') NOT NULL default 'Always',
`Decoding` enum('None','Ondemand','KeyFrames','KeyFrames+Ondemand', 'Always') NOT NULL default 'Always',
`JanusEnabled` BOOLEAN NOT NULL default false,
`JanusAudioEnabled` BOOLEAN NOT NULL default false,
`LinkedMonitors` varchar(255),

2
db/zm_update-1.37.16.sql Normal file
View File

@ -0,0 +1,2 @@
/*ALTER TABLE `Monitors` MODIFY `Decoding` enum('None','Ondemand','KeyFrames','Always') NOT NULL default 'Always';*/
ALTER TABLE `Monitors` MODIFY `Decoding` enum('None','Ondemand','KeyFrames','KeyFrames+Ondemand', 'Always') NOT NULL default 'Always';

View File

@ -144,6 +144,7 @@ std::string Decoding_Strings[] = {
"None",
"On demand",
"Keyframes",
"Keyframes + Ondemand",
"Always"
};
@ -2600,6 +2601,8 @@ bool Monitor::Decode() {
((decoding == DECODING_ONDEMAND) and this->hasViewers() )
or
((decoding == DECODING_KEYFRAMES) and packet->keyframe)
or
((decoding == DECODING_KEYFRAMESONDEMAND) and (this->hasViewers() or packet->keyframe))
) {
// Allocate the image first so that it can be used by hwaccel

View File

@ -95,6 +95,7 @@ public:
DECODING_NONE=1,
DECODING_ONDEMAND,
DECODING_KEYFRAMES,
DECODING_KEYFRAMESONDEMAND,
DECODING_ALWAYS
} DecodingOption;

View File

@ -92,6 +92,7 @@ public static function getDecodingOptions() {
'None' => translate('None'),
'Ondemand' => translate('On Demand'),
'KeyFrames' => translate('KeyFrames Only'),
'KeyFrames+Ondemand' => translate('Keyframes + Ondemand'),
'Always' => translate('Always'),
);
}