MediaX
v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
display_manager_base.h
Go to the documentation of this file.
1
//
2
// Copyright (c) 2025, Astute Systems PTY LTD
3
//
4
// This file is part of the VivoeX project developed by Astute Systems.
5
//
6
// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7
// License. See the LICENSE file in the project root for full license details.
8
//
10
11
#ifndef HARDWARE_DISPLAY_MANAGER_BASE_H_
12
#define HARDWARE_DISPLAY_MANAGER_BASE_H_
13
14
#include <errno.h>
15
#include <fcntl.h>
16
#include <linux/fb.h>
17
#include <stdio.h>
18
#include <stdlib.h>
19
#include <string.h>
20
#include <sys/ioctl.h>
21
#include <sys/mman.h>
22
#include <sys/stat.h>
23
#include <sys/types.h>
24
#include <unistd.h>
25
26
#include <string>
27
#include <vector>
28
29
#include "
common/datatypes.h
"
30
#include "
rtp/rtp_types.h
"
31
32
namespace
mediax
{
33
35
class
DisplayManagerBase
{
36
public
:
41
DisplayManagerBase
(std::string name =
""
) :
name_
(name){};
42
47
virtual
~DisplayManagerBase
() =
default
;
48
54
virtual
Status
Initalise
() = 0;
55
60
virtual
void
Run
() = 0;
61
66
virtual
void
Stop
() {}
67
73
virtual
Resolution
GetResolution
() = 0;
74
80
void
SetResolution
(
Resolution
resolution) {
last_requested_resolution_
= resolution; }
81
87
std::string
GetName
() {
return
name_
; }
88
94
virtual
int
GetBytesPerPixel
() = 0;
95
101
virtual
mediax::rtp::ColourspaceType
GetColourspace
() {
return
mediax::rtp::ColourspaceType::kColourspaceUndefined; }
102
112
virtual
Status
DisplayBuffer
(uint8_t *frame_buffer,
Resolution
resolution, std::string text) = 0;
113
125
Status
Rescale
(uint8_t *frame_buffer,
void
*display_buffer,
Resolution
resolution,
int
height,
int
width);
126
131
virtual
void
Flush
() = 0;
132
136
virtual
void
ToggleFullscreen
() {}
137
139
Resolution
last_requested_resolution_
= {0, 0, 0};
141
std::vector<uint8_t>
scaled_frame_buffer_
;
143
std::string
name_
;
144
};
145
146
}
// namespace mediax
147
148
#endif
// HARDWARE_DISPLAY_MANAGER_BASE_H_
mediax::DisplayManagerBase
The display manager class.
Definition
display_manager_base.h:35
mediax::DisplayManagerBase::GetBytesPerPixel
virtual int GetBytesPerPixel()=0
Get the Bits Per Pixel object.
mediax::DisplayManagerBase::DisplayManagerBase
DisplayManagerBase(std::string name="")
Construct a new Display Manager object.
Definition
display_manager_base.h:41
mediax::DisplayManagerBase::Flush
virtual void Flush()=0
Flush the framebuffer /dev/fb0.
mediax::DisplayManagerBase::Initalise
virtual Status Initalise()=0
Initalise the display manager.
mediax::DisplayManagerBase::scaled_frame_buffer_
std::vector< uint8_t > scaled_frame_buffer_
Scaled frame buffer for resolutions that do not match the display.
Definition
display_manager_base.h:141
mediax::DisplayManagerBase::DisplayBuffer
virtual Status DisplayBuffer(uint8_t *frame_buffer, Resolution resolution, std::string text)=0
Buffer must be in the format RGBA.
mediax::DisplayManagerBase::GetResolution
virtual Resolution GetResolution()=0
Get the Resolution attribute.
mediax::DisplayManagerBase::ToggleFullscreen
virtual void ToggleFullscreen()
Toggle Fullscreen object.
Definition
display_manager_base.h:136
mediax::DisplayManagerBase::GetName
std::string GetName()
Get the Name object.
Definition
display_manager_base.h:87
mediax::DisplayManagerBase::SetResolution
void SetResolution(Resolution resolution)
Set the Resolution object.
Definition
display_manager_base.h:80
mediax::DisplayManagerBase::GetColourspace
virtual mediax::rtp::ColourspaceType GetColourspace()
Get the Colourspace object.
Definition
display_manager_base.h:101
mediax::DisplayManagerBase::Rescale
Status Rescale(uint8_t *frame_buffer, void *display_buffer, Resolution resolution, int height, int width)
Rescale the video if needed.
Definition
display_manager_base.cc:19
mediax::DisplayManagerBase::Stop
virtual void Stop()
Stop the main loop if there is one.
Definition
display_manager_base.h:66
mediax::DisplayManagerBase::Run
virtual void Run()=0
The main event loop if there is one.
mediax::DisplayManagerBase::name_
std::string name_
The name of the display, can be used in the window title if windowing is supported.
Definition
display_manager_base.h:143
mediax::DisplayManagerBase::~DisplayManagerBase
virtual ~DisplayManagerBase()=default
Destroy the Display Manager object.
mediax::DisplayManagerBase::last_requested_resolution_
Resolution last_requested_resolution_
Last requested resolution.
Definition
display_manager_base.h:139
datatypes.h
mediax::rtp::ColourspaceType
ColourspaceType
Supported colour spaces.
Definition
rtp_types.h:102
mediax
The Astute Systems (MediaX) library for video streaming.
Definition
rtp_av1_depayloader.cc:34
mediax::Status
Status
Enum of status.
Definition
datatypes.h:21
rtp_types.h
RTP streaming video types.
mediax::Resolution
The video resolution structure.
Definition
datatypes.h:34
src
renderer
display_manager_base.h
Generated by
1.9.8