Skip to content
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

GH-303 Add support for status codes in packet reader #570

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

dshil
Copy link
Member

@dshil dshil commented Sep 28, 2023

@dshil dshil added the ready for review Pull request can be reviewed label Sep 28, 2023
@dshil dshil requested a review from gavv September 28, 2023 09:19
@dshil dshil force-pushed the dshil/gh-303 branch 3 times, most recently from cc4e462 to 352d6b7 Compare September 28, 2023 11:36
Copy link
Member

@gavv gavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR! First set of comments.

src/internal_modules/roc_audio/depacketizer.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_node/sender_encoder.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/ireader.h Outdated Show resolved Hide resolved
src/tests/roc_audio/test_packetizer.cpp Outdated Show resolved Hide resolved
@gavv gavv added review in progress Pull request is being reviewed and removed ready for review Pull request can be reviewed labels Sep 28, 2023
@github-actions
Copy link

☔ The latest upstream change (presumably these) made this pull request unmergeable. Please resolve the merge conflicts.

@github-actions github-actions bot added the needs rebase Pull request has conflicts and should be rebased label Sep 28, 2023
@gavv gavv removed the needs rebase Pull request has conflicts and should be rebased label Sep 29, 2023
src/internal_modules/roc_rtp/validator.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/sorted_queue.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/queue.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/ireader.h Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/delayed_reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/delayed_reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_packet/concurrent_queue.cpp Outdated Show resolved Hide resolved
@gavv gavv added needs revision Pull request should be revised by its author and removed review in progress Pull request is being reviewed labels Sep 29, 2023
@dshil dshil force-pushed the dshil/gh-303 branch 2 times, most recently from 3652317 to b7f8311 Compare October 2, 2023 11:43
@dshil dshil requested a review from gavv October 2, 2023 11:44
@dshil dshil added ready for review Pull request can be reviewed and removed needs revision Pull request should be revised by its author labels Oct 2, 2023
@dshil
Copy link
Member Author

dshil commented Oct 2, 2023

Hi @gavv, thanks for your comments. I've updated the PR. When you will be ready to accept these changes, please ping me and I'll link the task.

@dshil dshil marked this pull request as draft October 2, 2023 12:22
@dshil dshil force-pushed the dshil/gh-303 branch 2 times, most recently from e25d6e2 to 85182cb Compare October 2, 2023 12:55
@dshil dshil changed the title Add support for error codes in packet reader GH-303 Add support for error codes in packet reader Oct 2, 2023
@dshil dshil changed the title GH-303 Add support for error codes in packet reader Add support for error codes in packet reader Oct 2, 2023
@dshil dshil marked this pull request as ready for review October 2, 2023 12:57
@dshil dshil changed the title Add support for error codes in packet reader GH-303 Add support for error codes in packet reader Oct 3, 2023
@gavv
Copy link
Member

gavv commented Oct 3, 2023

Huge work.

This PR implements new behavior for which we need new tests.

We should add tests how some readers handle ErrNoData and other errors returned from underlying readers.

The following classes should be covered:

Group 1:

  • These classes forward any error as-is.

    • rtp::Populator
    • rtp::Validator
    • rtp::TimestampInjector

Group 2:

  • These classes have special handling for ErrNoData and forward other errors.

    • packet::DelayedReader
    • fec::Reader

Group 3:

  • This class does not forward any error (for now), but should correctly work with any error.

    • audio::Depacketizer

Could you please either add these tests (in this or separate PR), or create an issue describing what tests to add?

src/internal_modules/roc_audio/depacketizer.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_node/sender_encoder.cpp Outdated Show resolved Hide resolved
src/tests/public_api/test_helpers/proxy.h Show resolved Hide resolved
src/tests/roc_fec/test_helpers/packet_dispatcher.h Outdated Show resolved Hide resolved
src/tests/roc_fec/test_helpers/packet_dispatcher.h Outdated Show resolved Hide resolved
src/tests/roc_packet/test_concurrent_queue.cpp Outdated Show resolved Hide resolved
src/tests/roc_packet/test_concurrent_queue.cpp Outdated Show resolved Hide resolved
src/tests/roc_pipeline/test_helpers/packet_sender.h Outdated Show resolved Hide resolved
src/tests/roc_rtp/test_timestamp_injector.cpp Outdated Show resolved Hide resolved
src/tests/roc_pipeline/test_sender_sink.cpp Outdated Show resolved Hide resolved
@gavv gavv added review in progress Pull request is being reviewed and removed ready for review Pull request can be reviewed labels Oct 3, 2023
src/internal_modules/roc_audio/depacketizer.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_rtp/validator.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_rtp/validator.cpp Outdated Show resolved Hide resolved
Copy link
Member

@gavv gavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final set of comments.

src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
@gavv gavv added needs revision Pull request should be revised by its author and removed review in progress Pull request is being reviewed labels Oct 3, 2023
@dshil dshil force-pushed the dshil/gh-303 branch 3 times, most recently from ca07ba0 to e485f7d Compare October 5, 2023 14:17
@dshil dshil changed the title GH-303 Add support for error codes in packet reader GH-303 Add support for status codes in packet reader Oct 6, 2023
@dshil dshil added ready for review Pull request can be reviewed and removed needs revision Pull request should be revised by its author labels Oct 6, 2023
@dshil dshil requested a review from gavv October 6, 2023 12:03
Copy link
Member

@gavv gavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for update!

src/internal_modules/roc_status/status_code_to_str.h Outdated Show resolved Hide resolved
src/tests/roc_fec/test_writer_reader.cpp Outdated Show resolved Hide resolved
Comment on lines +3128 to +3131
const status::StatusCode codes[] = {
status::StatusUnknown,
};

for (size_t n_code = 0; n_code < ROC_ARRAY_SIZE(codes); ++n_code) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we need a loop over codes in these tests?

It seems that all codes except NoData are handled the same way, so it should be enough to test NoData + any single code. NoData is covered by other tests (because Queue returns it), and I guess these tests can check just one another code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same for 2 tests below)

src/tests/roc_fec/test_writer_reader.cpp Outdated Show resolved Hide resolved
src/tests/roc_rtp/test_helpers/status_reader.h Outdated Show resolved Hide resolved
src/tests/roc_packet/test_delayed_reader.cpp Outdated Show resolved Hide resolved
src/tests/roc_audio/test_depacketizer.cpp Outdated Show resolved Hide resolved
src/tests/roc_audio/test_depacketizer.cpp Outdated Show resolved Hide resolved
@gavv gavv added needs revision Pull request should be revised by its author and removed ready for review Pull request can be reviewed labels Oct 6, 2023
@dshil dshil added ready for review Pull request can be reviewed and removed needs revision Pull request should be revised by its author labels Oct 9, 2023
@gavv gavv merged commit 3360e18 into roc-streaming:develop Oct 9, 2023
31 checks passed
@gavv gavv removed the ready for review Pull request can be reviewed label Oct 9, 2023
@dshil dshil deleted the dshil/gh-303 branch October 9, 2023 12:08
@gavv gavv added this to the 0.3.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants