Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feature/video-module' of github.com:MGTheTrain/cpp-samp…
Browse files Browse the repository at this point in the history
…le-bindings into feature/video-module
  • Loading branch information
MGTheTrain committed Apr 19, 2024
2 parents c7975c2 + 9fc3d05 commit 85b808b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
38 changes: 19 additions & 19 deletions modules/video/include/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@ extern "C" {
* @brief The VideoPlayer struct represents a video player.
*/
struct VideoPlayer {
/**
* @brief Constructs a new VideoPlayer object.
*/
VideoPlayer();
/**
* @brief Constructs a new VideoPlayer object.
*/
VideoPlayer();

AVFormatContext* formatContext;
AVCodecParameters* codecParameters;
AVCodecContext* codecContext;
SDL_Window* window;
SDL_Renderer* renderer;
SDL_Texture* texture;
struct SwsContext* swsContext;
AVFrame* frame;
int videoStream;
AVRational timeBase;
double frameDuration;
AVFormatContext* formatContext;
AVCodecParameters* codecParameters;
AVCodecContext* codecContext;
SDL_Window* window;
SDL_Renderer* renderer;
SDL_Texture* texture;
struct SwsContext* swsContext;
AVFrame* frame;
int videoStream;
AVRational timeBase;
double frameDuration;
};

/**
* @brief Initializes the video player.
*
*
* @param player Reference to the VideoPlayer object.
* @return True if initialization succeeds, false otherwise.
*/
bool initVideoPlayer(VideoPlayer& player);

/**
* @brief Loads a video file into the video player.
*
*
* @param player Reference to the VideoPlayer object.
* @param filename The path to the video file.
* @return True if loading succeeds, false otherwise.
Expand All @@ -74,14 +74,14 @@ bool loadVideo(VideoPlayer& player, const char* filename);

/**
* @brief Starts playing the loaded video.
*
*
* @param player Reference to the VideoPlayer object.
*/
void playVideo(VideoPlayer& player);

/**
* @brief Closes the video player and releases resources.
*
*
* @param player Reference to the VideoPlayer object.
*/
void closeVideoPlayer(VideoPlayer& player);
Expand Down
12 changes: 6 additions & 6 deletions modules/video/src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <video.h>

/**
* @brief Constructs a new VideoPlayer object.
*/
* @brief Constructs a new VideoPlayer object.
*/
VideoPlayer::VideoPlayer() {
formatContext = nullptr;
codecParameters = nullptr;
Expand All @@ -39,7 +39,7 @@ VideoPlayer::VideoPlayer() {

/**
* @brief Initializes the video player.
*
*
* @param player Reference to the VideoPlayer object.
* @return True if initialization succeeds, false otherwise.
*/
Expand All @@ -59,7 +59,7 @@ bool initVideoPlayer(VideoPlayer& player) {

/**
* @brief Loads a video file into the video player.
*
*
* @param player Reference to the VideoPlayer object.
* @param filename The path to the video file.
* @return True if loading succeeds, false otherwise.
Expand Down Expand Up @@ -158,7 +158,7 @@ bool loadVideo(VideoPlayer& player, const char* filename) {

/**
* @brief Starts playing the loaded video.
*
*
* @param player Reference to the VideoPlayer object.
*/
void playVideo(VideoPlayer& player) {
Expand Down Expand Up @@ -202,7 +202,7 @@ void playVideo(VideoPlayer& player) {

/**
* @brief Closes the video player and releases resources.
*
*
* @param player Reference to the VideoPlayer object.
*/
void closeVideoPlayer(VideoPlayer& player) {
Expand Down

0 comments on commit 85b808b

Please sign in to comment.