mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
Use Buffer::from_mut_slice() in more places
This allows downstream to map the memory mutable.
This commit is contained in:
parent
484cad00ce
commit
f4613bfc07
3 changed files with 7 additions and 5 deletions
|
@ -141,7 +141,8 @@ impl TranscribeParse {
|
||||||
"punctuation" => {
|
"punctuation" => {
|
||||||
if !item.alternatives.is_empty() {
|
if !item.alternatives.is_empty() {
|
||||||
let alternative = item.alternatives.remove(0);
|
let alternative = item.alternatives.remove(0);
|
||||||
let mut outbuf = gst::Buffer::from_slice(alternative.content.into_bytes());
|
let mut outbuf =
|
||||||
|
gst::Buffer::from_mut_slice(alternative.content.into_bytes());
|
||||||
|
|
||||||
{
|
{
|
||||||
let outbuf = outbuf.get_mut().unwrap();
|
let outbuf = outbuf.get_mut().unwrap();
|
||||||
|
@ -198,7 +199,8 @@ impl TranscribeParse {
|
||||||
|
|
||||||
if !(item.alternatives.is_empty()) {
|
if !(item.alternatives.is_empty()) {
|
||||||
let alternative = item.alternatives.remove(0);
|
let alternative = item.alternatives.remove(0);
|
||||||
let mut outbuf = gst::Buffer::from_slice(alternative.content.into_bytes());
|
let mut outbuf =
|
||||||
|
gst::Buffer::from_mut_slice(alternative.content.into_bytes());
|
||||||
|
|
||||||
{
|
{
|
||||||
let outbuf = outbuf.get_mut().unwrap();
|
let outbuf = outbuf.get_mut().unwrap();
|
||||||
|
|
|
@ -257,10 +257,10 @@ impl JsonGstParse {
|
||||||
);
|
);
|
||||||
|
|
||||||
if !seeking {
|
if !seeking {
|
||||||
let data = data.to_string().clone();
|
let data = data.to_string();
|
||||||
let mut events = state.create_events(element);
|
let mut events = state.create_events(element);
|
||||||
|
|
||||||
let mut buffer = gst::Buffer::from_slice(data);
|
let mut buffer = gst::Buffer::from_mut_slice(data.into_bytes());
|
||||||
|
|
||||||
if let Some(last_position) = state.last_position {
|
if let Some(last_position) = state.last_position {
|
||||||
if let Some(duration) = pts.map(|pts| pts.checked_sub(last_position)) {
|
if let Some(duration) = pts.map(|pts| pts.checked_sub(last_position)) {
|
||||||
|
|
|
@ -174,7 +174,7 @@ impl Ffv1Dec {
|
||||||
// FIXME: we can also do this if we have video meta support and differing strides
|
// FIXME: we can also do this if we have video meta support and differing strides
|
||||||
let mem = if src_stride == dest_stride {
|
let mem = if src_stride == dest_stride {
|
||||||
// Just wrap the decoded frame vecs and push them out
|
// Just wrap the decoded frame vecs and push them out
|
||||||
gst::Memory::from_slice(decoded_plane)
|
gst::Memory::from_mut_slice(decoded_plane)
|
||||||
} else {
|
} else {
|
||||||
// Mismatched stride, let's copy
|
// Mismatched stride, let's copy
|
||||||
let out_plane = gst::Memory::with_size(dest_stride * comp_height);
|
let out_plane = gst::Memory::with_size(dest_stride * comp_height);
|
||||||
|
|
Loading…
Reference in a new issue