MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
display_manager_fb.h
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_FB_H_
12#define HARDWARE_DISPLAY_MANAGER_FB_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"
31
32namespace mediax::fb {
33
36 public:
41 DisplayManager() = default;
42
48
53 DisplayManager(const DisplayManager &) = delete;
54
61
66 Status Initalise() override;
67
72 void Run() override{};
73
79 Resolution GetResolution() override;
80
86 int GetBytesPerPixel() final { return 3; }
87
93 mediax::rtp::ColourspaceType GetColourspace() final { return mediax::rtp::ColourspaceType::kColourspaceRgb24; }
94
104 Status DisplayBuffer(uint8_t *frame_buffer, Resolution resolution, std::string text) override;
105
110 void Flush() override;
111
112 private:
114 std::string fb_name_ = "/dev/fb0";
118 struct fb_fix_screeninfo fix_info_;
120 struct fb_var_screeninfo var_info_;
124 bool initaliased_ = false;
125};
126
127} // namespace mediax::fb
128
129#endif // HARDWARE_DISPLAY_MANAGER_FB_H_
The display manager class.
Definition display_manager_base.h:35
The display manager class.
Definition display_manager_fb.h:35
void * frame_buffer_
Frame buffer device.
Definition display_manager_fb.h:116
void Run() override
Run the main loop if these is one.
Definition display_manager_fb.h:72
DisplayManager & operator=(const DisplayManager &)=delete
Delete the copy operator.
int32_t frame_buffer_frame_device_
Frame buffer device handle.
Definition display_manager_fb.h:122
int GetBytesPerPixel() final
Get the Bits Per Pixel object.
Definition display_manager_fb.h:86
Resolution GetResolution() override
Get the Resolution attribute.
Definition display_manager_fb.cc:78
std::string fb_name_
Frame buffer device name.
Definition display_manager_fb.h:114
struct fb_fix_screeninfo fix_info_
Frame buffer device.
Definition display_manager_fb.h:118
Status DisplayBuffer(uint8_t *frame_buffer, Resolution resolution, std::string text) override
Buffer must be in the format RGBA.
Definition display_manager_fb.cc:90
DisplayManager()=default
Construct a new Display Manager object.
mediax::rtp::ColourspaceType GetColourspace() final
Get the Colourspace object.
Definition display_manager_fb.h:93
DisplayManager(const DisplayManager &)=delete
Construct a new Display Manager object (deleted)
void Flush() override
Flush the framebuffer /dev/fb0.
Definition display_manager_fb.cc:73
~DisplayManager()
Destroy the Display Manager object.
Definition display_manager_fb.cc:65
struct fb_var_screeninfo var_info_
Frame buffer info.
Definition display_manager_fb.h:120
bool initaliased_
Initalized flag.
Definition display_manager_fb.h:124
Status Initalise() override
Initalise the display manager.
Definition display_manager_fb.cc:20
ColourspaceType
Supported colour spaces.
Definition rtp_types.h:102
Status
Enum of status.
Definition datatypes.h:21
The video resolution structure.
Definition datatypes.h:34