mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
static Ref<ResourceFormatLoaderTheora> resource_loader_theora;
|
||||
|
||||
void register_theora_types() {
|
||||
|
||||
resource_loader_theora.instance();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_theora, true);
|
||||
|
||||
@@ -43,7 +42,6 @@ void register_theora_types() {
|
||||
}
|
||||
|
||||
void unregister_theora_types() {
|
||||
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_theora);
|
||||
resource_loader_theora.unref();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "thirdparty/misc/yuv2rgb.h"
|
||||
|
||||
int VideoStreamPlaybackTheora::buffer_data() {
|
||||
|
||||
char *buffer = ogg_sync_buffer(&oy, 4096);
|
||||
|
||||
#ifdef THEORA_USE_THREAD_STREAMING
|
||||
@@ -93,15 +92,12 @@ void VideoStreamPlaybackTheora::video_write(void) {
|
||||
//uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2);
|
||||
|
||||
if (px_fmt == TH_PF_444) {
|
||||
|
||||
yuv444_2_rgb8888((uint8_t *)dst, (uint8_t *)yuv[0].data, (uint8_t *)yuv[1].data, (uint8_t *)yuv[2].data, size.x, size.y, yuv[0].stride, yuv[1].stride, size.x << 2);
|
||||
|
||||
} else if (px_fmt == TH_PF_422) {
|
||||
|
||||
yuv422_2_rgb8888((uint8_t *)dst, (uint8_t *)yuv[0].data, (uint8_t *)yuv[1].data, (uint8_t *)yuv[2].data, size.x, size.y, yuv[0].stride, yuv[1].stride, size.x << 2);
|
||||
|
||||
} else if (px_fmt == TH_PF_420) {
|
||||
|
||||
yuv420_2_rgb8888((uint8_t *)dst, (uint8_t *)yuv[0].data, (uint8_t *)yuv[1].data, (uint8_t *)yuv[2].data, size.x, size.y, yuv[0].stride, yuv[1].stride, size.x << 2);
|
||||
};
|
||||
|
||||
@@ -116,7 +112,6 @@ void VideoStreamPlaybackTheora::video_write(void) {
|
||||
}
|
||||
|
||||
void VideoStreamPlaybackTheora::clear() {
|
||||
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
@@ -162,7 +157,6 @@ void VideoStreamPlaybackTheora::clear() {
|
||||
};
|
||||
|
||||
void VideoStreamPlaybackTheora::set_file(const String &p_file) {
|
||||
|
||||
ERR_FAIL_COND(playing);
|
||||
ogg_packet op;
|
||||
th_setup_info *ts = NULL;
|
||||
@@ -230,7 +224,6 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
|
||||
memcpy(&to, &test, sizeof(test));
|
||||
theora_p = 1;
|
||||
} else if (!vorbis_p && vorbis_synthesis_headerin(&vi, &vc, &op) >= 0) {
|
||||
|
||||
/* it is vorbis */
|
||||
if (audio_track_skip) {
|
||||
vorbis_info_clear(&vi);
|
||||
@@ -370,12 +363,10 @@ float VideoStreamPlaybackTheora::get_time() const {
|
||||
};
|
||||
|
||||
Ref<Texture> VideoStreamPlaybackTheora::get_texture() const {
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
@@ -411,13 +402,11 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
/* if there's pending, decoded audio, grab it */
|
||||
ret = vorbis_synthesis_pcmout(&vd, &pcm);
|
||||
if (ret > 0) {
|
||||
|
||||
const int AUXBUF_LEN = 4096;
|
||||
int to_read = ret;
|
||||
float aux_buffer[AUXBUF_LEN];
|
||||
|
||||
while (to_read) {
|
||||
|
||||
int m = MIN(AUXBUF_LEN / vi.channels, to_read);
|
||||
|
||||
int count = 0;
|
||||
@@ -445,7 +434,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
audio_frames_wrote += ret - to_read;
|
||||
|
||||
} else {
|
||||
|
||||
/* no pending audio; is there a pending packet to decode? */
|
||||
if (ogg_stream_packetout(&vo, &op) > 0) {
|
||||
if (vorbis_synthesis(&vb, &op) == 0) { /* test for success! */
|
||||
@@ -465,7 +453,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
while (theora_p && !frame_done) {
|
||||
/* theora is one in, one out... */
|
||||
if (ogg_stream_packetout(&to, &op) > 0) {
|
||||
|
||||
if (false && pp_inc) {
|
||||
pp_level += pp_inc;
|
||||
th_decode_ctl(td, TH_DECCTL_SET_PPLEVEL, &pp_level,
|
||||
@@ -532,7 +519,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
|
||||
/* are we at or past time for this video frame? */
|
||||
if (videobuf_ready && videobuf_time <= get_time()) {
|
||||
|
||||
//video_write();
|
||||
//videobuf_ready=0;
|
||||
} else {
|
||||
@@ -552,7 +538,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||
};
|
||||
|
||||
void VideoStreamPlaybackTheora::play() {
|
||||
|
||||
if (!playing)
|
||||
time = 0;
|
||||
else {
|
||||
@@ -565,9 +550,7 @@ void VideoStreamPlaybackTheora::play() {
|
||||
};
|
||||
|
||||
void VideoStreamPlaybackTheora::stop() {
|
||||
|
||||
if (playing) {
|
||||
|
||||
clear();
|
||||
set_file(file_name); //reset
|
||||
}
|
||||
@@ -576,17 +559,14 @@ void VideoStreamPlaybackTheora::stop() {
|
||||
};
|
||||
|
||||
bool VideoStreamPlaybackTheora::is_playing() const {
|
||||
|
||||
return playing;
|
||||
};
|
||||
|
||||
void VideoStreamPlaybackTheora::set_paused(bool p_paused) {
|
||||
|
||||
paused = p_paused;
|
||||
};
|
||||
|
||||
bool VideoStreamPlaybackTheora::is_paused() const {
|
||||
|
||||
return paused;
|
||||
};
|
||||
|
||||
@@ -595,27 +575,22 @@ void VideoStreamPlaybackTheora::set_loop(bool p_enable){
|
||||
};
|
||||
|
||||
bool VideoStreamPlaybackTheora::has_loop() const {
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
float VideoStreamPlaybackTheora::get_length() const {
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
String VideoStreamPlaybackTheora::get_stream_name() const {
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
int VideoStreamPlaybackTheora::get_loop_count() const {
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
float VideoStreamPlaybackTheora::get_playback_position() const {
|
||||
|
||||
return get_time();
|
||||
};
|
||||
|
||||
@@ -624,37 +599,30 @@ void VideoStreamPlaybackTheora::seek(float p_time) {
|
||||
}
|
||||
|
||||
void VideoStreamPlaybackTheora::set_mix_callback(AudioMixCallback p_callback, void *p_userdata) {
|
||||
|
||||
mix_callback = p_callback;
|
||||
mix_udata = p_userdata;
|
||||
}
|
||||
|
||||
int VideoStreamPlaybackTheora::get_channels() const {
|
||||
|
||||
return vi.channels;
|
||||
}
|
||||
|
||||
void VideoStreamPlaybackTheora::set_audio_track(int p_idx) {
|
||||
|
||||
audio_track = p_idx;
|
||||
}
|
||||
|
||||
int VideoStreamPlaybackTheora::get_mix_rate() const {
|
||||
|
||||
return vi.rate;
|
||||
}
|
||||
|
||||
#ifdef THEORA_USE_THREAD_STREAMING
|
||||
|
||||
void VideoStreamPlaybackTheora::_streaming_thread(void *ud) {
|
||||
|
||||
VideoStreamPlaybackTheora *vs = (VideoStreamPlaybackTheora *)ud;
|
||||
|
||||
while (!vs->thread_exit) {
|
||||
|
||||
//just fill back the buffer
|
||||
if (!vs->thread_eof) {
|
||||
|
||||
int to_read = vs->ring_buffer.space_left();
|
||||
if (to_read) {
|
||||
int read = vs->file->get_buffer(vs->read_buffer.ptr(), to_read);
|
||||
@@ -670,7 +638,6 @@ void VideoStreamPlaybackTheora::_streaming_thread(void *ud) {
|
||||
#endif
|
||||
|
||||
VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() {
|
||||
|
||||
file = NULL;
|
||||
theora_p = 0;
|
||||
vorbis_p = 0;
|
||||
@@ -699,7 +666,6 @@ VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() {
|
||||
};
|
||||
|
||||
VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() {
|
||||
|
||||
clear();
|
||||
|
||||
if (file)
|
||||
@@ -707,7 +673,6 @@ VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() {
|
||||
};
|
||||
|
||||
void VideoStreamTheora::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_file", "file"), &VideoStreamTheora::set_file);
|
||||
ClassDB::bind_method(D_METHOD("get_file"), &VideoStreamTheora::get_file);
|
||||
|
||||
@@ -717,7 +682,6 @@ void VideoStreamTheora::_bind_methods() {
|
||||
////////////
|
||||
|
||||
RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_original_path, Error *r_error) {
|
||||
|
||||
FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
|
||||
if (!f) {
|
||||
if (r_error) {
|
||||
@@ -741,17 +705,14 @@ RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_origi
|
||||
}
|
||||
|
||||
void ResourceFormatLoaderTheora::get_recognized_extensions(List<String> *p_extensions) const {
|
||||
|
||||
p_extensions->push_back("ogv");
|
||||
}
|
||||
|
||||
bool ResourceFormatLoaderTheora::handles_type(const String &p_type) const {
|
||||
|
||||
return ClassDB::is_parent_class(p_type, "VideoStream");
|
||||
}
|
||||
|
||||
String ResourceFormatLoaderTheora::get_resource_type(const String &p_path) const {
|
||||
|
||||
String el = p_path.get_extension().to_lower();
|
||||
if (el == "ogv")
|
||||
return "VideoStreamTheora";
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
//#define THEORA_USE_THREAD_STREAMING
|
||||
|
||||
class VideoStreamPlaybackTheora : public VideoStreamPlayback {
|
||||
|
||||
GDCLASS(VideoStreamPlaybackTheora, VideoStreamPlayback);
|
||||
|
||||
enum {
|
||||
@@ -162,7 +161,6 @@ public:
|
||||
};
|
||||
|
||||
class VideoStreamTheora : public VideoStream {
|
||||
|
||||
GDCLASS(VideoStreamTheora, VideoStream);
|
||||
|
||||
String file;
|
||||
|
||||
Reference in New Issue
Block a user