Skip to content

Commit

Permalink
expose libwebrtc's ProhibitLibsrtpInitialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kbalt committed Oct 29, 2024
1 parent 1fbcb2c commit e160ca2
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webrtc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn main() {
"src/yuv_helper.rs",
"src/audio_resampler.rs",
"src/android.rs",
"src/prohibit_libsrtp_initialization.rs",
]);

builder.files(&[
Expand All @@ -73,6 +74,7 @@ fn main() {
"src/audio_resampler.cpp",
"src/frame_cryptor.cpp",
"src/global_task_queue.cpp",
"src/prohibit_libsrtp_initialization.cpp",
]);

let webrtc_dir = webrtc_sys_build::webrtc_dir();
Expand Down
21 changes: 21 additions & 0 deletions webrtc-sys/include/livekit/prohibit_libsrtp_initialization.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2023 LiveKit
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

namespace livekit {
void ProhibitLibsrtpInitialization();
}
1 change: 1 addition & 0 deletions webrtc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub mod video_frame_buffer;
pub mod video_track;
pub mod webrtc;
pub mod yuv_helper;
pub mod prohibit_libsrtp_initialization;

pub const MEDIA_TYPE_VIDEO: &str = "video";
pub const MEDIA_TYPE_AUDIO: &str = "audio";
Expand Down
23 changes: 23 additions & 0 deletions webrtc-sys/src/prohibit_libsrtp_initialization.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2023 LiveKit
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "pc/srtp_session.h"

namespace livekit {
void ProhibitLibsrtpInitialization() {
cricket::ProhibitLibsrtpInitialization();
}
}
22 changes: 22 additions & 0 deletions webrtc-sys/src/prohibit_libsrtp_initialization.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2023 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#[cxx::bridge(namespace = "livekit")]
pub mod ffi {
unsafe extern "C++" {
include!("livekit/prohibit_libsrtp_initialization.h");

fn ProhibitLibsrtpInitialization();
}
}

0 comments on commit e160ca2

Please sign in to comment.