4#include "render/ivideo_player.h"
36 bool setup(SDL_Renderer* renderer,
const std::string& path,
int width,
int height)
override;
81 void setMute(
bool mute)
override;
88 libvlc_instance_t* instance;
89 libvlc_media_player_t* player;
90 SDL_Renderer* renderer;
111 static void* lock([[maybe_unused]]
void* data,
void** pixels);
119 static void unlock([[maybe_unused]]
void* data, [[maybe_unused]]
void*
id, [[maybe_unused]]
void*
const* pixels);
126 static void display([[maybe_unused]]
void* data, [[maybe_unused]]
void*
id);
131 void cleanupContext();
Interface for a video player.
Definition ivideo_player.h:19
Concrete implementation of IVideoPlayer using VLC (libVLC).
Definition vlc_player.h:16
VlcVideoPlayer()
Constructs a VlcVideoPlayer instance.
Definition vlc_player.cpp:11
void stop() override
Stops video playback.
Definition vlc_player.cpp:201
SDL_Texture * getTexture() const override
Retrieves the current video frame as an SDL_Texture.
Definition vlc_player.cpp:245
int getFrameCount() const
Returns the number of frames received from VLC (diagnostic).
Definition vlc_player.cpp:249
void setMute(bool mute) override
Sets the mute state for the video's audio track.
Definition vlc_player.cpp:272
void play() override
Starts video playback.
Definition vlc_player.cpp:187
bool isPlaying() const override
Checks if the video is currently playing.
Definition vlc_player.cpp:253
void setVolume(float volume) override
Sets the volume for the video's audio track.
Definition vlc_player.cpp:261
bool setup(SDL_Renderer *renderer, const std::string &path, int width, int height) override
Sets up the VLC video player with the given renderer, path, and dimensions.
Definition vlc_player.cpp:88
~VlcVideoPlayer() override
Destroys the VlcVideoPlayer instance and cleans up VLC resources.
Definition vlc_player.cpp:13
void update() override
Updates the video frame and texture.
Definition vlc_player.cpp:212