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.
Description
Pull Request Title: Initiate decoders globally
Description:
Motivation:
The motivation behind this change is to streamline the initialization and management of decoders within the
Golibrtsp
structure. By initiating the H264 and H265 frame decoders globally, we aim to enhance the efficiency and maintainability of the code. This change also reduces redundancy and potential errors related to multiple initializations and closures of the same decoders.Changes:
Global Initialization of Decoders:
H264FrameDecoder
andH265FrameDecoder
.init
function to initialize these decoders at the start of the program.init
function, logging any issues encountered.Refactor
Connect
Method:Connect
method to use the globally initialized decoders instead of creating new instances each time a connection is made.Connect
method.Update
Close
Method:Close
method, as they are now managed globally and should not be closed individually.Benefits:
This change improves the overall stability and performance of the project by ensuring decoders are correctly managed and reducing the complexity of the
Golibrtsp
implementation.