-
Notifications
You must be signed in to change notification settings - Fork 36
Remove Baresip and libre, revert changes in H264Decoder and NvTransform specific to NVR and fix a memory leak in nvcodec decoder #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kushaljain-apra
wants to merge
14
commits into
main
Choose a base branch
from
ks/fixH264Decoder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
130ee2d
remove libre & baresip
kushaljain-apra 24df6a3
Merge branch 'main' into ks/removeLibreAndBaresip
kushaljain-apra 39c24b6
Update H264EncoderNVCodecHelper.cpp
kushaljain-apra e451b05
added fix to terminate the control module with the pipeline
kushaljain-apra 94c9c0f
fix typo
kushaljain-apra b9a5ea2
revert changes
kushaljain-apra 42550e3
update pipeline.cpp to stop and terminate control module with pipeline
kushaljain-apra 65dd52a
uncomment nvr related comments
kushaljain-apra debf2b9
remove pipeline modules in pipeline.cpp
kushaljain-apra 405891d
revert decoder changes
kushaljain-apra dbbf637
update h264 nvcodec decoder to destroy context
kushaljain-apra af79ad0
revert changes specific to NVR
kushaljain-apra 9e799af
Merge branch 'main' into ks/fixH264Decoder
kushaljain-apra 3ac8430
Add H264 Decoder Fixes Documentation
kushaljain-apra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -733,12 +733,10 @@ bool H264Decoder::shouldTriggerSOS() | |
|
|
||
| bool H264Decoder::processEOS(string& pinId) | ||
| { | ||
| //THIS HAS BEEN COMMENTED IN NVR - BECAUSE EOS IS SENT FROM MP4READER WHICH COMES TO DECODER AND THE FOLLOWING PROCESS IS NOT REQUIRED IN NVR. | ||
|
|
||
| // auto frame = frame_sp(new EmptyFrame()); | ||
| // mDetail->compute(frame->data(), frame->size(), frame->timestamp); | ||
| // LOG_ERROR << "processes sos " ; | ||
| //mShouldTriggerSOS = true; | ||
| auto frame = frame_sp(new EmptyFrame()); | ||
| mDetail->compute(frame->data(), frame->size(), frame->timestamp); | ||
| LOG_ERROR << "processes sos " ; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is thie log error. |
||
| mShouldTriggerSOS = true; | ||
| return true; | ||
| } | ||
|
|
||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,4 +111,6 @@ H264Utils::H264_NAL_TYPE H264Utils::getNalTypeAfterSpsPps(void* frameData, size_ | |
| } | ||
| } | ||
| } | ||
|
|
||
| return typeFound; | ||
| } | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # Changes from Main Branch | ||
|
|
||
| This document summarizes the actual changes made in the current branch compared to the main branch. | ||
|
|
||
| ## Modified Files | ||
|
|
||
| ### 1. base/CMakeLists.txt | ||
| - Removed dependencies: | ||
| ```cmake | ||
| # Removed libre and baresip libraries | ||
| - find_library(LIBRE_LIB NAMES libre.so libre.a REQUIRED) | ||
| - find_library(BARESIP_LIB NAMES libbaresip.so REQUIRED) | ||
| ``` | ||
| - Removed include directories: | ||
| ```cmake | ||
| target_include_directories ( aprapipes PRIVATE | ||
| # Removed baresip and libre includes | ||
| - ${BARESIP_INC_DIR} | ||
| - ${LIBRE_INC_DIR} | ||
| ) | ||
| ``` | ||
|
|
||
| ### 2. base/src/H264Decoder.cpp | ||
| - Uncommented EOS processing code: | ||
| ```cpp | ||
| bool H264Decoder::processEOS(string& pinId) | ||
| { | ||
| auto frame = frame_sp(new EmptyFrame()); | ||
| mDetail->compute(frame->data(), frame->size(), frame->timestamp); | ||
| LOG_ERROR << "processes sos " ; | ||
| mShouldTriggerSOS = true; | ||
| return true; | ||
| } | ||
| ``` | ||
|
|
||
| ### 3. base/src/H264DecoderNvCodecHelper.cpp | ||
| - Added CUDA context cleanup in destructor: | ||
| ```cpp | ||
| NvDecoder::~NvDecoder() { | ||
| // Added CUDA context cleanup | ||
| if(m_cuContext) | ||
| { | ||
| if (m_pMutex) m_pMutex->lock(); | ||
| cuCtxDestroy(m_cuContext); | ||
| if (m_pMutex) m_pMutex->unlock(); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### 4. base/src/H264EncoderNVCodecHelper.cpp | ||
| - Modified output bitstream handling: | ||
| ```cpp | ||
| // Changed condition for waiting on free output bitstreams | ||
| - else | ||
| + else if(!m_nvcodecResources->m_nFreeOutputBitstreams) | ||
| { | ||
| LOG_INFO << "waiting for free outputbitstream<> busy streams<" << m_nvcodecResources->m_nBusyOutputBitstreams << ">"; | ||
| } | ||
| ``` | ||
|
|
||
| ### 5. base/src/H264Utils.cpp | ||
| - Added return value for getNalTypeAfterSpsPps: | ||
| ```cpp | ||
| H264Utils::H264_NAL_TYPE H264Utils::getNalTypeAfterSpsPps(void* frameData, size_t frameSize) | ||
| { | ||
| // Added missing return statement | ||
| return typeFound; | ||
| } | ||
| ``` | ||
|
|
||
| ### 6. base/src/NvTransform.cpp | ||
| - Uncommented metadata reset in processEOS: | ||
| ```cpp | ||
| bool NvTransform::processEOS(string &pinId) | ||
| { | ||
| mDetail->outputMetadata.reset(); | ||
| return true; | ||
| } | ||
| ``` | ||
|
|
||
| ### 7. base/src/PipeLine.cpp | ||
| - Added control module thread handling: | ||
| ```cpp | ||
| void PipeLine::wait_for_all(bool ignoreStatus) | ||
| { | ||
| // Added control module thread join | ||
| if ((modules[0]->controlModule) != nullptr) | ||
| { | ||
| Module& m = *(modules[0]->controlModule); | ||
| m.myThread.join(); | ||
| } | ||
| } | ||
|
|
||
| void PipeLine::interrupt_wait_for_all() | ||
| { | ||
| // Added control module thread interrupt and join | ||
| if ((modules[0]->controlModule) != nullptr) | ||
| { | ||
| Module& m = *(modules[0]->controlModule); | ||
| m.myThread.interrupt(); | ||
| } | ||
| // ... existing code ... | ||
| if ((modules[0]->controlModule) != nullptr) | ||
| { | ||
| Module& m = *(modules[0]->controlModule); | ||
| m.myThread.join(); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### 8. base/vcpkg.json | ||
| - Removed platform-specific dependencies: | ||
| ```json | ||
| // Removed re and baresip dependencies | ||
| - { | ||
| - "name": "re", | ||
| - "platform": "!windows" | ||
| - }, | ||
| - { | ||
| - "name": "baresip", | ||
| - "platform": "!windows" | ||
| - } | ||
| ``` | ||
|
|
||
| ## Summary of Changes | ||
|
|
||
| 1. **Dependency Updates** | ||
| - Removed libre and baresip libraries and includes | ||
| - Removed platform-specific dependencies from vcpkg.json | ||
|
|
||
| 2. **Code Improvements** | ||
| - Added proper CUDA context cleanup in NVIDIA decoder | ||
| - Fixed missing return value in H264Utils | ||
| - Improved output bitstream handling in encoder | ||
| - Enhanced thread management for control module | ||
| - Uncommented and enabled EOS processing in decoder and transform | ||
|
|
||
| 3. **Application-Specific Changes** | ||
| - Removed Application-specific comments and restrictions | ||
| - Enabled EOS processing that was previously disabled for Application | ||
| - Enabled metadata reset in transform that was previously disabled for Application | ||
|
|
||
| These changes focus on cleaning up dependencies, improving resource management, and removing Application-specific restrictions while maintaining proper cleanup and error handling. |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep an option open to build with baresip if required