Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a crash in the AV1 encoder and improves error handling across video codec encoders. The changes focus on preventing null pointer crashes, enhancing debugging capabilities, and ensuring platform compatibility.
Key changes include:
- Added null pointer checks to VP9 and AV1 encoders to prevent crashes when I420 buffer is missing
- Enhanced Vulkan graphics device error logging for better debugging
- Added platform-specific guards for CUDA code to improve portability
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VulkanGraphicsDevice.cpp | Added error logging for texture access failures and sync timeouts, plus chrono header |
| GpuMemoryBuffer.cpp | Wrapped CUDA-specific code with platform guards |
| libvpx_vp9_encoder.patch | Added null check for I420 buffer to prevent crashes |
| libaom_av1_encoder.patch | Added null check for I420 buffer with proper error code return |
| build_libwebrtc_android.sh | Applied new encoder patches during build process |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }); | ||
| if (!ret) | ||
| { | ||
| RTC_LOG(LS_ERROR) << "WaitSync timeout. " |
There was a problem hiding this comment.
Missing space after 'timeout.' - should be 'timeout. ' to properly separate from the next line.
Plugin~/WebRTCPlugin/GraphicsDevice/Vulkan/VulkanGraphicsDevice.cpp
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and bug fixes related to video codec encoders and Vulkan graphics device handling. The main focus is on improving error handling in the VP9 and AV1 encoder code, enhancing Vulkan device logging, and ensuring platform-specific code is properly guarded.
Codec Encoder Robustness and Error Handling:
libvpx_vp9_encoder.ccandlibaom_av1_encoder.ccto prevent crashes if the I420 buffer is missing, returning failure codes or empty values as appropriate. [1] [2]build_libwebrtc_android.sh) to apply new patches for VP9 and AV1 encoders, ensuring these error checks are included during the build process.Vulkan Graphics Device Improvements:
VulkanGraphicsDevice.cppfor failed texture access and synchronization timeouts, making debugging easier when Vulkan resource operations fail. [1] [2]<chrono>header inVulkanGraphicsDevice.cppto support time-based operations.Platform-Specific Code Guarding:
GpuMemoryBuffer.cppwith#if CUDA_PLATFORMto ensure it only compiles on supported platforms, improving portability and preventing build errors.