Valkka  1.6.1
OpenSource Video Management
framefilter2.h
Go to the documentation of this file.
1 #ifndef framefilter2_HEADER_GUARD
2 #define framefilter2_HEADER_GUARD
3 /*
4  * framefilter2.h : More framefilters
5  *
6  * (c) Copyright 2017-2024 Sampsa Riikonen
7  *
8  * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
9  *
10  * This file is part of the Valkka library.
11  *
12  * Valkka is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Affero General Public License as
14  * published by the Free Software Foundation, either version 3 of the
15  * License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Affero General Public License for more details.
21  *
22  * You should have received a copy of the GNU Affero General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>
24  *
25  */
26 
36 #include "framefilter.h"
37 #include "tools.h"
38 #include "Python.h"
39 
40 
61 class AlertFrameFilter : public FrameFilter { // <pyapi>
62 
63 public: // <pyapi>
64  AlertFrameFilter(const char *name, PyObject* pycallback, FrameFilter *next = NULL); // <pyapi>
65  virtual ~AlertFrameFilter(); // <pyapi>
66 protected:
67  PyObject* pycallback;
68 
69 protected:
70  void run(Frame* frame);
71  void go(Frame *frame);
72 
73 }; // <pyapi>
74 
75 
84 class DumpAVBitmapFrameFilter : public FrameFilter { // <pyapi>
85 
86 public: // <pyapi>
87  DumpAVBitmapFrameFilter(const char *name, FrameFilter *next = NULL); // <pyapi>
88 
89 protected:
90  int count;
91 
92 protected:
93  void go(Frame *frame);
94 }; // <pyapi>
95 
96 
102 class FPSCountFrameFilter : public FrameFilter { // <pyapi>
103 
104 public: // <pyapi>
105  FPSCountFrameFilter(const char *name, const long int msinterval, FrameFilter *next = NULL); // <pyapi>
106 
107 private:
108  int count;
109  long int prevtime;
110  long int msinterval;
111 
112 public:
113  static std::mutex print_mutex; // Declaration of the static mutex
114 
115 protected:
116  void go(Frame *frame);
117 }; // <pyapi>
118 
119 std::mutex FPSCountFrameFilter::print_mutex;
120 
121 #endif
LiveThread sends a special frame if a camera is detected offline.
Definition: framefilter2.h:61
void run(Frame *frame)
Calls this->go(Frame* frame) and then calls the this->next->run(Frame* frame) (if this->next !...
Definition: framefilter2.cpp:58
void go(Frame *frame)
Does the actual filtering/modification to the Frame. Define in subclass.
Definition: framefilter2.cpp:55
Dumps AVBitmapFrame(s) into a files.
Definition: framefilter2.h:84
void go(Frame *frame)
Does the actual filtering/modification to the Frame. Define in subclass.
Definition: framefilter2.cpp:111
Counts fps and prints the fps value on the terminal every N seconds.
Definition: framefilter2.h:102
void go(Frame *frame)
Does the actual filtering/modification to the Frame. Define in subclass.
Definition: framefilter2.cpp:163
The mother class of all frame filters! FrameFilters are used to create "filter chains".
Definition: framefilter.h:44
FrameFilter * next
The next frame filter in the chain to be applied.
Definition: framefilter.h:60
Frame: An abstract queueable class.
Definition: frame.h:112
Definition of FrameFilter and derived classes for various purposes.
Auxiliary routines.