Skip to content

Commit

Permalink
rename rgba conversions (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Dec 5, 2023
1 parent fdf5ab2 commit ca85dd0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions livekit-ffi/src/server/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ fn on_set_subscribed(
server.retrieve_handle::<FfiPublication>(set_subscribed.publication_handle)?;

let TrackPublication::Remote(publication) = &ffi_publication.publication else {
return Err(FfiError::InvalidRequest("publication is not a RemotePublication".into()));
};
return Err(FfiError::InvalidRequest(
"publication is not a RemotePublication".into(),
));
};

let _guard = server.async_runtime.enter();
publication.set_subscribed(set_subscribed.subscribe);
Expand Down Expand Up @@ -457,7 +459,7 @@ unsafe fn on_to_argb(
let Some(proto::video_frame_buffer_info::Buffer::Yuv(yuv)) = &buffer.buffer else {
return Err(FfiError::InvalidRequest(
"invalid i420 buffer description".into(),
))
));
};

#[rustfmt::skip]
Expand All @@ -470,19 +472,19 @@ unsafe fn on_to_argb(
match rgba_format {
proto::VideoFormatType::FormatArgb => {
#[rustfmt::skip]
yuv_helper::i420_to_argb(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
yuv_helper::i420_to_bgra(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
}
proto::VideoFormatType::FormatBgra => {
#[rustfmt::skip]
yuv_helper::i420_to_bgra(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
yuv_helper::i420_to_argb(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
}
proto::VideoFormatType::FormatRgba => {
#[rustfmt::skip]
yuv_helper::i420_to_rgba(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
yuv_helper::i420_to_abgr(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
}
proto::VideoFormatType::FormatAbgr => {
#[rustfmt::skip]
yuv_helper::i420_to_abgr(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
yuv_helper::i420_to_rgba(src_y, yuv.stride_y, src_u, yuv.stride_u, src_v, yuv.stride_v, argb, stride, w, h);
}
}
}
Expand Down

0 comments on commit ca85dd0

Please sign in to comment.