Skip to content

Commit 40d0a14

Browse files
committed
merge with video decoder branch
Merge branch 'video_decoder' into wip
2 parents e4b1e21 + e2f167e commit 40d0a14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6201
-487
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@
2626
[submodule "modules/le_tracy/3rdparty/tracy"]
2727
path = modules/le_tracy/3rdparty/tracy
2828
url = https://github.com/wolfpld/tracy.git
29+
[submodule "modules/le_video_decoder/3rdparty/minimp4"]
30+
path = modules/le_video_decoder/3rdparty/minimp4
31+
url = https://github.com/lieff/minimp4
32+

apps/examples/asterisks/asterisks_app/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,17 @@ set (SOURCES "asterisks_app.cpp")
1616
set (SOURCES ${SOURCES} "asterisks_app.h")
1717

1818
if (${PLUGINS_DYNAMIC})
19-
2019
add_library(${TARGET} SHARED ${SOURCES})
21-
22-
2320
add_dynamic_linker_flags()
24-
2521
target_compile_definitions(${TARGET} PUBLIC "PLUGINS_DYNAMIC")
26-
2722
else()
28-
29-
# Adding a static library means to also add a linker dependency for our target
30-
# to the library.
31-
23+
# Adding a static library means to also add
24+
# a linker dependency for our target to the library.
3225
add_static_lib(${TARGET})
3326
add_library(${TARGET} STATIC ${SOURCES})
34-
3527
endif()
3628

29+
target_include_directories(${TARGET} PUBLIC ${MODULE_LOCATIONS_LIST})
3730
target_link_libraries(${TARGET} PUBLIC ${LINKER_FLAGS})
3831

3932
source_group(${TARGET} FILES ${SOURCES})

apps/examples/hello_triangle/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ project(${PROJECT_NAME})
1313
# (currently this will only work correctly under Linux) add_compile_definitions(
1414
# LE_MT=4 )
1515

16-
# To enable tracing with Tracy, uncomment the following line
16+
# To enable tracing with Tracy, uncomment the following line:
1717
# add_compile_definitions( TRACY_ENABLE )
1818

1919
# Vulkan Validation layers are enabled by default for Debug builds. Uncomment

apps/examples/hello_triangle/hello_triangle_app/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,14 @@ set (SOURCES "hello_triangle_app.cpp")
1919
set (SOURCES ${SOURCES} "hello_triangle_app.h")
2020

2121
if (${PLUGINS_DYNAMIC})
22-
2322
add_library(${TARGET} SHARED ${SOURCES})
24-
2523
add_dynamic_linker_flags()
26-
2724
target_compile_definitions(${TARGET} PUBLIC "PLUGINS_DYNAMIC")
28-
2925
else()
30-
31-
# Adding a static library means to also add a linker dependency for our target
32-
# to the library.
26+
# Adding a static library means to also add
27+
# a linker dependency for our target to the library.
3328
add_static_lib(${TARGET})
34-
3529
add_library(${TARGET} STATIC ${SOURCES})
36-
3730
endif()
3831

3932
target_link_libraries(${TARGET} PUBLIC ${LINKER_FLAGS})
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cmake_minimum_required(VERSION 3.7.2)
2+
set (CMAKE_CXX_STANDARD 20)
3+
4+
set (PROJECT_NAME "Island-VideoPlayerExample")
5+
6+
# Set global property (all targets are impacted)
7+
# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
8+
# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CMAKE_COMMAND} -E time")
9+
10+
project (${PROJECT_NAME})
11+
12+
#if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
13+
# add_compile_options("-ftime-trace")
14+
#endif()
15+
16+
message(STATUS "Compiler id: '${CMAKE_CXX_COMPILER_ID}'" )
17+
18+
# set to number of worker threads if you wish to use multi-threaded rendering
19+
# add_compile_definitions( LE_MT=4 )
20+
21+
# Video is a vulkan beta feature, we must enable beta extensions therefore
22+
add_compile_definitions( VK_ENABLE_BETA_EXTENSIONS=true)
23+
24+
# Point this to the base directory of your Island installation
25+
set (ISLAND_BASE_DIR "${PROJECT_SOURCE_DIR}/../../..")
26+
27+
# Select which standard Island modules to use
28+
set(REQUIRES_ISLAND_LOADER ON )
29+
set(REQUIRES_ISLAND_CORE ON )
30+
31+
# Loads Island framework, based on selected Island modules from above
32+
include ("${ISLAND_BASE_DIR}/CMakeLists.txt.island_prolog.in")
33+
34+
# Add custom module search paths
35+
# add_island_module_location("${ISLAND_BASE_DIR}/../modules")
36+
37+
# Main application c++ file. Not much to see there,
38+
set (SOURCES main.cpp)
39+
40+
# Add application module, and (optionally) any other private
41+
# island modules which should not be part of the shared framework.
42+
add_subdirectory (video_player_example_app)
43+
44+
# Sets up Island framework linkage and housekeeping, based on user selections
45+
include ("${ISLAND_BASE_DIR}/CMakeLists.txt.island_epilog.in")
46+
47+
# create a link to local resources
48+
link_resources(${PROJECT_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/local_resources)
49+
50+
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
51+
52+
source_group(${PROJECT_NAME} FILES ${SOURCES})
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "video_player_example_app/video_player_example_app.h"
2+
3+
// ----------------------------------------------------------------------
4+
5+
int main( int argc, char const* argv[] ) {
6+
7+
VideoPlayerExampleApp::initialize();
8+
9+
{
10+
// We instantiate VideoPlayerExampleApp in its own scope - so that
11+
// it will be destroyed before VideoPlayerExampleApp::terminate
12+
// is called.
13+
14+
VideoPlayerExampleApp VideoPlayerExampleApp{};
15+
16+
for ( ;; ) {
17+
18+
#ifdef PLUGINS_DYNAMIC
19+
le_core_poll_for_module_reloads();
20+
#endif
21+
auto result = VideoPlayerExampleApp.update();
22+
23+
if ( !result ) {
24+
break;
25+
}
26+
}
27+
}
28+
29+
// Must only be called once last VideoPlayerExampleApp is destroyed
30+
VideoPlayerExampleApp::terminate();
31+
32+
return 0;
33+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#version 450 core
2+
3+
#extension GL_ARB_separate_shader_objects : enable
4+
#extension GL_ARB_shading_language_420pack : enable
5+
6+
// inputs
7+
layout (location = 0) in VertexData {
8+
vec2 texCoord;
9+
} inData;
10+
11+
// outputs
12+
layout (location = 0) out vec4 outFragColor;
13+
14+
// Note the suffix to the sampler name: `__ycbcr__` - this signals to Island
15+
// that the image is a yuv image, and that it must create an immutable color
16+
// conversion sampler for this image.
17+
//
18+
layout (set = 1, binding = 0 ) uniform sampler2D tex_video__ycbcr__;
19+
20+
layout (set = 0, binding = 0) uniform Mvp
21+
{
22+
mat4 modelMatrix;
23+
mat4 viewMatrix;
24+
mat4 projectionMatrix;
25+
};
26+
27+
void main(){
28+
outFragColor = vec4( texture(tex_video__ycbcr__, inData.texCoord).rgb, 1 );
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#version 450 core
2+
3+
#extension GL_ARB_separate_shader_objects : enable
4+
#extension GL_ARB_shading_language_420pack : enable
5+
6+
// inputs
7+
layout (location = 0) in vec3 pos;
8+
layout (location = 1) in vec2 tex_coord;
9+
10+
// outputs
11+
layout (location = 0) out VertexData {
12+
vec2 texCoord;
13+
} outData;
14+
15+
16+
// arguments
17+
layout (set = 0, binding = 0) uniform Mvp {
18+
mat4 modelMatrix;
19+
mat4 viewMatrix;
20+
mat4 projectionMatrix;
21+
};
22+
23+
// We override the built-in fixed function outputs
24+
// to have more control over the SPIR-V code created.
25+
out gl_PerVertex {
26+
vec4 gl_Position;
27+
};
28+
29+
30+
31+
void main() {
32+
33+
outData.texCoord = tex_coord;
34+
35+
vec4 position = projectionMatrix * viewMatrix * modelMatrix * vec4(pos,1);
36+
37+
gl_Position = position;
38+
}
964 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)