Factory class for creating video player instances. More...
#include <video_player_factory.h>
Static Public Member Functions | |
static std::unique_ptr< IVideoPlayer > | createVideoPlayer (SDL_Renderer *renderer, const std::string &path, int width, int height, IConfigService *configService) |
Creates a video player instance based on the configured backend. | |
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.
|
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.
renderer | The SDL renderer used for video rendering. |
path | The file path to the video to be played. |
width | The width of the video display area in pixels. |
height | The height of the video display area in pixels. |
configService | Pointer to the configuration service for accessing settings. |