Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
GtkGlRenderer.h
1#pragma once
2
3#include "Module.h"
4#include <chrono>
5#include <gtk/gtk.h>
6
8{
9public:
10 GtkGlRendererProps(GtkWidget *_glArea, int _windowWidth, int _windowHeight, bool _isPlaybackRenderer = true) : ModuleProps() // take gtk string
11 {
12 // gladeFileName = _gladeFileName;
13 glArea = _glArea;
14 windowWidth = _windowWidth;
15 windowHeight = _windowHeight;
16 isPlaybackRenderer = _isPlaybackRenderer;
17 }
18 GtkWidget *glArea;
19 int windowWidth = 0;
20 int windowHeight = 0;
21 bool isPlaybackRenderer = true;
22};
23
24class GtkGlRenderer : public Module
25{
26public:
29 bool init();
30 bool term();
31 bool changeProps(GtkWidget *glArea, int windowWidth, int windowHeight);
32protected:
33 bool process(frame_container &frames);
34 bool processSOS(frame_sp &frame);
35 bool validateInputPins();
36 bool shouldTriggerSOS();
37 bool handleCommand(Command::CommandType type, frame_sp &frame);
38 void pushFrame(frame_sp frame);
39
40private:
41 class Detail;
42 boost::shared_ptr<Detail> mDetail;
43 std::chrono::steady_clock::time_point lastFrameTime =
44 std::chrono::steady_clock::now();
45 std::queue<frame_sp> frameQueue;
46 std::mutex queueMutex;
47};
CommandType
Definition Command.h:9
Definition GtkGlRenderer.h:8
int windowHeight
Definition GtkGlRenderer.h:20
GtkGlRendererProps(GtkWidget *_glArea, int _windowWidth, int _windowHeight, bool _isPlaybackRenderer=true)
Definition GtkGlRenderer.h:10
int windowWidth
Definition GtkGlRenderer.h:19
bool isPlaybackRenderer
Definition GtkGlRenderer.h:21
GtkWidget * glArea
Definition GtkGlRenderer.h:18
Definition GtkGlRenderer.cpp:26
Definition GtkGlRenderer.h:25
bool init()
Definition GtkGlRenderer.cpp:240
bool changeProps(GtkWidget *glArea, int windowWidth, int windowHeight)
Definition GtkGlRenderer.cpp:295
std::mutex queueMutex
Definition GtkGlRenderer.h:46
bool processSOS(frame_sp &frame)
Definition GtkGlRenderer.cpp:317
std::chrono::steady_clock::time_point lastFrameTime
Definition GtkGlRenderer.h:43
boost::shared_ptr< Detail > mDetail
Definition GtkGlRenderer.h:42
bool validateInputPins()
Definition GtkGlRenderer.cpp:276
std::queue< frame_sp > frameQueue
Definition GtkGlRenderer.h:45
bool process(frame_container &frames)
Definition GtkGlRenderer.cpp:254
bool term()
Definition GtkGlRenderer.cpp:289
void pushFrame(frame_sp frame)
Definition GtkGlRenderer.cpp:270
GtkGlRenderer(GtkGlRendererProps props)
Definition GtkGlRenderer.cpp:229
~GtkGlRenderer()
Definition GtkGlRenderer.cpp:238
bool handleCommand(Command::CommandType type, frame_sp &frame)
Definition GtkGlRenderer.cpp:388
bool shouldTriggerSOS()
Definition GtkGlRenderer.cpp:307
Definition Module.h:33
Definition Module.h:151