ASAPCabinetFE
 
Loading...
Searching...
No Matches
VideoPlayerFactory Class Reference

Factory class for creating video player instances. More...

#include <video_player_factory.h>

+ Collaboration diagram for VideoPlayerFactory:

Static Public Member Functions

static std::unique_ptr< IVideoPlayercreateVideoPlayer (SDL_Renderer *renderer, const std::string &path, int width, int height, IConfigService *configService)
 Creates a video player instance based on the configured backend.
 

Detailed Description

Factory class for creating video player instances.

This class provides a static method to create video player instances (VlcVideoPlayer or FFmpegPlayer) based on the video backend specified in the configuration settings. It ensures the appropriate player is initialized with the provided renderer, path, and dimensions.

Member Function Documentation

◆ createVideoPlayer()

std::unique_ptr< IVideoPlayer > VideoPlayerFactory::createVideoPlayer ( SDL_Renderer *  renderer,
const std::string &  path,
int  width,
int  height,
IConfigService configService 
)
static

Creates a video player instance based on the configured backend.

Constructs a video player (either VlcVideoPlayer or FFmpegPlayer) depending on the video backend specified in the configuration. Returns nullptr if initialization fails or if invalid parameters are provided.

Parameters
rendererThe SDL renderer used for video rendering.
pathThe file path to the video to be played.
widthThe width of the video display area in pixels.
heightThe height of the video display area in pixels.
configServicePointer to the configuration service for accessing settings.
Returns
A unique_ptr to an IVideoPlayer instance, or nullptr on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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