Skip to content

[GStreamer][WebRTC] Implement GstMappedRtpBuffer#9373

Merged
webkit-early-warning-system merged 1 commit intoWebKit:mainfrom
philn:eng/251428
Mar 2, 2023
Merged

[GStreamer][WebRTC] Implement GstMappedRtpBuffer#9373
webkit-early-warning-system merged 1 commit intoWebKit:mainfrom
philn:eng/251428

Conversation

@philn
Copy link
Copy Markdown
Member

@philn philn commented Jan 31, 2023

@philn philn self-assigned this Jan 31, 2023
@philn philn added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label Jan 31, 2023
@philn philn requested a review from calvaris January 31, 2023 10:21
@philn philn marked this pull request as draft January 31, 2023 10:54
@philn philn marked this pull request as ready for review January 31, 2023 11:05
@webkit-early-warning-system
Copy link
Copy Markdown
Collaborator

webkit-early-warning-system commented Jan 31, 2023

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 31, 2023
Copy link
Copy Markdown
Contributor

@calvaris calvaris left a comment

Choose a reason for hiding this comment

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

If this implementation is the same as the GstMappedBuffer with the only difference of map/unmap functions, I think we should do some templating here and optionally pass the map/unmap functions. Then, if you want, you can create the GstRTPMappedBuffer with a using.

@philn
Copy link
Copy Markdown
Member Author

philn commented Feb 1, 2023

If this implementation is the same as the GstMappedBuffer with the only difference of map/unmap functions, I think we should do some templating here and optionally pass the map/unmap functions. Then, if you want, you can create the GstRTPMappedBuffer with a using.

The public API differs though.

@calvaris
Copy link
Copy Markdown
Contributor

calvaris commented Feb 2, 2023

In what, other than the type?

@philn
Copy link
Copy Markdown
Member Author

philn commented Feb 2, 2023

In what, other than the type?

GstMappedBuffer has ::size() and ::createVector()

@calvaris
Copy link
Copy Markdown
Contributor

calvaris commented Feb 3, 2023

GstMappedBuffer has ::size() and ::createVector()

I still think it is worth trying. It does not hurt to have them. You need four template parameters, but nothing outstanding. If you want, you can avoid using default parameters and create a GstBufferBaseMappedBuffer with the four template parameters (GstBuffer, GstMapInfo (which also seems to differ for RTP), map and unmap). Then you create GstBufferMap with a using.

We would be reducing a lot the code duplication.

@philn
Copy link
Copy Markdown
Member Author

philn commented Feb 3, 2023

GstMappedBuffer has ::size() and ::createVector()

I still think it is worth trying. It does not hurt to have them. You need four template parameters, but nothing outstanding. If you want, you can avoid using default parameters and create a GstBufferBaseMappedBuffer with the four template parameters (GstBuffer, GstMapInfo (which also seems to differ for RTP), map and unmap). Then you create GstBufferMap with a using.

We would be reducing a lot the code duplication.

Yes and I tried this already :) ::createVector() doesn't make much sense for RTP buffers though.

@calvaris
Copy link
Copy Markdown
Contributor

calvaris commented Feb 7, 2023

Yes and I tried this already :) ::createVector() doesn't make much sense for RTP buffers though.

You don't need to use all the API. I am very reluctant to create something that is almost equal in code to something that can change a couple of types and functions. That's what templates are for, right?

@philn
Copy link
Copy Markdown
Member Author

philn commented Feb 7, 2023

Let's revisit this PR when we have more than one usage of gst_rtp_buffer_map().

@philn philn marked this pull request as draft February 7, 2023 08:34
@calvaris
Copy link
Copy Markdown
Contributor

calvaris commented Feb 8, 2023

For me, one use is enough and templating is the way to go ☺️

@philn philn removed the merging-blocked Applied to prevent a change from being merged label Mar 1, 2023
@webkit-early-warning-system
Copy link
Copy Markdown
Collaborator

webkit-early-warning-system commented Mar 1, 2023

@philn philn requested a review from calvaris March 1, 2023 17:33
@philn philn marked this pull request as ready for review March 1, 2023 17:34
@webkit-early-warning-system
Copy link
Copy Markdown
Collaborator

Starting EWS tests for 0ffe5ca. Live statuses available at the PR page, #9373

@webkit-early-warning-system
Copy link
Copy Markdown
Collaborator

webkit-early-warning-system commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

@calvaris calvaris left a comment

Choose a reason for hiding this comment

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

B E A U T I F U L !

@philn philn added the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=251428

Reviewed by Xabier Rodriguez-Calvar.

With this new RAII object for mapping RTP buffers we don't need to manually unmap anymore.

Canonical link: https://commits.webkit.org/261074@main
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 261074@main (7878d72): https://commits.webkit.org/261074@main

Reviewed commits have been landed. Closing PR #9373 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
@philn philn deleted the eng/251428 branch March 2, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform Portability improvements and other general platform improvements not driven directly by site bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants