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

Concrete implementation of IVideoPlayer using VLC (libVLC). More...

#include <vlc_player.h>

+ Inheritance diagram for VlcVideoPlayer:
+ Collaboration diagram for VlcVideoPlayer:

Public Member Functions

 VlcVideoPlayer ()
 Constructs a VlcVideoPlayer instance.
 
 ~VlcVideoPlayer () override
 Destroys the VlcVideoPlayer instance and cleans up VLC resources.
 
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.
 
void play () override
 Starts video playback.
 
void stop () override
 Stops video playback.
 
void update () override
 Updates the video frame and texture.
 
SDL_Texture * getTexture () const override
 Retrieves the current video frame as an SDL_Texture.
 
bool isPlaying () const override
 Checks if the video is currently playing.
 
void setVolume (float volume) override
 Sets the volume for the video's audio track.
 
void setMute (bool mute) override
 Sets the mute state for the video's audio track.
 
- Public Member Functions inherited from IVideoPlayer
virtual ~IVideoPlayer ()=default
 Destructor.
 

Detailed Description

Concrete implementation of IVideoPlayer using VLC (libVLC).

This class provides video playback capabilities by integrating with the libVLC library. It handles video decoding, rendering to an SDL_Texture, and basic playback controls, including volume and mute for the video's audio track.

Member Function Documentation

◆ getTexture()

SDL_Texture * VlcVideoPlayer::getTexture ( ) const
overridevirtual

Retrieves the current video frame as an SDL_Texture.

Returns
Pointer to the SDL_Texture.

Implements IVideoPlayer.

◆ isPlaying()

bool VlcVideoPlayer::isPlaying ( ) const
overridevirtual

Checks if the video is currently playing.

Returns
True if playing, false otherwise.

Implements IVideoPlayer.

◆ play()

void VlcVideoPlayer::play ( )
overridevirtual

Starts video playback.

Implements IVideoPlayer.

◆ setMute()

void VlcVideoPlayer::setMute ( bool  mute)
overridevirtual

Sets the mute state for the video's audio track.

Parameters
muteTrue to mute, false to unmute.

Implements IVideoPlayer.

◆ setup()

bool VlcVideoPlayer::setup ( SDL_Renderer *  renderer,
const std::string &  path,
int  width,
int  height 
)
overridevirtual

Sets up the VLC video player with the given renderer, path, and dimensions.

Parameters
rendererPointer to the SDL_Renderer.
pathPath to the video file.
widthDesired width of the video texture.
heightDesired height of the video texture.
Returns
True if setup is successful, false otherwise.

Implements IVideoPlayer.

◆ setVolume()

void VlcVideoPlayer::setVolume ( float  volume)
overridevirtual

Sets the volume for the video's audio track.

Parameters
volumeThe desired volume, a float between 0.0 (silent) and 1.0 (full volume).

Implements IVideoPlayer.

◆ stop()

void VlcVideoPlayer::stop ( )
overridevirtual

Stops video playback.

Implements IVideoPlayer.

◆ update()

void VlcVideoPlayer::update ( )
overridevirtual

Updates the video frame and texture.

Implements IVideoPlayer.


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