This commit is contained in:
Marshall Polaris 2019-12-09 13:47:57 -08:00
Родитель 3fc6ec5ec5
Коммит 0c0aea3599
13 изменённых файлов: 27 добавлений и 35 удалений

Просмотреть файл

@ -1,6 +1,7 @@
[package]
name = "janus-plugin"
version = "0.11.1"
edition = "2018"
authors = ["Marshall Quander <marshall@quander.me>"]
description = "Library for creating plugins for Janus, the WebRTC gateway."
repository = "https://github.com/mozilla/janus-plugin-rs"

Просмотреть файл

@ -1,10 +1,11 @@
[package]
name = "jansson-sys"
version = "0.1.0"
edition = "2018"
authors = ["Marshall Quander <marshall@quander.me>"]
description = "Native bindings for Jansson, the C JSON library."
repository = "https://github.com/mozilla/janus-plugin-rs"
license = "MPL-2.0"
[dev-dependencies]
cstr-macro = "0.1.0"
cstr-macro = "0.1.0"

Просмотреть файл

@ -131,8 +131,7 @@ pub unsafe fn json_decref(json: *mut json_t) {
}
#[cfg(test)]
#[macro_use]
extern crate cstr_macro;
use cstr_macro::cstr;
#[cfg(test)]
mod tests {

Просмотреть файл

@ -1,6 +1,7 @@
[package]
name = "janus-plugin-sys"
version = "0.6.0"
edition = "2018"
authors = ["Marshall Quander <marshall@quander.me>"]
description = "Native bindings to the Janus plugin API."
repository = "https://github.com/mozilla/janus-plugin-rs"

Просмотреть файл

@ -1,8 +1,6 @@
#![allow(non_camel_case_types)]
#![deny(missing_debug_implementations)]
extern crate glib_sys;
extern crate jansson_sys;
use std::os::raw::{c_char, c_int};
pub mod plugin;

Просмотреть файл

@ -34,7 +34,7 @@ pub struct janus_plugin_session {
pub gateway_handle: *mut c_void,
pub plugin_handle: *mut c_void,
pub stopped: c_int,
pub ref_: ::janus_refcount,
pub ref_: crate::janus_refcount,
}
#[repr(C)]

Просмотреть файл

@ -1,6 +1,6 @@
#![allow(non_camel_case_types)]
use super::glib_sys::{gboolean, GSList};
use glib_sys::{gboolean, GSList};
use std::os::raw::{c_char, c_int, c_uint};
extern "C" {

Просмотреть файл

@ -1,6 +1,6 @@
#![allow(non_camel_case_types)]
use super::glib_sys::{gboolean, GList};
use glib_sys::{gboolean, GList};
use std::os::raw::{c_char, c_int, c_long, c_short, c_ulong};
pub type guint16 = c_short;

Просмотреть файл

@ -1,11 +1,8 @@
/// Utilities for writing messages to the Janus log.
extern crate chrono;
extern crate colored;
pub use super::ffi::janus_log_level as JANUS_LOG_LEVEL;
use self::chrono::{DateTime, Local};
use self::colored::{Color, Colorize};
use super::ffi;
use chrono::{DateTime, Local};
use colored::{Color, Colorize};
use janus_plugin_sys as ffi;
use std::ffi::CString;
use std::fmt::Write;
use std::fmt;
@ -136,7 +133,7 @@ macro_rules! janus_dbg {
mod tests {
use super::*;
use super::chrono::TimeZone;
use chrono::TimeZone;
fn fixed_clock(year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32) -> DateTime<Local> {
Local.ymd(year, month, day).and_hms(hour, min, sec)

Просмотреть файл

@ -1,5 +1,4 @@
/// Utilities to work with Jansson JSON values, which are exposed in the Janus plugin API.
extern crate libc;
use jansson_sys;
use std::error::Error;
@ -9,7 +8,8 @@ use std::mem::MaybeUninit;
use std::ops::Deref;
use std::slice;
use std::str;
use utils::LibcString;
use crate::utils::LibcString;
use bitflags::bitflags;
/// A pointer to a raw Jansson value struct.
pub type RawJanssonValue = jansson_sys::json_t;

Просмотреть файл

@ -1,16 +1,11 @@
#![deny(missing_debug_implementations)]
#[macro_use]
extern crate bitflags;
extern crate jansson_sys;
extern crate janus_plugin_sys as ffi;
extern crate glib_sys as glib;
extern crate libc;
extern crate serde;
use janus_plugin_sys as ffi;
use glib_sys as glib;
use bitflags::bitflags;
pub use debug::LogLevel;
pub use debug::log;
pub use jansson::{JanssonDecodingFlags, JanssonEncodingFlags, JanssonValue, RawJanssonValue};
pub use crate::jansson::{JanssonDecodingFlags, JanssonEncodingFlags, JanssonValue, RawJanssonValue};
pub use session::SessionWrapper;
pub use ffi::events::janus_eventhandler as EventHandler;
pub use ffi::plugin::janus_callbacks as PluginCallbacks;

Просмотреть файл

@ -1,10 +1,10 @@
/// Utilities to write SDP offers and answers using Janus's SDP parsing machinery.
use super::ffi;
use super::glib;
use super::libc;
use super::serde::de::{self, Deserialize, Deserializer, Unexpected, Visitor};
use super::serde::ser::{Serialize, Serializer};
use janus_plugin_sys as ffi;
use glib_sys as glib;
use libc;
use serde::de::{self, Deserialize, Deserializer, Unexpected, Visitor};
use serde::ser::{Serialize, Serializer};
pub use ffi::sdp::janus_sdp_generate_answer as generate_answer;
pub use ffi::sdp::janus_sdp_generate_offer as generate_offer;
use std::collections::HashMap;
@ -13,7 +13,7 @@ use std::fmt;
use std::ffi::{CStr, CString};
use std::ops::Deref;
use std::str;
use utils::GLibString;
use crate::utils::GLibString;
pub type RawSdp = ffi::sdp::janus_sdp;
pub type RawMLine = ffi::sdp::janus_sdp_mline;

Просмотреть файл

@ -1,8 +1,8 @@
/// Wrapper types and helpers for working with the Janus FFI layer.
use super::glib;
use super::libc;
use super::serde::ser::{self, Serialize, Serializer};
use glib_sys as glib;
use libc;
use serde::ser::{self, Serialize, Serializer};
use std::error::Error;
use std::ffi::CStr;
use std::ops::Deref;