Initial Commit
This commit is contained in:
commit
f4fa723863
22 changed files with 1402 additions and 0 deletions
30
src/player.h
Normal file
30
src/player.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "channel.h"
|
||||
#include "frame_queue.h"
|
||||
|
||||
typedef struct Player {
|
||||
FrameQueue frame_queue;
|
||||
SDL_Thread *thread;
|
||||
SDL_atomic_t stop_requested;
|
||||
const ChannelList *channels;
|
||||
int current_index;
|
||||
time_t app_start_time;
|
||||
Uint32 tuning_blackout_until;
|
||||
SDL_mutex *error_mutex;
|
||||
char last_error[256];
|
||||
} Player;
|
||||
|
||||
int player_init(Player *player, const ChannelList *channels, time_t app_start_time);
|
||||
void player_destroy(Player *player);
|
||||
int player_tune(Player *player, int channel_index);
|
||||
int player_consume_latest_frame(Player *player, FrameData *out);
|
||||
double player_live_position(const Player *player, time_t now);
|
||||
int player_is_in_blackout(const Player *player);
|
||||
void player_get_error(Player *player, char *buffer, size_t buffer_size);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue