Skip to content

Commit

Permalink
Adds webm.
Browse files Browse the repository at this point in the history
Restore, and add seeking in webm.

Co-Authored-By: John-gdi <zhuxiaohuang@gdi.com.cn>

Install yasm.
  • Loading branch information
fire committed Oct 18, 2024
1 parent 4631a61 commit 52e95e8
Show file tree
Hide file tree
Showing 588 changed files with 168,109 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Install YASM
run: sudo apt-get update && sudo apt-get install -y yasm

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Install YASM
run: brew install yasm

- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ jobs:
if: '!matrix.legacy-scons'
uses: ./.github/actions/godot-deps

- name: Install YASM
run: sudo apt-get update && sudo apt-get install -y yasm

- name: Setup Python and SCons (legacy versions)
if: matrix.legacy-scons
uses: ./.github/actions/godot-deps
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Install YASM
run: brew install yasm

- name: Setup Vulkan SDK
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Install YASM
run: sudo apt-get update && sudo apt-get install -y yasm

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
- name: Download Direct3D 12 SDK components
run: python ./misc/scripts/install_d3d12_sdk_windows.py

- name: Install YASM
run: choco install yasm

- name: Download pre-built ANGLE static libraries
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
Expand Down
29 changes: 29 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ Copyright: 1995-2024, The PNG Reference Library Authors.
1995-1996, Guy Eric Schalnat, Group 42, Inc.
License: Zlib

Files: ./thirdparty/libsimplewebm/
Comment: libsimplewebm
Copyright: 2016, Błażej Szczygieł
License: Expat

Files: ./thirdparty/libsimplewebm/libwebm/
Comment: The WebM Project
Copyright: 2010, Google Inc.
License: BSD-3-clause

Files: ./thirdparty/libtheora/
Comment: OggTheora
Copyright: 2002-2009, Xiph.org Foundation
Expand All @@ -329,6 +339,17 @@ Comment: OggVorbis
Copyright: 2002-2015, Xiph.org Foundation
License: BSD-3-clause

Files: ./thirdparty/libvpx/
Comment: The WebM Project
Copyright: 2010, The WebM Project authors.
License: BSD-3-clause

Files: ./thirdparty/libvpx/third_party/android/cpu-features.c
./thirdparty/libvpx/third_party/android/cpu-features.h
Comment: The Android Open Source Project
Copyright: 2010, The Android Open Source Project
License: BSD-2-clause

Files: ./thirdparty/libwebp/
Comment: WebP codec
Copyright: 2010, Google Inc.
Expand Down Expand Up @@ -455,6 +476,14 @@ Comment: Stripped down version of "nvapi.h" from the NVIDIA NVAPI SDK
Copyright: 2019-2022, NVIDIA Corporation
License: Expat

Files: ./thirdparty/opus/
Comment: Opus
Copyright: 2001-2011, Xiph.Org, Skype Limited, Octasic,
Jean-Marc Valin, Timothy B. Terriberry,
CSIRO, Gregory Maxwell, Mark Borgerding,
Erik de Castro Lopo
License: BSD-3-clause

Files: ./thirdparty/openxr/
Comment: OpenXR Loader
Copyright: 2020-2023, The Khronos Group Inc.
Expand Down
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,10 @@ opts.Add(BoolVariable("builtin_harfbuzz", "Use the built-in HarfBuzz library", T
opts.Add(BoolVariable("builtin_icu4c", "Use the built-in ICU library", True))
opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True))
opts.Add(BoolVariable("builtin_libpng", "Use the built-in libpng library", True))
opts.Add(BoolVariable("builtin_opus", "Use the built-in Opus library", True))
opts.Add(BoolVariable("builtin_libtheora", "Use the built-in libtheora library", True))
opts.Add(BoolVariable("builtin_libvorbis", "Use the built-in libvorbis library", True))
opts.Add(BoolVariable("builtin_libvpx", "Use the built-in libvpx library", True))
opts.Add(BoolVariable("builtin_libwebp", "Use the built-in libwebp library", True))
opts.Add(BoolVariable("builtin_wslay", "Use the built-in wslay library", True))
opts.Add(BoolVariable("builtin_mbedtls", "Use the built-in mbedTLS library", True))
Expand Down
49 changes: 49 additions & 0 deletions modules/webm/SCsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python

Import("env")
Import("env_modules")

env_webm = env_modules.Clone()

# Thirdparty source files

thirdparty_obj = []

thirdparty_dir = "#thirdparty/libsimplewebm/"
thirdparty_sources = [
"libwebm/mkvparser/mkvparser.cc",
"OpusVorbisDecoder.cpp",
"VPXDecoder.cpp",
"WebMDemuxer.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]

env_webm.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])

# also requires libogg, libvorbis and libopus
if env["builtin_libogg"]:
env_webm.Prepend(CPPPATH=["#thirdparty/libogg"])
if env["builtin_libvorbis"]:
env_webm.Prepend(CPPPATH=["#thirdparty/libvorbis"])
if env["builtin_opus"]:
env_webm.Prepend(CPPPATH=["#thirdparty/opus"])
SConscript("opus/SCsub")

if env["builtin_libvpx"]:
env_webm.Prepend(CPPPATH=["#thirdparty/libvpx"])
SConscript("libvpx/SCsub")

env_thirdparty = env_webm.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj

# Godot source files

module_obj = []

env_webm.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj

# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)
19 changes: 19 additions & 0 deletions modules/webm/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def can_build(env, platform):
if platform in ["iphone", "web"]:
return False

return True


def configure(env):
pass


def get_doc_classes():
return [
"VideoStreamWebm",
]


def get_doc_path():
return "doc_classes"
13 changes: 13 additions & 0 deletions modules/webm/doc_classes/VideoStreamWebm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VideoStreamWebm" inherits="VideoStream" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<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. Both the VP8 and VP9 codecs are supported. The VP8 and VP9 codecs are more efficient than [VideoStreamTheora], but they require more CPU resources to decode (especially VP9). Both the VP8 and VP9 codecs are decoded on the CPU.
[b]Note:[/b] Alpha channel (also known as transparency) is not supported. The video will always appear to have a black background, even if it originally contains an alpha channel.
[b]Note:[/b] There are known bugs and performance issues with WebM video playback in Godot. If you run into problems, try using the Ogg Theora format instead: [VideoStreamTheora]
</description>
<tutorials>
</tutorials>
</class>
Loading

0 comments on commit 52e95e8

Please sign in to comment.