MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
Loading...
Searching...
No Matches
mediax::sdl::DisplayManager Class Reference

The display manager class. More...

#include <display_manager_sdl.h>

Inheritance diagram for mediax::sdl::DisplayManager:
Inheritance graph
Collaboration diagram for mediax::sdl::DisplayManager:
Collaboration graph

Public Member Functions

 DisplayManager (std::string name="")
 Construct a new Display Manager object.
 
 ~DisplayManager ()
 Destroy the Display Manager object.
 
 DisplayManager (const DisplayManager &)=delete
 Construct a new Display Manager object (deleted)
 
DisplayManageroperator= (const DisplayManager &)=delete
 Delete the copy operator.
 
Status Initalise (uint32_t width, uint32_t height, bool fullscreen)
 Initalise the display manager.
 
Status Initalise () override
 Initalise the display manager.
 
Resolution GetResolution () override
 Get the Resolution attribute.
 
int GetBytesPerPixel () final
 Get the Bits Per Pixel object.
 
mediax::rtp::ColourspaceType GetColourspace () final
 Get the Colourspace object.
 
Status DisplayBuffer (uint8_t *frame_buffer, Resolution resolution, std::string text) override
 Buffer must be in the format RGBA.
 
void Flush () override
 Flush the framebuffer if needed.
 
void ToggleFullscreen () override
 Toggle Fullscreen.
 
void Run () override
 Run the main event loop.
 
void Stop () override
 Stop the main loop if there is one.
 
- Public Member Functions inherited from mediax::DisplayManagerBase
 DisplayManagerBase (std::string name="")
 Construct a new Display Manager object.
 
virtual ~DisplayManagerBase ()=default
 Destroy the Display Manager object.
 
void SetResolution (Resolution resolution)
 Set the Resolution object.
 
std::string GetName ()
 Get the Name object.
 
Status Rescale (uint8_t *frame_buffer, void *display_buffer, Resolution resolution, int height, int width)
 Rescale the video if needed.
 

Static Public Attributes

static std::string text_ = "unset"
 The text to display.
 

Private Attributes

bool initaliased_ = false
 Initalized flag.
 
SDL_Window * window_ = nullptr
 The SDL window.
 
SDL_Surface * surface_ = nullptr
 The SDL surface.
 
SDL_Renderer * renderer_ = nullptr
 The SDL renderer.
 
SDL_Rect texr_ = {0, 0, 0, 0}
 The SDL texture rect.
 

Static Private Attributes

static std::vector< uint8_t > frame_buffer_
 Frame buffer device.
 
static int width_ = kDefaultWidth
 The default width.
 
static int height_ = kDefaultHeight
 The default height.
 
static std::mutex frame_buffer_mutex_
 The mutex for the frame buffer.
 
static std::vector< uint8_t > draw_buffer_
 The draw buffer.
 
static SDL_Texture * texture_ = nullptr
 The SDL texture.
 
static bool running_ = true
 The SDL event loop.
 
static int fullscreen_ = 0
 The fullscreen flag.
 

Additional Inherited Members

- Data Fields inherited from mediax::DisplayManagerBase
Resolution last_requested_resolution_ = {0, 0, 0}
 Last requested resolution.
 
std::vector< uint8_t > scaled_frame_buffer_
 Scaled frame buffer for resolutions that do not match the display.
 
std::string name_
 The name of the display, can be used in the window title if windowing is supported.
 

Detailed Description

The display manager class.

Member Function Documentation

◆ DisplayBuffer()

Status mediax::sdl::DisplayManager::DisplayBuffer ( uint8_t *  frame_buffer,
Resolution  resolution,
std::string  text 
)
overridevirtual

Buffer must be in the format RGBA.

Parameters
frame_bufferthe frame buffer to display
resolutionthe resolution of the frame buffer
textThe text to display
Returns
Status

Implements mediax::DisplayManagerBase.

◆ Flush()

void mediax::sdl::DisplayManager::Flush ( )
overridevirtual

Flush the framebuffer if needed.

Implements mediax::DisplayManagerBase.

◆ GetBytesPerPixel()

int mediax::sdl::DisplayManager::GetBytesPerPixel ( )
inlinefinalvirtual

Get the Bits Per Pixel object.

Returns
int Always return for for RGB as we use Cairo which pads the upper 8 bits (unused)

Implements mediax::DisplayManagerBase.

◆ GetColourspace()

mediax::rtp::ColourspaceType mediax::sdl::DisplayManager::GetColourspace ( )
inlinefinalvirtual

Get the Colourspace object.

Returns
mediax::rtp::ColourspaceType

Reimplemented from mediax::DisplayManagerBase.

◆ GetResolution()

Resolution mediax::sdl::DisplayManager::GetResolution ( )
overridevirtual

Get the Resolution attribute.

Returns
Resolution

Implements mediax::DisplayManagerBase.

◆ Initalise() [1/2]

Status mediax::sdl::DisplayManager::Initalise ( )
overridevirtual

Initalise the display manager.

Returns
Status

Implements mediax::DisplayManagerBase.

◆ Initalise() [2/2]

Status mediax::sdl::DisplayManager::Initalise ( uint32_t  width,
uint32_t  height,
bool  fullscreen 
)

Initalise the display manager.

Parameters
widthThe width of the display
heightThe height of the display
fullscreenThe flag to set fullscreen
Returns
Status
StatusDisplayManager

◆ operator=()

DisplayManager & mediax::sdl::DisplayManager::operator= ( const DisplayManager )
delete

Delete the copy operator.

Returns
DisplayManager&

◆ Run()

void mediax::sdl::DisplayManager::Run ( )
overridevirtual

Run the main event loop.

Implements mediax::DisplayManagerBase.

◆ Stop()

void mediax::sdl::DisplayManager::Stop ( )
overridevirtual

Stop the main loop if there is one.

Reimplemented from mediax::DisplayManagerBase.

◆ ToggleFullscreen()

void mediax::sdl::DisplayManager::ToggleFullscreen ( )
overridevirtual

Toggle Fullscreen.

Reimplemented from mediax::DisplayManagerBase.

Field Documentation

◆ draw_buffer_

std::vector< uint8_t > mediax::sdl::DisplayManager::draw_buffer_
staticprivate

The draw buffer.

Draw buffer.

◆ frame_buffer_

std::vector< uint8_t > mediax::sdl::DisplayManager::frame_buffer_
staticprivate

Frame buffer device.

Static frame buffer.

◆ frame_buffer_mutex_

std::mutex mediax::sdl::DisplayManager::frame_buffer_mutex_
staticprivate

The mutex for the frame buffer.

Mutex.

◆ fullscreen_

int mediax::sdl::DisplayManager::fullscreen_ = 0
staticprivate

The fullscreen flag.

Fullscreen flag.

◆ height_

int mediax::sdl::DisplayManager::height_ = kDefaultHeight
staticprivate

The default height.

Initalise height (default)

◆ running_

bool mediax::sdl::DisplayManager::running_ = true
staticprivate

The SDL event loop.

Running flag.

◆ width_

int mediax::sdl::DisplayManager::width_ = kDefaultWidth
staticprivate

The default width.

Initalise width (default)


The documentation for this class was generated from the following files: