Skip to content

Worker: New Consumer class handling all possible producer stream modes.#1731

Draft
jmillan wants to merge 28 commits into
v3from
new_consumer
Draft

Worker: New Consumer class handling all possible producer stream modes.#1731
jmillan wants to merge 28 commits into
v3from
new_consumer

Conversation

@jmillan
Copy link
Copy Markdown
Member

@jmillan jmillan commented Feb 16, 2026

New ProducerStreamManager interface with the following implementations:

  • SimpleProducerStreamManager: handles a single stream with no spatial or temporal layers.
  • SimulcastProducerStreamManager: handles N streams with 1 spatial and N temporal layers.
  • SvcProducerStreamManager: handles 1 stream with N spatial and M temporal layers.

This new class handles the different flavours of producers streams making Consumer agnostic. This allows:

  • Cleaner implementation: Producer streams details are hidden in the corresponding implementation.
  • Reduced code size: No more duplicated full consumer implementation.
  • Will allow to use the same Consumer and switch the ProducerStreamManager that sources it.

Consumer + SimpleProducerStreamManager replaces SimpleConsumer.
Consumer + SimulcastProducerStreamManager replaces SimulcastConsumer.
Consumer + SvcProducerStreamManager replaces SvcConsumer.

NOTE1: Old consumer has been named OldConsumer for the time being. Old consumers are deprecated and just left in the repo for comparison purposes while this PR is ongoing.

NOTE2: PipeConsumer has not been touched as we are going to make Consumer pipe-able and we'll not need any specific consumer implementation for that. Hence pipe consumer tests in NODE are failing. That's OK.

NOTE3: This is a work in progress.

TODO:

  • [] Make consumer pipe-able.
  • [] Remove old consumers. They are just not used anymore.

New ProducerStreamManager interface with the following implementations:
- SimpleProducerStreamManager: handles a single stream with no spatial or temporal layers.
- SimulcastProducerStreamManager: handles N streams with 1 spatial and N temporal layers.
- SvcProducerStreamManager: handles 1 stream with N spatial and M temporal layers.

Consumer + SimpleProducerStreamManager replaces SimpleConsumer.
Consumer + SimulcastProducerStreamManager replaces SimulcastConsumer.
Consumer + SvcProducerStreamManager replaces SvcConsumer.
@jmillan jmillan requested a review from ibc February 16, 2026 10:43
@jmillan jmillan marked this pull request as draft February 16, 2026 10:44
Comment thread worker/include/RTC/Consumer.hpp Outdated
Comment thread worker/include/RTC/Consumer.hpp
Comment thread worker/include/RTC/Consumer.hpp
Consumer::IsActive() checks:
- transportConnected
- paused
- producerPaused
- producerClosed

ProducerStreamManager::IsActive() checks:
- Consumer::IsActive()
- Whether producer streams are active
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/src/RTC/Consumer.cpp Outdated
Comment thread worker/src/RTC/Consumer.cpp Outdated
ibc
ibc previously requested changes Feb 18, 2026
Comment thread worker/test/src/RTC/TestSimpleProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSimpleProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSimpleProducerStreamManager.cpp Outdated
@ibc ibc mentioned this pull request Feb 24, 2026
4 tasks
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp Outdated
Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp
Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp Outdated
Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp Outdated
Comment thread worker/src/RTC/SvcProducerStreamManager.cpp Outdated
Comment thread worker/src/RTC/SvcProducerStreamManager.cpp Outdated
Comment thread worker/src/RTC/SvcProducerStreamManager.cpp Outdated
jmillan and others added 8 commits March 20, 2026 15:25
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
jmillan and others added 2 commits March 20, 2026 16:14
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp
Comment thread worker/src/RTC/SimulcastProducerStreamManager.cpp
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/src/RTC/SvcProducerStreamManager.cpp
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/src/RTC/SvcProducerStreamManager.cpp
jmillan added 3 commits March 20, 2026 16:35
We should make this decision broadly
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
SECTION("ProcessRtpPacket() returns DROP when target temporal layer is -1")
{
MockListener listener;
auto manager = createManager(&listener);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: no matching function for call to 'createManager' [clang-diagnostic-error]

;
                     ^
Additional context

worker/test/src/RTC/TestSvcProducerStreamManager.cpp:148: candidate function not viable: 1st argument ('const MockListener *') would lose const qualifier

	std::unique_ptr<RTC::SvcProducerStreamManager> createManager(
                                                ^

Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Comment thread worker/test/src/RTC/TestSvcProducerStreamManager.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants