#include "video_stream_theora.h"
#include "core/config/project_settings.h"
#include "core/os/os.h"
#include "scene/resources/image_texture.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4127)
#endif
#include "thirdparty/misc/yuv2rgb.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
int VideoStreamPlaybackTheora::buffer_data() { … }
int VideoStreamPlaybackTheora::queue_page(ogg_page *page) { … }
void VideoStreamPlaybackTheora::video_write() { … }
void VideoStreamPlaybackTheora::clear() { … }
void VideoStreamPlaybackTheora::set_file(const String &p_file) { … }
double VideoStreamPlaybackTheora::get_time() const { … }
Ref<Texture2D> VideoStreamPlaybackTheora::get_texture() const { … }
void VideoStreamPlaybackTheora::update(double p_delta) { … }
void VideoStreamPlaybackTheora::play() { … }
void VideoStreamPlaybackTheora::stop() { … }
bool VideoStreamPlaybackTheora::is_playing() const { … }
void VideoStreamPlaybackTheora::set_paused(bool p_paused) { … }
bool VideoStreamPlaybackTheora::is_paused() const { … }
double VideoStreamPlaybackTheora::get_length() const { … }
double VideoStreamPlaybackTheora::get_playback_position() const { … }
void VideoStreamPlaybackTheora::seek(double p_time) { … }
int VideoStreamPlaybackTheora::get_channels() const { … }
void VideoStreamPlaybackTheora::set_audio_track(int p_idx) { … }
int VideoStreamPlaybackTheora::get_mix_rate() const { … }
#ifdef THEORA_USE_THREAD_STREAMING
void VideoStreamPlaybackTheora::_streaming_thread(void *ud) {
VideoStreamPlaybackTheora *vs = static_cast<VideoStreamPlaybackTheora *>(ud);
while (!vs->thread_exit) {
if (!vs->thread_eof) {
int to_read = vs->ring_buffer.space_left();
if (to_read > 0) {
uint64_t read = vs->file->get_buffer(vs->read_buffer.ptr(), to_read);
vs->ring_buffer.write(vs->read_buffer.ptr(), read);
vs->thread_eof = vs->file->eof_reached();
}
}
vs->thread_sem->wait();
}
}
#endif
VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() { … }
VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() {
#ifdef THEORA_USE_THREAD_STREAMING
memdelete(thread_sem);
#endif
clear();
};
void VideoStreamTheora::_bind_methods() { … }
Ref<Resource> ResourceFormatLoaderTheora::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { … }
void ResourceFormatLoaderTheora::get_recognized_extensions(List<String> *p_extensions) const { … }
bool ResourceFormatLoaderTheora::handles_type(const String &p_type) const { … }
String ResourceFormatLoaderTheora::get_resource_type(const String &p_path) const { … }