Skip to content

Comments

Update to gstreamer-rs 0.14#272

Merged
bors-servo merged 1 commit intoservo:masterfrom
ceyusa:gstreamer-rs-0.14
Jun 26, 2019
Merged

Update to gstreamer-rs 0.14#272
bors-servo merged 1 commit intoservo:masterfrom
ceyusa:gstreamer-rs-0.14

Conversation

@ceyusa
Copy link
Contributor

@ceyusa ceyusa commented Jun 26, 2019

No description provided.


for position in positions.iter() {
let buffer = buffer.clone();
let buffer = buffer.to_owned();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary, a whole buffer copy instead of just getting a new reference?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's Sample::get_buffer_owned() if that's the issue here, which allows to do this without a copy of the buffer. See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/204 for the background.


pub fn get_frame_from_sample(&self, sample: &gst::Sample) -> Result<Frame, ()> {
let buffer = sample.get_buffer().ok_or_else(|| ())?;
let buffer = sample.get_buffer().ok_or_else(|| ())?.to_owned();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here

@sdroege
Copy link
Contributor

sdroege commented Jun 26, 2019

Generally it looks like the update improved the code a bit and made it nicer to read. Or what do you think? :)

@ceyusa ceyusa force-pushed the gstreamer-rs-0.14 branch from ce639f8 to bddabeb Compare June 26, 2019 14:52
@ceyusa
Copy link
Contributor Author

ceyusa commented Jun 26, 2019

Generally it looks like the update improved the code a bit and made it nicer to read. Or what do you think? :)

Agree, it feels more rusty, in the sense of the language, of course :)

Thanks @sdroege, specially for the get_buffer_owned() hint!

@Manishearth
Copy link
Member

@bors-servo r+

Should also fix the unsafe code used in webrtcbin for https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/189

@bors-servo
Copy link
Contributor

📌 Commit bddabeb has been approved by Manishearth

bors-servo pushed a commit that referenced this pull request Jun 26, 2019
@bors-servo
Copy link
Contributor

⌛ Testing commit bddabeb with merge 89c48f7...

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-travis
Approved by: Manishearth
Pushing 89c48f7 to master...

@bors-servo bors-servo merged commit bddabeb into servo:master Jun 26, 2019
@ceyusa ceyusa deleted the gstreamer-rs-0.14 branch June 26, 2019 16:12
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.

4 participants