-
Notifications
You must be signed in to change notification settings - Fork 77
Add: Ability to drop old frames #1328
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
DawidWesierski4
wants to merge
1
commit into
main
Choose a base branch
from
drop_old_frames
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
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
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 |
|---|---|---|
|
|
@@ -384,6 +384,12 @@ enum st22p_tx_flag { | |
| * lib will wait until timestamp is reached for each frame. | ||
| */ | ||
| ST22P_TX_FLAG_USER_PACING = (MTL_BIT32(3)), | ||
| /** | ||
| * Drop frames when the mtl reports late frames (transport can't keep up). | ||
| * When late frame is detected, next frame from pipeline is ommited. | ||
| * Untill we resume normal frame sending. | ||
| */ | ||
| ST22P_TX_FLAG_DROP_WHEN_LATE = (MTL_BIT32(12)), | ||
| /** | ||
| * If enabled, lib will assign the rtp timestamp to the value in | ||
| * tx_frame_meta(ST10_TIMESTAMP_FMT_MEDIA_CLK is used) | ||
|
|
@@ -413,6 +419,8 @@ enum st22p_tx_flag { | |
| /** Enable the st22p_tx_get_frame block behavior to wait until a frame becomes | ||
| available or timeout(default: 1s, use st22p_tx_set_block_timeout to customize) */ | ||
| ST22P_TX_FLAG_BLOCK_GET = (MTL_BIT32(15)), | ||
| /** If enabled, drop old frames when user pacing is used */ | ||
| ST22P_TX_FLAG_USER_TIMESTAMP_DROP_OLD = (MTL_BIT32(16)), | ||
|
Comment on lines
+422
to
+423
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. it this flag ever used? |
||
| }; | ||
|
|
||
| /** Bit define for flags of struct st20p_tx_ops. */ | ||
|
|
@@ -437,6 +445,12 @@ enum st20p_tx_flag { | |
| * aligned with virtual receiver read schedule. | ||
| */ | ||
| ST20P_TX_FLAG_USER_PACING = (MTL_BIT32(3)), | ||
| /** | ||
| * Drop frames when the mtl reports late frames (transport can't keep up). | ||
| * When late frame is detected, next frame from pipeline is ommited. | ||
| * Untill we resume normal frame sending. | ||
| */ | ||
| ST20P_TX_FLAG_DROP_WHEN_LATE = (MTL_BIT32(12)), | ||
| /** | ||
| * If enabled, lib will assign the rtp timestamp to the value of timestamp in | ||
| * st_frame.timestamp (if needed the value will be converted to | ||
|
|
@@ -875,12 +889,22 @@ struct st20p_tx_ops { | |
| */ | ||
| int (*notify_frame_available)(void* priv); | ||
| /** | ||
| * Optional. Callback when frame done in the lib. | ||
| * Optional. Callback when frame done in the lib. If TX_FLAG_DROP_WHEN_LATE is enabled | ||
| * this will be called only when the notify_frame_late is not triggered. | ||
| * And only non-block method can be used within this callback as it run from lcore | ||
| * tasklet routine. | ||
| */ | ||
| int (*notify_frame_done)(void* priv, struct st_frame* frame); | ||
|
|
||
| /** | ||
| * Optional. Callback when frame timing issues occur. | ||
| * If ST20P_TX_FLAG_DROP_WHEN_LATE is enabled: triggered when a frame is dropped | ||
| * from the pipeline due to late transmission. | ||
| * If ST20P_TX_FLAG_DROP_WHEN_LATE is disabled: triggered when the transport | ||
| * layer reports late frame delivery. | ||
| */ | ||
| int (*notify_frame_late)(void* priv, uint64_t epoch_skipped); | ||
|
|
||
| /** Optional. Linesize for transport frame, only for non-convert mode */ | ||
| size_t transport_linesize; | ||
|
|
||
|
|
@@ -1046,12 +1070,22 @@ struct st22p_tx_ops { | |
| */ | ||
| int (*notify_frame_available)(void* priv); | ||
| /** | ||
| * Optional. Callback when frame done in the lib. | ||
| * Optional. Callback when frame done in the lib. If TX_FLAG_DROP_WHEN_LATE is enabled | ||
| * this will be called only when the notify_frame_late is not triggered. | ||
| * And only non-block method can be used within this callback as it run from lcore | ||
| * tasklet routine. | ||
| */ | ||
| int (*notify_frame_done)(void* priv, struct st_frame* frame); | ||
|
|
||
| /** | ||
| * Optional. Callback when frame timing issues occur. | ||
| * If ST22P_TX_FLAG_DROP_WHEN_LATE is enabled: triggered when a frame is dropped | ||
| * from the pipeline due to late transmission. | ||
| * If ST22P_TX_FLAG_DROP_WHEN_LATE is disabled: triggered when the transport | ||
| * layer reports late frame delivery. | ||
| */ | ||
| int (*notify_frame_late)(void* priv, uint64_t epoch_skipped); | ||
|
|
||
| /** Optional for ST22P_TX_FLAG_ENABLE_RTCP. RTCP info */ | ||
| struct st_tx_rtcp_ops rtcp; | ||
| /** | ||
|
|
||
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
Oops, something went wrong.
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.
please be more precise.
something like:
If TX_FLAG_DROP_WHEN_LATE is enabled, in the event of late frame, the notify_frame_late callback will be called, if provided, instead of the notify_frame_done.