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

rename rgba conversions #257

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
davidzhao marked this conversation as resolved.
Show resolved Hide resolved
}
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
Loading