29#include <SDL_render.h>
33#include <condition_variable>
40#ifdef CORSIX_TH_USE_FFMPEG
45#define INT64_C(c) (c##LL)
46#define UINT64_C(c) (c##ULL)
48#include <libavcodec/avcodec.h>
52#include <libavformat/avformat.h>
53#include <libavutil/avutil.h>
59#include <libswresample/swresample.h>
64#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
97 std::unique_ptr<AVCodecContext, av_codec_context_deleter>;
110#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 24, 100)
122 std::unique_ptr<AVChannelLayout, av_channel_layout_deleter>;
248 std::condition_variable
cond;
251 std::array<movie_picture, picture_buffer_size>
picture_queue;
285 std::queue<av_packet_unique_ptr> data;
288 std::condition_variable
398#ifdef CORSIX_TH_USE_FFMPEG
449 std::atomic<bool> paused{};
480 std::array<std::uint8_t, 1024>
Definition th_movie.h:299
int get_native_width() const
Return the original width of the movie.
Definition th_movie.cpp:797
double refresh(const SDL_Rect &destination_rect)
Definition th_movie.cpp:802
void deallocate_picture_buffer()
Definition th_movie.cpp:804
void play(int requested_audio_channel)
Definition th_movie.cpp:789
void run_video()
Definition th_movie.cpp:806
void unload()
Definition th_movie.cpp:788
bool movies_enabled() const
Return whether movies were compiled into CorsixTH.
Definition th_movie.cpp:786
void read_streams()
Definition th_movie.cpp:805
void stop()
Stop the currently playing movie.
Definition th_movie.cpp:794
int get_native_height() const
Return the original height of the movie.
Definition th_movie.cpp:796
bool load(const char *szFilepath)
Load the movie with the given file name.
Definition th_movie.cpp:787
~movie_player()
Destroy the movie_player.
Definition th_movie.cpp:784
void clear_last_error()
Definition th_movie.cpp:801
const char * get_last_error() const
Return a text description of the last error encountered.
Definition th_movie.cpp:800
void set_renderer(SDL_Renderer *pRenderer)
Definition th_movie.cpp:785
double get_movie_length() const
Return the length of the movie in milliseconds.
Definition th_movie.cpp:799
void allocate_picture_buffer()
Allocate the picture buffer for the current renderer.
Definition th_movie.cpp:803
bool has_audio_track() const
Return whether the movie has an audio stream.
Definition th_movie.cpp:798
void copy_audio_to_stream(uint8_t *pbStream, int iStreamSize)
Definition th_movie.cpp:807
movie_player()
Construct a new movie_player.
Definition th_movie.cpp:783
void togglePause()
Definition th_movie.cpp:795