RtpTransceiver bindings & requirements for publishing tracks (#39)

- RtpSender
- RtpReceiver
- RtpTransceiver
- RtpParameters
- VideoFrameBuilder
- Interior mutability on c++ side
- Cleanup bindings ( Use #pragma once instead of include guards )
     - webrtc-sys/src/* headers are now used in only one place 
     - Avoid confusion between generated headers and our headers
- AdaptedVideoTrackSource
- Cleanup the workaround with unsupported Vec<Shared<T>>
    - Put everything inside one file
This commit is contained in:
Théo Monnom
2023-02-12 19:44:04 +01:00
committed by GitHub
parent 4411f88b68
commit 16ea02075f
64 changed files with 3357 additions and 670 deletions
+18 -4
View File
@@ -11,12 +11,17 @@ pub mod ffi {
VideoRotation270 = 270,
}
unsafe extern "C++" {
include!("livekit/video_frame.h");
extern "C++" {
include!("livekit/video_frame_buffer.h");
type VideoFrame;
type VideoFrameBuffer = crate::video_frame_buffer::ffi::VideoFrameBuffer;
}
unsafe extern "C++" {
include!("livekit/video_frame.h");
type VideoFrame;
type VideoFrameBuilder;
fn width(self: &VideoFrame) -> i32;
fn height(self: &VideoFrame) -> i32;
@@ -29,7 +34,16 @@ pub mod ffi {
fn rotation(self: &VideoFrame) -> VideoRotation;
fn video_frame_buffer(self: &VideoFrame) -> UniquePtr<VideoFrameBuffer>;
fn _unique_video_frame() -> UniquePtr<VideoFrame>; // Ignore
fn set_video_frame_buffer(
self: Pin<&mut VideoFrameBuilder>,
buffer: UniquePtr<VideoFrameBuffer>,
);
fn set_timestamp_us(self: Pin<&mut VideoFrameBuilder>, timestamp_us: i64);
fn set_rotation(self: Pin<&mut VideoFrameBuilder>, rotation: VideoRotation);
fn set_id(self: Pin<&mut VideoFrameBuilder>, id: u16);
fn build(self: Pin<&mut VideoFrameBuilder>) -> UniquePtr<VideoFrame>;
fn create_video_frame_builder() -> UniquePtr<VideoFrameBuilder>;
}
}