Add Capturing() Analysing() Recording() and fix hasViewers logic
This commit is contained in:
parent
509cecf9f5
commit
cc51642eff
|
@ -499,6 +499,11 @@ public:
|
||||||
return storage;
|
return storage;
|
||||||
}
|
}
|
||||||
inline CameraType GetType() const { return type; }
|
inline CameraType GetType() const { return type; }
|
||||||
|
|
||||||
|
CapturingOption Capturing() const { return capturing; }
|
||||||
|
AnalysingOption Analysing() const { return analysing; }
|
||||||
|
RecordingOption Recording() const { return recording; }
|
||||||
|
|
||||||
inline Function GetFunction() const { return function; }
|
inline Function GetFunction() const { return function; }
|
||||||
inline PacketQueue * GetPacketQueue() { return &packetqueue; }
|
inline PacketQueue * GetPacketQueue() { return &packetqueue; }
|
||||||
inline bool Enabled() const {
|
inline bool Enabled() const {
|
||||||
|
@ -534,9 +539,12 @@ public:
|
||||||
}
|
}
|
||||||
bool hasViewers() {
|
bool hasViewers() {
|
||||||
if (shared_data && shared_data->valid) {
|
if (shared_data && shared_data->valid) {
|
||||||
TimePoint now = std::chrono::steady_clock::now();;
|
TimePoint now = std::chrono::steady_clock::now();
|
||||||
return (
|
return (
|
||||||
(shared_data->last_viewed_time - static_cast<int64>(std::chrono::duration_cast<Seconds>(now.time_since_epoch()).count())
|
(
|
||||||
|
static_cast<int64>(std::chrono::duration_cast<Seconds>(now.time_since_epoch()).count())
|
||||||
|
-
|
||||||
|
shared_data->last_viewed_time
|
||||||
) > 1 ? false : true);
|
) > 1 ? false : true);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue