feat: pass audio frames to frame processor #7
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 enhances the
pytricklelibrary by adding support for processing audio frames alongside video frames and improving error handling in asynchronous loops. The key changes include extending type annotations, updating frame processing logic, and introducing new methods for handling audio frames with corrected timestamps.Audio frame support:
pytrickle/client.py:frame_processorandprocess_frameto handle bothVideoFrameandAudioFrametypes, as well as their corresponding outputs (VideoOutputandAudioOutput). [1] [2] [3]AudioFrameobjects in_ingress_loopand send processed audio frames to the egress loop.pytrickle/frames.py:AudioFrame._from_existing_with_timestampto create a newAudioFramewith a corrected timestamp.AudioOutput.with_monotonic_timestampsto generateAudioOutputwith monotonic timestamps for individual frames.Error handling improvements:
pytrickle/client.py:startmethod to ignoreasyncio.CancelledErrorexceptions while logging other errors in asynchronous loops.Code simplification:
pytrickle/protocol.py:AudioFrameindequeue_frame, ensuring all frames are sent to the frame processor for consistency.These changes improve the library's flexibility for handling both video and audio data while ensuring robust error handling and cleaner code.