Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

update to webrtc 0.2.2 and use re-export #2

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ repository = "https://github.com/webrtc-rs/examples"

[dev-dependencies]
util = { package = "webrtc-util", version = "0.5.0" }
rtp = "0.6.0"
rtcp = "0.5.0"
data = { package = "webrtc-data", version = "0.3.0" }
interceptor = "0.4.0"
media = { package = "webrtc-media", version = "0.4.0" }
webrtc = "0.2.1" #{ path = "..", version = "0.2.1" } #
webrtc = "0.2.2"
tokio = { version = "1.12.0", features = ["full"] }
env_logger = "0.9.0"
clap = "2"
Expand Down
4 changes: 2 additions & 2 deletions examples/broadcast/broadcast.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use rtcp::payload_feedbacks::picture_loss_indication::PictureLossIndication;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTPCodecType;
use webrtc::media::rtp::rtp_receiver::RTCRtpReceiver;
use webrtc::media::track::track_local::track_local_static_rtp::TrackLocalStaticRTP;
Expand All @@ -17,6 +16,7 @@ use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::rtcp::payload_feedbacks::picture_loss_indication::PictureLossIndication;
use webrtc::Error;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/data-channels-close/data-channels-close.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::atomic::{AtomicI32, Ordering};
use std::sync::Arc;
Expand All @@ -11,6 +10,7 @@ use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
Expand Down
2 changes: 1 addition & 1 deletion examples/data-channels-create/data-channels-create.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use anyhow::Result;
use bytes::Bytes;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::MediaEngine;
use webrtc::api::setting_engine::SettingEngine;
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
Expand Down Expand Up @@ -197,7 +197,7 @@ async fn main() -> Result<()> {
}

// read_loop shows how to read from the datachannel directly
async fn read_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
async fn read_loop(d: Arc<webrtc::webrtc_data::data_channel::DataChannel>) -> Result<()> {
let mut buffer = vec![0u8; MESSAGE_SIZE];
loop {
let n = match d.read(&mut buffer).await {
Expand All @@ -216,7 +216,7 @@ async fn read_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
}

// write_loop shows how to write to the datachannel directly
async fn write_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
async fn write_loop(d: Arc<webrtc::webrtc_data::data_channel::DataChannel>) -> Result<()> {
let mut result = Result::<usize>::Ok(0);
while result.is_ok() {
let timeout = tokio::time::sleep(Duration::from_secs(5));
Expand Down
6 changes: 3 additions & 3 deletions examples/data-channels-detach/data-channels-detach.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::Result;
use bytes::Bytes;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
Expand All @@ -10,6 +9,7 @@ use webrtc::api::media_engine::MediaEngine;
use webrtc::api::setting_engine::SettingEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn main() -> Result<()> {
}

// read_loop shows how to read from the datachannel directly
async fn read_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
async fn read_loop(d: Arc<webrtc::webrtc_data::data_channel::DataChannel>) -> Result<()> {
let mut buffer = vec![0u8; MESSAGE_SIZE];
loop {
let n = match d.read(&mut buffer).await {
Expand All @@ -225,7 +225,7 @@ async fn read_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
}

// write_loop shows how to write to the datachannel directly
async fn write_loop(d: Arc<data::data_channel::DataChannel>) -> Result<()> {
async fn write_loop(d: Arc<webrtc::webrtc_data::data_channel::DataChannel>) -> Result<()> {
let mut result = Result::<usize>::Ok(0);
while result.is_ok() {
let timeout = tokio::time::sleep(Duration::from_secs(5));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::Result;
use bytes::Bytes;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
Expand All @@ -13,6 +12,7 @@ use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_init::RTCDataChannelInit;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_candidate::RTCIceCandidate;
use webrtc::peer::ice::ice_server::RTCIceServer;
Expand Down
2 changes: 1 addition & 1 deletion examples/data-channels/data-channels.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
Expand All @@ -9,6 +8,7 @@ use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
Expand Down
2 changes: 1 addition & 1 deletion examples/ice-restart/ice-restart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use anyhow::Result;
use clap::{App, AppSettings, Arg};
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Method, Request, Response, Server, StatusCode};
use interceptor::registry::Registry;
use std::io::Write;
use std::net::SocketAddr;
use std::str::FromStr;
Expand All @@ -14,6 +13,7 @@ use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_connection_state::RTCIceConnectionState;
use webrtc::peer::peer_connection::RTCPeerConnection;
Expand Down
6 changes: 3 additions & 3 deletions examples/insertable-streams/insertable-streams.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use media::io::ivf_reader::IVFReader;
use media::Sample;
use std::fs::File;
use std::io::BufReader;
use std::io::Write;
Expand All @@ -13,6 +10,7 @@ use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_VP8};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTCRtpCodecCapability;
use webrtc::media::track::track_local::track_local_static_sample::TrackLocalStaticSample;
use webrtc::media::track::track_local::TrackLocal;
Expand All @@ -21,6 +19,8 @@ use webrtc::peer::ice::ice_connection_state::RTCIceConnectionState;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::webrtc_media::io::ivf_reader::IVFReader;
use webrtc::webrtc_media::Sample;
use webrtc::Error;

const CIPHER_KEY: u8 = 0xAA;
Expand Down
2 changes: 1 addition & 1 deletion examples/offer-answer/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use anyhow::Result;
use clap::{App, AppSettings, Arg};
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Client, Method, Request, Response, Server, StatusCode};
use interceptor::registry::Registry;
use std::io::Write;
use std::net::SocketAddr;
use std::str::FromStr;
Expand All @@ -14,6 +13,7 @@ use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::data::data_channel::RTCDataChannel;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_candidate::{RTCIceCandidate, RTCIceCandidateInit};
use webrtc::peer::ice::ice_server::RTCIceServer;
Expand Down
2 changes: 1 addition & 1 deletion examples/offer-answer/offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use anyhow::Result;
use clap::{App, AppSettings, Arg};
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Client, Method, Request, Response, Server, StatusCode};
use interceptor::registry::Registry;
use std::io::Write;
use std::net::SocketAddr;
use std::str::FromStr;
Expand All @@ -13,6 +12,7 @@ use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::MediaEngine;
use webrtc::api::APIBuilder;
use webrtc::data::data_channel::data_channel_message::DataChannelMessage;
use webrtc::interceptor::registry::Registry;
use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_candidate::{RTCIceCandidate, RTCIceCandidateInit};
use webrtc::peer::ice::ice_server::RTCIceServer;
Expand Down
8 changes: 4 additions & 4 deletions examples/play-from-disk-h264/play-from-disk-h264.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use media::io::h264_reader::H264Reader;
use media::io::ogg_reader::OggReader;
use media::Sample;
use std::fs::File;
use std::io::BufReader;
use std::io::Write;
Expand All @@ -14,6 +10,7 @@ use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_H264, MIME_TYPE_OPUS};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTCRtpCodecCapability;
use webrtc::media::track::track_local::track_local_static_sample::TrackLocalStaticSample;
use webrtc::media::track::track_local::TrackLocal;
Expand All @@ -22,6 +19,9 @@ use webrtc::peer::ice::ice_connection_state::RTCIceConnectionState;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::webrtc_media::io::h264_reader::H264Reader;
use webrtc::webrtc_media::io::ogg_reader::OggReader;
use webrtc::webrtc_media::Sample;
use webrtc::Error;

#[tokio::main]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ use anyhow::Result;
use clap::{App, AppSettings, Arg};
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Method, Request, Response, Server, StatusCode};
use interceptor::registry::Registry;
use media::io::ivf_reader::IVFReader;
use media::Sample;
use std::fs::File;
use std::io::BufReader;
use std::io::Write;
Expand All @@ -18,6 +15,7 @@ use tokio_util::codec::{BytesCodec, FramedRead};
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_VP8};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTCRtpCodecCapability;
use webrtc::media::track::track_local::track_local_static_sample::TrackLocalStaticSample;
use webrtc::media::track::track_local::TrackLocal;
Expand All @@ -26,6 +24,8 @@ use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection::RTCPeerConnection;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::webrtc_media::io::ivf_reader::IVFReader;
use webrtc::webrtc_media::Sample;
use webrtc::Error;

#[macro_use]
Expand Down
8 changes: 4 additions & 4 deletions examples/play-from-disk-vp8/play-from-disk-vp8.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use media::io::ivf_reader::IVFReader;
use media::io::ogg_reader::OggReader;
use media::Sample;
use std::fs::File;
use std::io::BufReader;
use std::io::Write;
Expand All @@ -14,6 +10,7 @@ use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_OPUS, MIME_TYPE_VP8};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTCRtpCodecCapability;
use webrtc::media::track::track_local::track_local_static_sample::TrackLocalStaticSample;
use webrtc::media::track::track_local::TrackLocal;
Expand All @@ -22,6 +19,9 @@ use webrtc::peer::ice::ice_connection_state::RTCIceConnectionState;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::webrtc_media::io::ivf_reader::IVFReader;
use webrtc::webrtc_media::io::ogg_reader::OggReader;
use webrtc::webrtc_media::Sample;
use webrtc::Error;

#[tokio::main]
Expand Down
8 changes: 4 additions & 4 deletions examples/play-from-disk-vp9/play-from-disk-vp9.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use media::io::ivf_reader::IVFReader;
use media::io::ogg_reader::OggReader;
use media::Sample;
use std::fs::File;
use std::io::BufReader;
use std::io::Write;
Expand All @@ -14,6 +10,7 @@ use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_OPUS, MIME_TYPE_VP9};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::RTCRtpCodecCapability;
use webrtc::media::track::track_local::track_local_static_sample::TrackLocalStaticSample;
use webrtc::media::track::track_local::TrackLocal;
Expand All @@ -22,6 +19,9 @@ use webrtc::peer::ice::ice_connection_state::RTCIceConnectionState;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::webrtc_media::io::ivf_reader::IVFReader;
use webrtc::webrtc_media::io::ogg_reader::OggReader;
use webrtc::webrtc_media::Sample;
use webrtc::Error;

#[tokio::main]
Expand Down
4 changes: 2 additions & 2 deletions examples/reflect/reflect.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use interceptor::registry::Registry;
use rtcp::payload_feedbacks::picture_loss_indication::PictureLossIndication;
use std::collections::HashMap;
use std::io::Write;
use std::sync::Arc;
use tokio::time::Duration;
use webrtc::api::interceptor_registry::register_default_interceptors;
use webrtc::api::media_engine::{MediaEngine, MIME_TYPE_OPUS, MIME_TYPE_VP8};
use webrtc::api::APIBuilder;
use webrtc::interceptor::registry::Registry;
use webrtc::media::rtp::rtp_codec::{RTCRtpCodecCapability, RTCRtpCodecParameters, RTPCodecType};
use webrtc::media::rtp::rtp_receiver::RTCRtpReceiver;
use webrtc::media::track::track_local::track_local_static_rtp::TrackLocalStaticRTP;
Expand All @@ -18,6 +17,7 @@ use webrtc::peer::configuration::RTCConfiguration;
use webrtc::peer::ice::ice_server::RTCIceServer;
use webrtc::peer::peer_connection_state::RTCPeerConnectionState;
use webrtc::peer::sdp::session_description::RTCSessionDescription;
use webrtc::rtcp::payload_feedbacks::picture_loss_indication::PictureLossIndication;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
Loading