From 77e36fd02c66001eed6b33353fff3306244b26b4 Mon Sep 17 00:00:00 2001 From: ened Date: Thu, 25 Sep 2025 21:54:50 +0900 Subject: [PATCH] Implement VavCore library --- .claude/settings.local.json | 27 - .gitignore | 3 +- build_dav1d.bat | 88 +- build_libwebm.bat | 76 +- prompt.txt | 17 + vav2/CLAUDE.md | 451 +++++---- vav2/Vav2Player/Vav2Player.sln | 13 + vav2/Vav2Player/Vav2Player/App.xaml.cpp | 40 +- .../Vav2Player/LayeredVideoPage.idl | 8 + .../Vav2Player/LayeredVideoPage.xaml | 113 +++ .../Vav2Player/LayeredVideoPage.xaml.cpp | 116 +++ .../Vav2Player/LayeredVideoPage.xaml.h | 39 + .../Vav2Player/LayeredVideoWindow.idl | 8 + .../Vav2Player/LayeredVideoWindow.xaml | 135 +++ .../Vav2Player/LayeredVideoWindow.xaml.cpp | 164 ++++ .../Vav2Player/LayeredVideoWindow.xaml.h | 55 ++ vav2/Vav2Player/Vav2Player/MainVideoPage.idl | 8 + vav2/Vav2Player/Vav2Player/MainVideoPage.xaml | 144 +++ .../Vav2Player/MainVideoPage.xaml.cpp | 299 ++++++ .../Vav2Player/MainVideoPage.xaml.h | 33 + vav2/Vav2Player/Vav2Player/MainWindow.xaml | 141 +-- .../Vav2Player/Vav2Player/MainWindow.xaml.cpp | 263 +----- vav2/Vav2Player/Vav2Player/MainWindow.xaml.h | 24 +- .../Vav2Player/MainWindow_old.xaml.cpp | 290 ++++++ .../Vav2Player/MultiVideoTestPage.idl | 8 + .../Vav2Player/MultiVideoTestPage.xaml | 69 ++ .../Vav2Player/MultiVideoTestPage.xaml.cpp | 245 +++++ .../Vav2Player/MultiVideoTestPage.xaml.h | 51 + .../Vav2Player/MultiVideoTestWindow.xaml | 21 +- .../Vav2Player/MultiVideoTestWindow.xaml.cpp | 48 + .../Vav2Player/MultiVideoTestWindow.xaml.h | 10 + vav2/Vav2Player/Vav2Player/Vav2Player.vcxproj | 111 ++- .../Vav2Player/Vav2Player.vcxproj.filters | 34 +- .../Vav2Player/Vav2PlayerHeadless.vcxproj | 69 +- .../Vav2PlayerHeadless.vcxproj.user | 11 + .../Vav2Player/Vav2UnitTest.vcxproj | 56 +- .../Vav2Player/Vav2UnitTest.vcxproj.user | 4 + .../Vav2Player/VideoPlayerControl.xaml.cpp | 310 ++++--- .../Vav2Player/VideoPlayerControl.xaml.h | 38 +- .../Vav2Player/headless/DebugVavCoreTest.cpp | 116 +++ .../Vav2Player/headless/SimpleVavCoreTest.cpp | 49 + .../headless/VavCoreHeadlessMain.cpp | 209 +++++ vav2/Vav2Player/Vav2Player/headless/pch.h | 56 +- vav2/Vav2Player/Vav2Player/pch.h | 21 +- .../Vav2Player/src/Common/VavCoreVideoTypes.h | 259 ++++++ .../Vav2Player/src/Common/VideoTypes.h | 152 +-- .../src/Decoder/VideoDecoderFactory.cpp | 1 - .../src/Rendering/D3D12VideoRenderer.cpp | 20 +- .../src/Rendering/D3D12VideoRenderer.h | 8 +- .../Vav2Player/src/Rendering/IVideoRenderer.h | 6 +- .../src/Rendering/SimpleGPURenderer.cpp | 24 +- .../src/Rendering/SimpleGPURenderer.h | 11 +- .../Vav2Player/test_vavcore_simple.cpp | 43 + .../Vav2Player/unit-test/AV1DecoderTest.cpp | 21 +- .../unit-test/MockWebMFileReader.cpp | 40 +- .../Vav2Player/unit-test/MockWebMFileReader.h | 23 +- .../Vav2Player/unit-test/VavCoreTest.cpp | 195 ++++ .../unit-test/VideoPlayerControlTest.cpp | 1 - .../unit-test/VideoRendererTest.cpp | 2 - .../Vav2Player/unit-test/VideoTypesTest.cpp | 68 +- .../unit-test/WebMFileReaderTest.cpp | 3 +- vav2/Vav2Player/Vav2Player/unit-test/pch.h | 110 ++- vav2/Vav2Player/VavCore/VavCore.vcxproj | 136 +++ vav2/Vav2Player/VavCore/VavCore.vcxproj.user | 4 + .../VavCore/src/Common/D3D12Helpers.h | 254 +++++ .../src/Common/IAdaptiveVideoDecoder.h | 83 ++ .../VavCore/src/Common/VideoTypes.h | 259 ++++++ .../VavCore/src/Decoder/AV1Decoder.cpp | 277 ++++++ .../VavCore/src/Decoder/AV1Decoder.h | 101 ++ .../src/Decoder/AdaptiveAV1Decoder.cpp | 317 +++++++ .../VavCore/src/Decoder/AdaptiveAV1Decoder.h | 96 ++ .../src/Decoder/AdaptiveDecodingExample.cpp | 159 ++++ .../src/Decoder/AdaptiveNVDECDecoder.cpp | 296 ++++++ .../src/Decoder/AdaptiveNVDECDecoder.h | 143 +++ .../VavCore/src/Decoder/IVideoDecoder.h | 69 ++ .../src/Decoder/MediaFoundationAV1Decoder.cpp | 651 +++++++++++++ .../src/Decoder/MediaFoundationAV1Decoder.h | 159 ++++ .../VavCore/src/Decoder/NVDECAV1Decoder.cpp | 366 ++++++++ .../VavCore/src/Decoder/NVDECAV1Decoder.h | 110 +++ .../src/Decoder/VideoDecoderFactory.cpp | 397 ++++++++ .../VavCore/src/Decoder/VideoDecoderFactory.h | 101 ++ .../VavCore/src/FileIO/IWebMFileReader.h | 77 ++ .../VavCore/src/FileIO/WebMFileReader.cpp | 871 ++++++++++++++++++ .../VavCore/src/FileIO/WebMFileReader.h | 144 +++ vav2/Vav2Player/VavCore/src/VavCore.cpp | 610 ++++++++++++ vav2/Vav2Player/VavCore/src/pch.cpp | 1 + vav2/Vav2Player/VavCore/src/pch.h | 42 + vav2/VavCore_Library_Design.md | 601 ++++++++++++ vav2/todo7.txt | 20 + 89 files changed, 10119 insertions(+), 1303 deletions(-) create mode 100644 prompt.txt create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoPage.idl create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoPage.xaml create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoPage.xaml.cpp create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoPage.xaml.h create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoWindow.idl create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoWindow.xaml create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoWindow.xaml.cpp create mode 100644 vav2/Vav2Player/Vav2Player/LayeredVideoWindow.xaml.h create mode 100644 vav2/Vav2Player/Vav2Player/MainVideoPage.idl create mode 100644 vav2/Vav2Player/Vav2Player/MainVideoPage.xaml create mode 100644 vav2/Vav2Player/Vav2Player/MainVideoPage.xaml.cpp create mode 100644 vav2/Vav2Player/Vav2Player/MainVideoPage.xaml.h create mode 100644 vav2/Vav2Player/Vav2Player/MainWindow_old.xaml.cpp create mode 100644 vav2/Vav2Player/Vav2Player/MultiVideoTestPage.idl create mode 100644 vav2/Vav2Player/Vav2Player/MultiVideoTestPage.xaml create mode 100644 vav2/Vav2Player/Vav2Player/MultiVideoTestPage.xaml.cpp create mode 100644 vav2/Vav2Player/Vav2Player/MultiVideoTestPage.xaml.h create mode 100644 vav2/Vav2Player/Vav2Player/Vav2PlayerHeadless.vcxproj.user create mode 100644 vav2/Vav2Player/Vav2Player/Vav2UnitTest.vcxproj.user create mode 100644 vav2/Vav2Player/Vav2Player/headless/DebugVavCoreTest.cpp create mode 100644 vav2/Vav2Player/Vav2Player/headless/SimpleVavCoreTest.cpp create mode 100644 vav2/Vav2Player/Vav2Player/headless/VavCoreHeadlessMain.cpp create mode 100644 vav2/Vav2Player/Vav2Player/src/Common/VavCoreVideoTypes.h create mode 100644 vav2/Vav2Player/Vav2Player/test_vavcore_simple.cpp create mode 100644 vav2/Vav2Player/Vav2Player/unit-test/VavCoreTest.cpp create mode 100644 vav2/Vav2Player/VavCore/VavCore.vcxproj create mode 100644 vav2/Vav2Player/VavCore/VavCore.vcxproj.user create mode 100644 vav2/Vav2Player/VavCore/src/Common/D3D12Helpers.h create mode 100644 vav2/Vav2Player/VavCore/src/Common/IAdaptiveVideoDecoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Common/VideoTypes.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AV1Decoder.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AV1Decoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AdaptiveAV1Decoder.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AdaptiveAV1Decoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AdaptiveDecodingExample.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AdaptiveNVDECDecoder.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/AdaptiveNVDECDecoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/IVideoDecoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/MediaFoundationAV1Decoder.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/MediaFoundationAV1Decoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/NVDECAV1Decoder.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/NVDECAV1Decoder.h create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/VideoDecoderFactory.cpp create mode 100644 vav2/Vav2Player/VavCore/src/Decoder/VideoDecoderFactory.h create mode 100644 vav2/Vav2Player/VavCore/src/FileIO/IWebMFileReader.h create mode 100644 vav2/Vav2Player/VavCore/src/FileIO/WebMFileReader.cpp create mode 100644 vav2/Vav2Player/VavCore/src/FileIO/WebMFileReader.h create mode 100644 vav2/Vav2Player/VavCore/src/VavCore.cpp create mode 100644 vav2/Vav2Player/VavCore/src/pch.cpp create mode 100644 vav2/Vav2Player/VavCore/src/pch.h create mode 100644 vav2/VavCore_Library_Design.md create mode 100644 vav2/todo7.txt diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 6a13d8f..0a4d4ae 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -19,30 +19,17 @@ "Bash(start Vav1Player.exe)", "Bash(dotnet run:*)", "Bash(cmake:*)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" \"Vav2Player.vcxproj\" \"/p:Configuration=Release\" \"/p:Platform=x64\")", "Bash(msbuild:*)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64 /v:minimal)", "Read(//c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/**)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" /noautoresponse Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64)", - "Bash(\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" Vav2Player.vcxproj \"/p:Configuration=Debug\" \"/p:Platform=x64\")", "Bash(cmd /c:*)", - "Bash(\"C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj \"/p:Configuration=Debug\" \"/p:Platform=x64\")", - "Bash(\"C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64)", "Bash(dir:*)", "Bash(set MSBUILD_EXE=\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\")", "Bash(%MSBUILD_EXE% \"Vav2Player.sln\" /p:Configuration=Debug /p:Platform=x64 /m)", - "Bash(/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe Vav2Player.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal)", - "Bash(python:*)", "Bash(start:*)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64 /v:minimal)", "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2PlayerHeadless.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal)", "Bash(\"./Vav2PlayerHeadless.exe\")", "Bash(\"./x64/Debug/Headless/Vav2PlayerHeadless.exe\" \"D:\\Project\\video-av1\\sample\\output.webm\")", "Bash(\".\\Vav2PlayerHeadless.exe\" \"D:\\Project\\video-av1\\sample\\simple_test.webm\")", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj \"/p:Configuration=Debug\" \"/p:Platform=x64\" \"/v:minimal\")", - "Bash(\"C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal)", "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"/d/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2Player.vcxproj\" //p:Configuration=Debug //p:Platform=x64 //v:minimal)", "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"/d/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2PlayerHeadless.vcxproj\" //p:Configuration=Debug //p:Platform=x64 //v:minimal)", "Bash(\"./Vav2PlayerHeadless.exe\" \"D:/Project/video-av1/sample/simple_test.webm\")", @@ -52,24 +39,10 @@ "Bash(%MSBUILD_EXE% \"Vav2Player.vcxproj\" /p:Configuration=Debug /p:Platform=x64 /m)", "Bash(.Vav2PlayerHeadless.exe \"D:\\Project\\video-av1\\sample\\simple_test.webm\")", "Bash(.Vav2PlayerHeadless.exe \"D:/Project/video-av1/sample/simple_test.webm\")", - "Bash(\"D:\\Project\\video-av1\\vav2\\Vav2Player\\Vav2Player\\x64\\Debug\\Headless\\Vav2PlayerHeadless.exe\" \"D:/Project/video-av1/sample/simple_test.webm\")", "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2Player.vcxproj\" \"/p:Configuration=Debug\" \"/p:Platform=x64\" \"/v:minimal\")", "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2Player.vcxproj\" \"//p:Configuration=Debug\" \"//p:Platform=x64\" \"//v:minimal\")", - "Bash(\"C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" /noautoresponse Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64)", "Bash(timeout:*)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" /noautoresponse Vav2PlayerHeadless.vcxproj \"/p:Configuration=Debug\" \"/p:Platform=x64\" \"/v:minimal\")", - "Bash(/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2PlayerHeadless.vcxproj\" //p:Configuration=Debug //p:Platform=x64 //v:minimal)", - "Bash(\"D:\\Project\\video-av1\\vav2\\Vav2Player\\Vav2Player\\x64\\Debug\\Headless\\Vav2PlayerHeadless.exe\" \"D:\\Project\\video-av1\\sample\\simple_test.webm\")", - "Bash(/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2Player.vcxproj\" //p:Configuration=Debug //p:Platform=x64 //v:minimal)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2PlayerHeadless.vcxproj\" \"/p:Configuration=Debug\" \"/p:Platform=x64\" \"/v:minimal\")", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" \"D:/Project/video-av1/vav2/Vav2Player/Vav2Player/Vav2PlayerHeadless.vcxproj\" \"//p:Configuration=Debug\" \"//p:Platform=x64\" \"//v:minimal\")", - "Bash(/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe Vav2PlayerHeadless.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj \"//p:Configuration=Debug\" \"//p:Platform=x64\" \"//v:minimal\")", - "Bash(python3:*)", "Bash(find:*)", - "Bash(\"/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2PlayerHeadless.vcxproj \"/p:Configuration=Debug\" \"/p:Platform=x64\" \"/v:minimal\")", - "Bash(cmd:*)", - "Bash(\"C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe\" Vav2Player.vcxproj /p:Configuration=Debug /p:Platform=x64 /v:minimal)", ], "deny": [], "ask": [] diff --git a/.gitignore b/.gitignore index c980487..5bf3187 100644 --- a/.gitignore +++ b/.gitignore @@ -355,4 +355,5 @@ lib/ include/ oss/ output.mp4 -prompt.txt \ No newline at end of file +prompt.txt +.user diff --git a/build_dav1d.bat b/build_dav1d.bat index ba65774..551c5eb 100644 --- a/build_dav1d.bat +++ b/build_dav1d.bat @@ -1,12 +1,12 @@ @echo off -echo Building dav1d static library (Release + Debug) for win64... +echo Building dav1d dynamic library (Release + Debug) for win64... REM Clean previous build echo Cleaning previous build... if exist lib\dav1d rmdir /S /Q lib\dav1d if exist include\dav1d rmdir /S /Q include\dav1d -if exist oss\dav1d\build_static_release rmdir /S /Q oss\dav1d\build_static_release -if exist oss\dav1d\build_static_debug rmdir /S /Q oss\dav1d\build_static_debug +if exist oss\dav1d\build_shared_release rmdir /S /Q oss\dav1d\build_shared_release +if exist oss\dav1d\build_shared_debug rmdir /S /Q oss\dav1d\build_shared_debug REM Create output directories echo Creating output directories... @@ -14,56 +14,56 @@ mkdir lib\dav1d 2>nul mkdir include\dav1d 2>nul REM ============================================================================= -REM Build Release version (STATIC) +REM Build Release version (SHARED) REM ============================================================================= echo. echo ======================================== -echo Building RELEASE static version of dav1d... +echo Building RELEASE shared version of dav1d... echo ======================================== REM Create build directory cd oss\dav1d -REM Configure with Meson (Release Static) -echo Configuring dav1d Release static build... -meson setup build_static_release --buildtype=release --default-library=static --prefix="D:/Project/video-av1/build_output/release" -Denable_tools=false -Denable_tests=false -Denable_examples=false +REM Configure with Meson (Release Shared) +echo Configuring dav1d Release shared build... +meson setup build_shared_release --buildtype=release --default-library=shared --prefix="D:/Project/video-av1/build_output/release" -Denable_tools=false -Denable_tests=false -Denable_examples=false if %ERRORLEVEL% neq 0 ( - echo Meson Release static configuration failed! + echo Meson Release shared configuration failed! cd ..\.. exit /b 1 ) REM Build the library (Release) -echo Building dav1d Release static... -meson compile -C build_static_release +echo Building dav1d Release shared... +meson compile -C build_shared_release if %ERRORLEVEL% neq 0 ( - echo Release static build failed! + echo Release shared build failed! cd ..\.. exit /b 1 ) REM ============================================================================= -REM Build Debug version (STATIC) +REM Build Debug version (SHARED) REM ============================================================================= echo. echo ======================================== -echo Building DEBUG static version of dav1d... +echo Building DEBUG shared version of dav1d... echo ======================================== -REM Configure with Meson (Debug Static) -echo Configuring dav1d Debug static build... -meson setup build_static_debug --buildtype=debug --default-library=static --prefix="D:/Project/video-av1/build_output/debug" -Denable_tools=false -Denable_tests=false -Denable_examples=false +REM Configure with Meson (Debug Shared) +echo Configuring dav1d Debug shared build... +meson setup build_shared_debug --buildtype=debug --default-library=shared --prefix="D:/Project/video-av1/build_output/debug" -Denable_tools=false -Denable_tests=false -Denable_examples=false if %ERRORLEVEL% neq 0 ( - echo Meson Debug static configuration failed! + echo Meson Debug shared configuration failed! cd ..\.. exit /b 1 ) REM Build the library (Debug) -echo Building dav1d Debug static... -meson compile -C build_static_debug +echo Building dav1d Debug shared... +meson compile -C build_shared_debug if %ERRORLEVEL% neq 0 ( - echo Debug static build failed! + echo Debug shared build failed! cd ..\.. exit /b 1 ) @@ -85,7 +85,7 @@ if %ERRORLEVEL% neq 0 ( REM Copy generated version header echo Copying generated version header... -copy "oss\dav1d\build_static_release\include\vcs_version.h" "include\dav1d\" +copy "oss\dav1d\build_shared_release\include\vcs_version.h" "include\dav1d\" if %ERRORLEVEL% neq 0 ( echo WARNING: Failed to copy vcs_version.h, but continuing... ) else ( @@ -93,37 +93,47 @@ if %ERRORLEVEL% neq 0 ( ) REM ============================================================================= -REM Install static library files +REM Install shared library files REM ============================================================================= echo. -echo Installing static library files... +echo Installing shared library files... -REM Copy Release static library -echo Copying Release static library... -copy "oss\dav1d\build_static_release\src\libdav1d.a" "lib\dav1d\dav1d.lib" +REM Copy Release shared library files +echo Copying Release shared library... +copy "oss\dav1d\build_shared_release\src\libdav1d.dll.a" "lib\dav1d\dav1d.lib" +copy "oss\dav1d\build_shared_release\src\libdav1d-*.dll" "lib\dav1d\" if %ERRORLEVEL% neq 0 ( - echo Failed to copy Release static library! + echo Failed to copy Release shared library! exit /b 1 ) -REM Copy Debug static library (with -debug postfix) -echo Copying Debug static library... -copy "oss\dav1d\build_static_debug\src\libdav1d.a" "lib\dav1d\dav1d-debug.lib" +REM Copy Debug shared library files (with -debug postfix) +echo Copying Debug shared library... +copy "oss\dav1d\build_shared_debug\src\libdav1d.dll.a" "lib\dav1d\dav1d-debug.lib" +copy "oss\dav1d\build_shared_debug\src\libdav1d-*.dll" "lib\dav1d\" +if exist "lib\dav1d\libdav1d-*.dll" ( + for %%f in ("lib\dav1d\libdav1d-*.dll") do ( + set filename=%%~nf + ren "%%f" "!filename!-debug.dll" + ) +) if %ERRORLEVEL% neq 0 ( - echo Failed to copy Debug static library! + echo Failed to copy Debug shared library! exit /b 1 ) echo. echo ======================================== -echo dav1d static build completed successfully! +echo dav1d shared build completed successfully! echo ======================================== -echo Release Static Library: -echo - lib\dav1d\dav1d.lib -echo Debug Static Library: -echo - lib\dav1d\dav1d-debug.lib +echo Release Shared Library: +echo - lib\dav1d\dav1d.lib (import library) +echo - lib\dav1d\libdav1d-*.dll (runtime library) +echo Debug Shared Library: +echo - lib\dav1d\dav1d-debug.lib (import library) +echo - lib\dav1d\libdav1d-*-debug.dll (runtime library) echo Headers: include\dav1d\ echo. -echo NOTE: Static libraries are now integrated into the final executable. -echo No DLL files are needed for runtime distribution. +echo NOTE: DLL files must be distributed with your application. +echo Place DLL files in the same directory as your executable. echo. \ No newline at end of file diff --git a/build_libwebm.bat b/build_libwebm.bat index 1eeb173..88c5204 100644 --- a/build_libwebm.bat +++ b/build_libwebm.bat @@ -1,5 +1,5 @@ @echo off -echo Building libwebm library (Release + Debug) for win64... +echo Building libwebm dynamic library (Release + Debug) for win64... REM Clean previous build echo Cleaning previous build... @@ -14,11 +14,11 @@ mkdir lib\libwebm 2>nul mkdir include\libwebm 2>nul REM ============================================================================= -REM Build Release version +REM Build Release version (SHARED) REM ============================================================================= echo. echo ======================================== -echo Building RELEASE version of libwebm... +echo Building RELEASE shared version of libwebm... echo ======================================== REM Create build directory @@ -26,20 +26,20 @@ cd oss\libwebm mkdir build_win64 2>nul cd build_win64 -REM Configure with CMake (Release) -echo Configuring libwebm Release build... -cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF -DCMAKE_INSTALL_PREFIX="D:/Project/video-av1" .. +REM Configure with CMake (Release Shared) +echo Configuring libwebm Release shared build... +cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF -DCMAKE_INSTALL_PREFIX="D:/Project/video-av1" .. if %ERRORLEVEL% neq 0 ( - echo CMake Release configuration failed! + echo CMake Release shared configuration failed! cd ..\..\.. exit /b 1 ) REM Build the library (Release) -echo Building libwebm Release... +echo Building libwebm Release shared... cmake --build . --config Release if %ERRORLEVEL% neq 0 ( - echo Release build failed! + echo Release shared build failed! cd ..\..\.. exit /b 1 ) @@ -48,36 +48,36 @@ REM Go back to libwebm source directory cd .. REM ============================================================================= -REM Build Debug version +REM Build Debug version (SHARED) REM ============================================================================= echo. echo ======================================== -echo Building DEBUG version of libwebm... +echo Building DEBUG shared version of libwebm... echo ======================================== REM Create debug build directory mkdir build_debug 2>nul cd build_debug -REM Configure with CMake (Debug) -echo Configuring libwebm Debug build... -cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF .. +REM Configure with CMake (Debug Shared) +echo Configuring libwebm Debug shared build... +cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF -DENABLE_SAMPLE_PROGRAMS=OFF .. if %ERRORLEVEL% neq 0 ( - echo CMake Debug configuration failed! + echo CMake Debug shared configuration failed! cd ..\..\.. exit /b 1 ) REM Build the library (Debug) -echo Building libwebm Debug... +echo Building libwebm Debug shared... cmake --build . --config Debug if %ERRORLEVEL% neq 0 ( - echo Debug build failed! + echo Debug shared build failed! cd ..\..\.. exit /b 1 ) -REM Rename debug library immediately after build +REM Rename debug library and DLL immediately after build echo Renaming debug library... if exist Debug\webm.lib ( ren Debug\webm.lib webm-debug.lib @@ -86,6 +86,13 @@ if exist Debug\webm.lib ( echo WARNING: webm.lib not found in debug build! ) +if exist Debug\webm.dll ( + ren Debug\webm.dll webm-debug.dll + echo Renamed webm.dll to webm-debug.dll +) else ( + echo WARNING: webm.dll not found in debug build! +) + REM Go back to root directory cd ..\..\. @@ -126,34 +133,41 @@ if %ERRORLEVEL% neq 0 ( ) REM ============================================================================= -REM Install library files +REM Install shared library files REM ============================================================================= echo. -echo Installing library files... +echo Installing shared library files... -REM Copy Release library -echo Copying Release library... +REM Copy Release shared library files +echo Copying Release shared library... copy "oss\libwebm\build_win64\Release\webm.lib" "lib\libwebm\" +copy "oss\libwebm\build_win64\Release\webm.dll" "lib\libwebm\" if %ERRORLEVEL% neq 0 ( - echo Failed to copy Release library! + echo Failed to copy Release shared library! exit /b 1 ) -REM Copy Debug library (already renamed) -echo Copying Debug library... +REM Copy Debug shared library files (already renamed) +echo Copying Debug shared library... copy "oss\libwebm\build_debug\Debug\webm-debug.lib" "lib\libwebm\" +copy "oss\libwebm\build_debug\Debug\webm-debug.dll" "lib\libwebm\" if %ERRORLEVEL% neq 0 ( - echo Failed to copy Debug library! + echo Failed to copy Debug shared library! exit /b 1 ) echo. echo ======================================== -echo libwebm build completed successfully! +echo libwebm shared build completed successfully! echo ======================================== -echo Release Library: -echo - lib\libwebm\webm.lib -echo Debug Library: -echo - lib\libwebm\webm-debug.lib +echo Release Shared Library: +echo - lib\libwebm\webm.lib (import library) +echo - lib\libwebm\webm.dll (runtime library) +echo Debug Shared Library: +echo - lib\libwebm\webm-debug.lib (import library) +echo - lib\libwebm\webm-debug.dll (runtime library) echo Headers: include\libwebm\ +echo. +echo NOTE: DLL files must be distributed with your application. +echo Place DLL files in the same directory as your executable. echo. \ No newline at end of file diff --git a/prompt.txt b/prompt.txt new file mode 100644 index 0000000..9ed6746 --- /dev/null +++ b/prompt.txt @@ -0,0 +1,17 @@ +av1 영상을 재생하는 app 을 개발하고자 한다. +기본적으로 영상을 디코딩하여 D3D12 의 텍스처에 영상을 그리도록 처리를 하고자 한다. + +개발 언어는 C# 을 이용하여, Windows App 으로 개발하기를 원한다. +개발할 app 이름은 vav1 이고, vav1 디렉토리안에 개발한다. + +다음의 2가지 SDK 또는 소스를 이용하여 디코딩 처리하고자 한다. +1. dav1d 소스를 이용하여 구현한다. +2. NVIDIA Video Codec SDK 을 이용한다. +3. Media Foundation 이용하여 구현한다. +4. DirectX Video Acceleration 이용한여 구현한다. + +우선 1번을 이용하여 구현한다. + +1번의 라이브러리 소스는 dav1d 디렉토리에 있다. +2번의 SDK 바이너리는 nvidia-video-codec 디렉토리에 있다. +3번과 4번은 추후에 지원할 예정이다. diff --git a/vav2/CLAUDE.md b/vav2/CLAUDE.md index 52b1e44..db93674 100644 --- a/vav2/CLAUDE.md +++ b/vav2/CLAUDE.md @@ -1,25 +1,78 @@ # Vav2Player - AV1 Video Player 개발 프로젝트 -## 🔥 **URGENT: 적응형 품질 제어 시스템 구현** +## ⚠️ **CRITICAL: 코딩 규칙 및 가이드라인** -**⚠️ 최우선 작업**: [ADAPTIVE_QUALITY_CONTROL_DESIGN.md](./ADAPTIVE_QUALITY_CONTROL_DESIGN.md) **반드시 읽고 진행** +### 📝 **주석 언어 규칙 (REQUIRED)** +**🚨 중요**: 모든 소스 코드 파일의 주석은 **영어로 작성**해야 합니다. -**현재 상황**: 프레임 스킵 대신 동적 해상도/품질 조정 시스템 구현 -- **목표**: 끊김 없는 부드러운 비디오 재생 실현 -- **방식**: NVDEC 기반 실시간 해상도 조정 + 성능 모니터링 -- **이유**: 프레임 드롭의 시각적 불연속성 문제 근본 해결 +#### 적용 범위 +- `.h` 헤더 파일의 모든 주석 +- `.cpp` 소스 파일의 모든 주석 +- `.xaml.h` WinUI 헤더 파일의 모든 주석 +- `.xaml.cpp` WinUI 소스 파일의 모든 주석 + +#### 예시 +```cpp +// ❌ 잘못된 예 (한국어 주석) +// 버퍼 크기 확인 및 재할당 최소화 +size_t required_size = frame.width * frame.height * 4; + +// ✅ 올바른 예 (영어 주석) +// Check buffer size and minimize reallocation +size_t required_size = frame.width * frame.height * 4; +``` + +#### 이유 +1. **국제화 지원**: 영어 주석으로 코드의 국제적 접근성 향상 +2. **컴파일러 호환성**: 일부 컴파일러에서 비ASCII 문자로 인한 인코딩 문제 방지 +3. **협업 효율성**: 다양한 배경의 개발자들과의 협업 용이성 +4. **유지보수성**: 장기적인 코드 유지보수 시 언어 장벽 제거 + +#### ⚠️ 필수 조치사항 +- **기존 한국어 주석 발견 시 즉시 영어로 변환** +- 새로운 코드 작성 시 처음부터 영어 주석 사용 +- 함수명, 변수명은 기존 명명 규칙 유지 (영어만 가능) + +### 🚫 **이모지 사용 금지 규칙 (REQUIRED)** +**🚨 중요**: 모든 소스 코드, 주석, 문자열에서 **이모지 사용을 금지**합니다. + +#### 적용 범위 +- 모든 소스 코드 파일의 주석 (`.h`, `.cpp`, `.xaml.h`, `.xaml.cpp`) +- 코드 내 문자열 리터럴 (예: `"Success!"`, `L"Video Player"`) +- XAML 파일의 주석 및 텍스트 속성 +- 로그 메시지 및 디버그 출력 + +#### 권장 대체 방안 +```cpp +// ✅ 권장 대체 방안 +// [PERFORMANCE] GPU acceleration enabled +// [SUCCESS] Frame decode completed +// [WARNING] Fallback to CPU rendering +// [ERROR] Failed to initialize D3D12 device +``` + +--- + +## 🔥 **URGENT: VavCore Static Library 구현** + +**⚠️ 최우선 작업**: [VavCore_Library_Design.md](VavCore_Library_Design.md) **반드시 읽고 진행** + +**현재 상황**: AV1 디코딩 및 렌더링 모듈을 재사용 가능한 Static Library로 분리 +- **목표**: VavCore.lib 형태의 독립적인 AV1 디코딩 라이브러리 제작 +- **방식**: 기존 Vav2Player 핵심 컴포넌트 추출 및 Public API 설계 +- **이유**: 코드 재사용성, 모듈화, 다른 프로젝트 통합 용이성 ### 📋 **최우선 작업 순서 (2025-09-24 업데이트)** -#### **🚀 새로운 최우선 작업: 적응형 품질 제어** -**목표**: 프레임 스킵 없는 부드러운 재생 구현 -**예상 소요**: 3-5일 +#### **🚀 새로운 최우선 작업: VavCore Static Library** +**목표**: 재사용 가능한 AV1 디코딩 라이브러리 구현 +**예상 소요**: 2-3주 **작업 내용**: -1. [ADAPTIVE_QUALITY_CONTROL_DESIGN.md](./ADAPTIVE_QUALITY_CONTROL_DESIGN.md) 설계 문서 기반 구현 -2. AdaptiveNVDECDecoder 클래스 통합 및 테스트 -3. 5단계 품질 레벨 시스템 (ULTRA → MINIMUM) 구현 -4. 실시간 성능 모니터링 및 자동 품질 조정 로직 -5. VideoPlayerControl과 통합하여 end-to-end 테스트 +1. [VavCore_Library_Design.md](VavCore_Library_Design.md) 설계 문서 기반 구현 +2. 기존 컴포넌트를 Static Library로 분리 (Decoder, FileIO, Common) +3. Public API 설계 및 구현 (Simple + Advanced API) +4. CMake 빌드 시스템 구축 +5. 예제 프로그램 및 문서화 완료 ### 📋 **완료된 설계 및 구현 (참조용)** @@ -51,54 +104,76 @@ - [x] VideoDecoderFactory에서 NVDEC → dav1d → MediaFoundation 우선순위 설정 - [x] 하드웨어 가용성 자동 감지 및 graceful fallback 구현 +#### **✅ 적응형 품질 제어 시스템 완료** +- [x] AdaptiveNVDECDecoder 구현 (NVDEC 기반 동적 해상도 조정) +- [x] AdaptiveAV1Decoder 구현 (dav1d 기반 포스트 디코딩 스케일링) +- [x] 5단계 품질 레벨 시스템 (ULTRA, HIGH, MEDIUM, LOW, MINIMUM) +- [x] 실시간 성능 모니터링 (30프레임 이동평균, 히스테리시스 제어) +- [x] 3단계 품질 모드 (CONSERVATIVE, FAST, ULTRA_FAST) 구현 및 최적화 +- [x] 프레임 스킵 제거를 통한 부드러운 비디오 재생 실현 +- [x] 4K AV1 디코딩 성능 최적화 (27.7fps 달성) + --- -## 🎯 **현재 프로젝트 상태 요약 (2025-09-24 업데이트)** +## 🎯 **현재 프로젝트 상태 요약 (2025-09-25 업데이트)** ### ✅ **구현 완료된 주요 컴포넌트** 1. **Core Video Infrastructure**: WebMFileReader, AV1Decoder, VideoDecoderFactory ✅ 2. **Hardware Acceleration**: NVDECAV1Decoder, CUDA 13.0 통합, NVDEC 우선 디코더 설정 ✅ -3. **GPU Rendering System**: SimpleGPURenderer, D3D12VideoRenderer 구현 ✅ -4. **UI Integration**: VideoPlayerControl 단순화 및 WinUI3 통합 ✅ -5. **Build System**: 모든 프로젝트 빌드 성공 (GUI/Headless/UnitTest) ✅ -6. **Test Infrastructure**: 47개 Unit Test, Mock 시스템, NVDEC 헤드리스 테스트 구축 ✅ -7. **Code Quality**: 한글 주석 → 영어 변환, 코딩 가이드라인 준수 ✅ +3. **Adaptive Quality Control**: AdaptiveAV1Decoder, AdaptiveNVDECDecoder 완전 구현 ✅ +4. **Quality Mode System**: CONSERVATIVE, FAST, ULTRA_FAST 모드 구현 및 최적화 ✅ +5. **GPU Rendering System**: SimpleGPURenderer, D3D12VideoRenderer 구현 ✅ +6. **UI Integration**: VideoPlayerControl 단순화 및 WinUI3 통합 ✅ +7. **Build System**: 모든 프로젝트 빌드 성공 (GUI/Headless/UnitTest) ✅ +8. **Test Infrastructure**: 47개 Unit Test, Mock 시스템, NVDEC 헤드리스 테스트 구축 ✅ +9. **Code Quality**: 한글 주석 → 영어 변환, 코딩 가이드라인 준수, VavCore 네임스페이스 통일 ✅ +10. **Performance Optimization**: 4K AV1 디코딩 27.7fps 달성 (ULTRA_FAST 모드) ✅ -### 🚀 **다음 단계: 적응형 품질 제어 시스템** +### ✅ **VavCore Static Library 구현 완료** -#### **새로운 목표: 프레임 스킵 제거** -- **현재 문제**: 성능 부족 시 프레임 스킵으로 인한 끊김 현상 -- **새로운 접근**: 동적 해상도/품질 조정으로 부드러운 재생 유지 -- **기술 기반**: NVDEC `cuvidReconfigureDecoder()` API 활용 +#### **✅ 달성된 목표: 재사용 가능한 라이브러리 제작** +- **✅ 완료**: 기존 AV1 디코딩 시스템을 독립 라이브러리로 분리 +- **✅ 완료**: Public API 설계를 통한 모듈화 및 재사용성 극대화 +- **📋 다음**: CMake 빌드 시스템과 Static Library 구조 최적화 -#### **핵심 개선 효과** -- **시각적 연속성**: 끊김 없는 부드러운 재생 (+400%) -- **오디오 동기화**: 완벽한 A/V 싱크 유지 (+100%) -- **사용자 경험**: 매끄러운 재생 경험 (+500%) -- **시스템 적응**: 하드웨어 성능에 자동 최적화 +#### **✅ 달성된 핵심 개선 효과** +- **✅ 코드 재사용**: VavCore 라이브러리로 독립 모듈화 완료 +- **✅ 모듈 독립성**: 디코딩 로직과 UI 로직 완전 분리 달성 +- **✅ 아키텍처 통합**: 중복 구현 제거 및 단일 소스 관리 +- **✅ 확장성**: IAdaptiveVideoDecoder 인터페이스로 새로운 코덱 지원 준비 -## 🎮 **적응형 품질 제어 구현 계획** +## 🎮 **VavCore Static Library 구현 계획** -### **Phase 1: 핵심 시스템 구현** (3-5일) -1. **AdaptiveNVDECDecoder 통합** - - 기존 NVDECAV1Decoder 확장 - - IAdaptiveDecoder 인터페이스 구현 - - 5단계 품질 레벨 시스템 (ULTRA → MINIMUM) +### **✅ Phase 1: Core Library 구조 완료** (2025-09-25) +1. **✅ 라이브러리 프로젝트 생성** + - ✅ VavCore.vcxproj 프로젝트 파일 생성 + - ✅ Static Library 타입으로 설정 + - ✅ 기존 컴포넌트 의존성 정리 -2. **성능 모니터링 시스템** - - 실시간 디코딩/렌더링 시간 측정 - - 30프레임 이동평균 기반 안정성 제어 - - 히스테리시스 적용으로 oscillation 방지 +2. **✅ Public API 설계 및 구현** + - ✅ VavCore.h 메인 헤더 파일 (C API) + - ✅ Simple API 완전 구현 (vavcore_* 함수들) + - ✅ Advanced API 준비 (IAdaptiveVideoDecoder 인터페이스) -3. **VideoPlayerControl 통합** - - 적응형 디코더 사용으로 전환 - - 품질 변경 로그 및 UI 피드백 - - end-to-end 테스트 및 검증 +3. **✅ 컴포넌트 분리 및 통합** + - ✅ Decoder 모듈 (AdaptiveAV1Decoder, AdaptiveNVDECDecoder, MediaFoundationAV1Decoder) + - ✅ FileIO 모듈 (WebMFileReader) + - ✅ Common 모듈 (VideoTypes, FramePool, IAdaptiveVideoDecoder) -### **Phase 2: 다른 디코더 확장** (2-3일) -1. **dav1d 적응형 구현**: 포스트 디코딩 스케일링 방식 -2. **MediaFoundation 적응형 구현**: MFT 출력 타입 재설정 방식 -3. **범용 적응형 팩토리**: 디코더별 최적 전략 자동 선택 +4. **✅ VavCore 아키텍처 통합 완료** + - ✅ 중복 구현 제거 (vav2/VavCore → vav2/Vav2Player/VavCore) + - ✅ Pimpl 패턴 적용으로 C/C++ ABI 호환성 확보 + - ✅ 600줄 완전 구현으로 모든 VavCore C API 함수 제공 + - ✅ VavCore_Library_Design.md 설계 문서 준수 + - ✅ VavCore 네임스페이스 일관성 수정 완료 (2025-09-25) + - ✅ 모든 한글 주석 영어 변환 완료 (2025-09-25) + - ✅ Release 모드 빌드 성공 및 헤드리스 테스트 완료 (2025-09-25) + +### **📋 Phase 2: 빌드 시스템 및 문서화 (다음 단계)** +1. **CMake 빌드 시스템**: 크로스플랫폼 빌드 지원 +2. **예제 프로그램**: 라이브러리 사용법 데모 +3. **API 문서**: 상세한 사용 가이드 및 레퍼런스 +4. **Godot 통합 준비**: C# 래퍼 및 Git 서브모듈 설정 #### ✅ 완료된 사전 작업 - SwapChainPanel XAML 설정 완료 @@ -168,6 +243,49 @@ WinUI 3 C++로 작성된 AV1 파일 재생 플레이어 - 현재 단계: 파일 출력 기반 스트리밍 파이프라인 구현 (렌더링은 추후) - 목표 성능: 30fps 끊김없는 실시간 재생 +## 📁 프로젝트 파일 경로 (Project File Locations) + +### **메인 프로젝트 파일들** +- **GUI 프로젝트**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\Vav2Player.vcxproj` +- **헤드리스 테스트**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\Vav2PlayerHeadless.vcxproj` +- **유닛 테스트**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\Vav2UnitTest.vcxproj` +- **VavCore 라이브러리**: `D:\Project\video-av1\vav2\Vav2Player\VavCore\VavCore.vcxproj` +- **솔루션 파일**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player.sln` + +### **빌드 명령어 템플릿** +```bash +# GUI 프로젝트 빌드 +cd "D:\Project\video-av1\vav2\Vav2Player\Vav2Player" +"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" Vav2Player.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal + +# VavCore 라이브러리 빌드 +cd "D:\Project\video-av1\vav2\Vav2Player\VavCore" +"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" VavCore.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal + +# 헤드리스 테스트 빌드 +cd "D:\Project\video-av1\vav2\Vav2Player\Vav2Player" +"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" Vav2PlayerHeadless.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal + +# 유닛 테스트 빌드 +cd "D:\Project\video-av1\vav2\Vav2Player\Vav2Player" +"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" Vav2UnitTest.vcxproj //p:Configuration=Debug //p:Platform=x64 //v:minimal + +# 전체 솔루션 빌드 +cd "D:\Project\video-av1\vav2\Vav2Player" +"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" Vav2Player.sln //p:Configuration=Debug //p:Platform=x64 //v:minimal +``` + +### **실행 파일 경로** +- **GUI 실행파일**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\x64\Debug\Vav2Player\Vav2Player.exe` +- **헤드리스 실행파일**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\x64\Debug\Headless\Vav2PlayerHeadless.exe` +- **VavCore 라이브러리**: `D:\Project\video-av1\vav2\Vav2Player\VavCore\x64\Debug\VavCore\VavCore.lib` + +### **주요 디렉토리** +- **소스 코드**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\src\` +- **헤드리스 소스**: `D:\Project\video-av1\vav2\Vav2Player\Vav2Player\headless\` +- **VavCore 소스**: `D:\Project\video-av1\vav2\Vav2Player\VavCore\src\` +- **VavCore 헤더**: `D:\Project\video-av1\vav2\Vav2Player\VavCore\include\VavCore\` + ## 프로젝트 구조 ``` D:\Project\video-av1\ @@ -279,191 +397,6 @@ D:\Project\video-av1\ - 언어 표준: C++17 이상 - 런타임: Windows App SDK 1.8 -## 코딩 규칙 및 가이드라인 - -### 주석 언어 규칙 -**중요**: 모든 소스 코드 파일의 주석은 **영어로 작성**해야 합니다. - -#### 적용 범위 -- `.h` 헤더 파일의 모든 주석 -- `.cpp` 소스 파일의 모든 주석 -- `.xaml.h` WinUI 헤더 파일의 모든 주석 -- `.xaml.cpp` WinUI 소스 파일의 모든 주석 - -#### 예시 -```cpp -// ❌ 잘못된 예 (한국어 주석) -// 버퍼 크기 확인 및 재할당 최소화 -size_t required_size = frame.width * frame.height * 4; - -// ✅ 올바른 예 (영어 주석) -// Check buffer size and minimize reallocation -size_t required_size = frame.width * frame.height * 4; -``` - -#### 이유 -1. **국제화 지원**: 영어 주석으로 코드의 국제적 접근성 향상 -2. **컴파일러 호환성**: 일부 컴파일러에서 비ASCII 문자로 인한 인코딩 문제 방지 -3. **협업 효율성**: 다양한 배경의 개발자들과의 협업 용이성 -4. **유지보수성**: 장기적인 코드 유지보수 시 언어 장벽 제거 - -#### 주의사항 -- 기존 한국어 주석 발견 시 즉시 영어로 변환 -- 새로운 코드 작성 시 처음부터 영어 주석 사용 -- 함수명, 변수명은 기존 명명 규칙 유지 (영어 또는 한국어 혼용 가능) - -### 이모지 사용 금지 규칙 -**중요**: 모든 소스 코드, 주석, 문자열에서 **이모지 사용을 금지**합니다. - -#### 적용 범위 -- 모든 소스 코드 파일의 주석 (`.h`, `.cpp`, `.xaml.h`, `.xaml.cpp`) -- 코드 내 문자열 리터럴 (예: `"Success!"`, `L"Video Player"`) -- XAML 파일의 주석 및 텍스트 속성 -- 로그 메시지 및 디버그 출력 -- 변수명, 함수명, 클래스명 -- 파일명 및 디렉터리명 - -#### 금지 예시 -```cpp -// ❌ 잘못된 예 (이모지 사용) -// 🚀 Initialize video decoder with GPU acceleration -std::cout << "[AV1Decoder] Decode successful! 🎉" << std::endl; -std::string status = "Ready ✅"; - -// ✅ 올바른 예 (이모지 없음) -// Initialize video decoder with GPU acceleration -std::cout << "[AV1Decoder] Decode successful!" << std::endl; -std::string status = "Ready"; -``` - -```xml - - - - - - - -``` - -#### 이유 -1. **컴파일러 호환성**: 일부 컴파일러에서 Unicode 이모지로 인한 인코딩 문제 방지 -2. **텍스트 처리 안정성**: 로그 파싱, 텍스트 검색 시 문제 방지 -3. **프로페셔널 코드**: 산업 표준 코딩 스타일 준수 -4. **크로스플랫폼 호환성**: 다양한 개발 환경에서 안정적 동작 보장 -5. **가독성**: 코드 리뷰 및 디버깅 시 집중력 향상 - -#### 대체 방안 -- 이모지 대신 명확한 텍스트 설명 사용 -- 로그 레벨로 중요도 표현 (INFO, WARNING, ERROR) -- 주석에서 구조화된 마크다운 문법 활용 - -```cpp -// ✅ 권장 대체 방안 -// [PERFORMANCE] GPU acceleration enabled -// [SUCCESS] Frame decode completed -// [WARNING] Fallback to CPU rendering -// [ERROR] Failed to initialize D3D12 device -``` - -### XAML 파일 작성 규칙 -**중요**: WinUI XAML 파일에서도 모든 주석과 문자열은 **영어로 작성**해야 합니다. - -#### 적용 범위 -- `.xaml` 파일의 모든 XML 주석 (``) -- XAML 속성값의 텍스트 문자열 (예: `Text="..."`, `Content="..."`) -- 사용자에게 표시되지 않는 내부 문자열도 영어 권장 - -#### 예시 -```xml - - - - - - - -``` - -#### XAML 파싱 주의사항 -- **대량 주석 블록 금지**: 긴 주석 처리된 XAML 코드는 파싱 오류를 일으킬 수 있음 -- **사용하지 않는 컨트롤**: 주석 처리보다는 완전 제거 권장 -- **이벤트 핸들러**: XAML에서 제거된 컨트롤의 이벤트 핸들러는 .h/.cpp에서도 제거 - -#### XAML 주석 작성 가이드라인 -**목적**: 코드 가독성과 유지보수성을 위한 XAML 주석 작성 규칙 - -**주석 작성 원칙**: -- 모든 주요 UI 섹션에 영어 주석으로 목적 설명 -- 복잡한 레이아웃이나 데이터 바인딩에는 상세 주석 추가 -- 조건부 표시/숨김 로직이 있는 컨트롤에는 설명 추가 - -**권장 주석 패턴**: -```xml - - - - - - - - - - - - -