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

Block the gstreamer plugin waiting for the next frame #25246

Merged
merged 1 commit into from Dec 12, 2019

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Dec 11, 2019

Get the GStreamer plugin to produce frames at the requested rate rather than relying on downstream elements to perform throttling.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #24833
  • These changes do not require tests because
@asajeffrey
Copy link
Member Author

asajeffrey commented Dec 11, 2019

r? @Manishearth you are our emergency backup gstreamer reviewer.

@highfive highfive assigned Manishearth and unassigned SimonSapin Dec 11, 2019
// It's been merged but not yet published.
// https://github.com/servo/servo/issues/25234
let elapsed_micros = self.start.elapsed().as_micros() as u64;
let frame_duration_micros = self.frame_duration_micros.load(Ordering::SeqCst);

This comment has been minimized.

Copy link
@Manishearth

Manishearth Dec 11, 2019

Member

If this is the only thread doing reads and writes we can just have Acquire/Release everywhere here, I think

This comment has been minimized.

Copy link
@Manishearth

Manishearth Dec 11, 2019

Member

actually if it's just one thread then relaxed probably works? unsure.

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Dec 11, 2019

Author Member

All true, I am being conservative here,m I doubt that the different orderings make much difference, given that the next operations are thread::sleep followed by locking a Mutex.

let frame_duration_micros =
1_000_000 * *framerate.denom() as u64 / *framerate.numer() as u64;
debug!("Setting frame duration to {}micros", frame_duration_micros);
self.frame_duration_micros

This comment has been minimized.

Copy link
@Manishearth

Manishearth Dec 11, 2019

Member

This never changes: Does it need to be an atomic?

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Dec 11, 2019

Author Member

Renegotiating caps can happen at any time, and the src needs to be Sync, so yes it needs to be an Atomic.

Copy link
Member

Manishearth left a comment

approach looks fine, i feel like there's probably a builtin way to do this, and i think the atomics can be better

Copy link
Member Author

asajeffrey left a comment

Really this should be using gstreamers get_times API, but that's not exposed to Rust yet.

// It's been merged but not yet published.
// https://github.com/servo/servo/issues/25234
let elapsed_micros = self.start.elapsed().as_micros() as u64;
let frame_duration_micros = self.frame_duration_micros.load(Ordering::SeqCst);

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Dec 11, 2019

Author Member

All true, I am being conservative here,m I doubt that the different orderings make much difference, given that the next operations are thread::sleep followed by locking a Mutex.

let frame_duration_micros =
1_000_000 * *framerate.denom() as u64 / *framerate.numer() as u64;
debug!("Setting frame duration to {}micros", frame_duration_micros);
self.frame_duration_micros

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Dec 11, 2019

Author Member

Renegotiating caps can happen at any time, and the src needs to be Sync, so yes it needs to be an Atomic.

@asajeffrey
Copy link
Member Author

asajeffrey commented Dec 11, 2019

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Dec 11, 2019

📌 Commit c7d8017 has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

The latest upstream changes (presumably #25243) made this pull request unmergeable. Please resolve the merge conflicts.

@asajeffrey asajeffrey force-pushed the asajeffrey:gstplugin-framerates branch from c7d8017 to 24678da Dec 12, 2019
@asajeffrey
Copy link
Member Author

asajeffrey commented Dec 12, 2019

Rebased. @bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

📌 Commit 24678da has been approved by Manishearth

bors-servo added a commit that referenced this pull request Dec 12, 2019
Block the gstreamer plugin waiting for the next frame

<!-- Please describe your changes on the following line: -->

Get the GStreamer plugin to produce frames at the requested rate rather than relying on downstream elements to perform throttling.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24833
- [x] These changes do not require tests because

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

Testing commit 24678da with merge d0e00d1...

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 12, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

Testing commit 24678da with merge 2938ea0...

bors-servo added a commit that referenced this pull request Dec 12, 2019
Block the gstreamer plugin waiting for the next frame

<!-- Please describe your changes on the following line: -->

Get the GStreamer plugin to produce frames at the requested rate rather than relying on downstream elements to perform throttling.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24833
- [x] These changes do not require tests because

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Dec 12, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

Testing commit 24678da with merge c54d09a...

bors-servo added a commit that referenced this pull request Dec 12, 2019
Block the gstreamer plugin waiting for the next frame

<!-- Please describe your changes on the following line: -->

Get the GStreamer plugin to produce frames at the requested rate rather than relying on downstream elements to perform throttling.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24833
- [x] These changes do not require tests because

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 12, 2019

☀️ Test successful - status-taskcluster
Approved by: Manishearth
Pushing c54d09a to master...

@bors-servo bors-servo merged commit 24678da into servo:master Dec 12, 2019
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.