summaryrefslogtreecommitdiff
path: root/modules/webm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/webm')
-rw-r--r--modules/webm/doc_classes/VideoStreamWebm.xml6
-rw-r--r--modules/webm/register_types.cpp4
-rw-r--r--modules/webm/register_types.h4
-rw-r--r--modules/webm/video_stream_webm.cpp46
-rw-r--r--modules/webm/video_stream_webm.h4
5 files changed, 37 insertions, 27 deletions
diff --git a/modules/webm/doc_classes/VideoStreamWebm.xml b/modules/webm/doc_classes/VideoStreamWebm.xml
index ff11bbb37d..dfa04720cf 100644
--- a/modules/webm/doc_classes/VideoStreamWebm.xml
+++ b/modules/webm/doc_classes/VideoStreamWebm.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.2">
+<class name="VideoStreamWebm" inherits="VideoStream" version="4.0">
<brief_description>
+ [VideoStream] resource for WebM videos.
</brief_description>
<description>
+ [VideoStream] resource handling the [url=https://www.webmproject.org/]WebM[/url] video format with [code].webm[/code] extension.
</description>
<tutorials>
</tutorials>
@@ -11,6 +13,7 @@
<return type="String">
</return>
<description>
+ Returns the WebM video file handled by this [VideoStreamWebm].
</description>
</method>
<method name="set_file">
@@ -19,6 +22,7 @@
<argument index="0" name="file" type="String">
</argument>
<description>
+ Sets the WebM video file that this [VideoStreamWebm] resource handles. The [code]file[/code] name should have the [code].webm[/code] extension.
</description>
</method>
</methods>
diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp
index ad8e2cf310..5449dd458c 100644
--- a/modules/webm/register_types.cpp
+++ b/modules/webm/register_types.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webm/register_types.h b/modules/webm/register_types.h
index 10811badaf..962a0dab4e 100644
--- a/modules/webm/register_types.h
+++ b/modules/webm/register_types.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index 54b284f939..2763d30bb5 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,21 +30,22 @@
#include "video_stream_webm.h"
-#include "OpusVorbisDecoder.hpp"
-#include "VPXDecoder.hpp"
-#include <vpx/vpx_image.h>
-
-#include "mkvparser/mkvparser.h"
-
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "core/project_settings.h"
+#include "servers/audio_server.h"
#include "thirdparty/misc/yuv2rgb.h"
-#include "servers/audio_server.h"
+// libsimplewebm
+#include <OpusVorbisDecoder.hpp>
+#include <VPXDecoder.hpp>
+
+// libvpx
+#include <vpx/vpx_image.h>
-#include <string.h>
+// libwebm
+#include <mkvparser/mkvparser.h>
class MkvReader : public mkvparser::IMkvReader {
@@ -335,22 +336,22 @@ void VideoStreamPlaybackWebm::update(float p_delta) {
} else if (image.chromaShiftW == 1 && image.chromaShiftH == 1) {
yuv420_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2);
- // libyuv::I420ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
+ //libyuv::I420ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
converted = true;
} else if (image.chromaShiftW == 1 && image.chromaShiftH == 0) {
yuv422_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2);
- // libyuv::I422ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
+ //libyuv::I422ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
converted = true;
} else if (image.chromaShiftW == 0 && image.chromaShiftH == 0) {
yuv444_2_rgb8888(w.ptr(), image.planes[0], image.planes[1], image.planes[2], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2);
- // libyuv::I444ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
+ //libyuv::I444ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
converted = true;
} else if (image.chromaShiftW == 2 && image.chromaShiftH == 0) {
- // libyuv::I411ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
- // converted = true;
+ //libyuv::I411ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2] image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h);
+ //converted = true;
}
if (converted) {
@@ -392,17 +393,22 @@ int VideoStreamPlaybackWebm::get_mix_rate() const {
inline bool VideoStreamPlaybackWebm::has_enough_video_frames() const {
if (video_frames_pos > 0) {
-
- const double audio_delay = AudioServer::get_singleton()->get_output_latency();
+ // FIXME: AudioServer output latency was fixed in af9bb0e, previously it used to
+ // systematically return 0. Now that it gives a proper latency, it broke this
+ // code where the delay compensation likely never really worked.
+ //const double audio_delay = AudioServer::get_singleton()->get_output_latency();
const double video_time = video_frames[video_frames_pos - 1]->time;
- return video_time >= time + audio_delay + delay_compensation;
+ return video_time >= time + /* audio_delay + */ delay_compensation;
}
return false;
}
bool VideoStreamPlaybackWebm::should_process(WebMFrame &video_frame) {
- const double audio_delay = AudioServer::get_singleton()->get_output_latency();
- return video_frame.time >= time + audio_delay + delay_compensation;
+ // FIXME: AudioServer output latency was fixed in af9bb0e, previously it used to
+ // systematically return 0. Now that it gives a proper latency, it broke this
+ // code where the delay compensation likely never really worked.
+ //const double audio_delay = AudioServer::get_singleton()->get_output_latency();
+ return video_frame.time >= time + /* audio_delay + */ delay_compensation;
}
void VideoStreamPlaybackWebm::delete_pointers() {
diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h
index 4f79d46cce..e679196cf2 100644
--- a/modules/webm/video_stream_webm.h
+++ b/modules/webm/video_stream_webm.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */