mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Add Rust_scaleVideoFrameBuffer
This commit is contained in:
parent
0734fdad69
commit
ff4a9d3e8e
2 changed files with 10 additions and 0 deletions
|
@ -91,6 +91,10 @@ RUSTEXPORT void Rust_convertVideoFrameBufferToRgba(
|
||||||
RUSTEXPORT const uint8_t *Rust_getVideoFrameBufferAsI420(
|
RUSTEXPORT const uint8_t *Rust_getVideoFrameBufferAsI420(
|
||||||
const webrtc::VideoFrameBuffer* buffer);
|
const webrtc::VideoFrameBuffer* buffer);
|
||||||
|
|
||||||
|
// See VideoFrameBuffer::Scale. Output will be in I420.
|
||||||
|
RUSTEXPORT webrtc::VideoFrameBuffer* Rust_scaleVideoFrameBuffer(
|
||||||
|
webrtc::VideoFrameBuffer* buffer_borrowed_rc, int width, int height);
|
||||||
|
|
||||||
// RGBA => I420
|
// RGBA => I420
|
||||||
RUSTEXPORT webrtc::VideoFrameBuffer* Rust_copyAndRotateVideoFrameBuffer(
|
RUSTEXPORT webrtc::VideoFrameBuffer* Rust_copyAndRotateVideoFrameBuffer(
|
||||||
const webrtc::VideoFrameBuffer* buffer_borrowed_rc, webrtc::VideoRotation rotation);
|
const webrtc::VideoFrameBuffer* buffer_borrowed_rc, webrtc::VideoRotation rotation);
|
||||||
|
|
|
@ -201,6 +201,12 @@ RUSTEXPORT const uint8_t *Rust_getVideoFrameBufferAsI420(const VideoFrameBuffer*
|
||||||
return dataY;
|
return dataY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns an owned RC.
|
||||||
|
RUSTEXPORT VideoFrameBuffer* Rust_scaleVideoFrameBuffer(
|
||||||
|
VideoFrameBuffer* buffer_borrowed_rc, int width, int height) {
|
||||||
|
return take_rc(buffer_borrowed_rc->Scale(width, height));
|
||||||
|
}
|
||||||
|
|
||||||
// Returns an owned RC.
|
// Returns an owned RC.
|
||||||
RUSTEXPORT VideoFrameBuffer* Rust_copyAndRotateVideoFrameBuffer(
|
RUSTEXPORT VideoFrameBuffer* Rust_copyAndRotateVideoFrameBuffer(
|
||||||
const VideoFrameBuffer* buffer_borrowed_rc, VideoRotation rotation) {
|
const VideoFrameBuffer* buffer_borrowed_rc, VideoRotation rotation) {
|
||||||
|
|
Loading…
Reference in a new issue