Skip to content

Add H264 RTP depayloader #224

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
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Add H264 RTP depayloader #224

wants to merge 11 commits into from

Conversation

brzep
Copy link

@brzep brzep commented Jul 9, 2025

Depayloads H264 from RTP. Supports following NALU types: Single NALU, STAP-A, FU-A.

@brzep brzep force-pushed the brzep/h264-depayloader branch from 646eb37 to aeea29d Compare July 9, 2025 14:51
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.08%. Comparing base (38e05e2) to head (5ce9157).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
+ Coverage   87.79%   88.08%   +0.29%     
==========================================
  Files          54       59       +5     
  Lines        2752     2804      +52     
==========================================
+ Hits         2416     2470      +54     
+ Misses        336      334       -2     
Files with missing lines Coverage Δ
lib/ex_webrtc/rtp/depayloader.ex 100.00% <100.00%> (ø)
lib/ex_webrtc/rtp/h264/depayloader.ex 100.00% <100.00%> (ø)
lib/ex_webrtc/rtp/h264/nal_formats/fu.ex 100.00% <100.00%> (ø)
lib/ex_webrtc/rtp/h264/nal_formats/fu/header.ex 100.00% <100.00%> (ø)
lib/ex_webrtc/rtp/h264/nal_formats/stap_a.ex 100.00% <100.00%> (ø)
lib/ex_webrtc/rtp/h264/nal_header.ex 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38e05e2...5ce9157. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brzep brzep requested review from sgfn and mickel8 July 9, 2025 14:54
Copy link
Member

@sgfn sgfn left a comment

Choose a reason for hiding this comment

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

💪

@brzep brzep force-pushed the brzep/h264-depayloader branch from 3eb806f to 43407a3 Compare July 11, 2025 09:12
@brzep brzep requested a review from sgfn July 11, 2025 13:18
Copy link
Member

@sgfn sgfn left a comment

Choose a reason for hiding this comment

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

It would be nice if we could add tests for the other modules (fu, fu/header, stap_a, nal_header), like in test/rtp/vp8/payload_test.exs or test/rtp/av1/ as well. But I won't push for this, as we have other things on the roadmap -- if @mickel8 approves, you can merge 👍

Comment on lines +2 to +4
@moduledoc """
Module responsible for parsing H264 Fragmentation Unit.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Let's change the other moduledocs to comments as well


defp do_depayload(:stap_a, depayloader, packet, {_header, payload}) do
with {:ok, result} <- StapA.parse(payload) do
nals = result |> Stream.map(&prefix_annexb/1) |> Enum.join()
Copy link
Member

Choose a reason for hiding this comment

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

sorry, completely forgot about the existence of Enum.map_join/2 xdd
we can use that instead

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.

2 participants