This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backed out changeset 9e968a4d00bc (bug 1553011) for gtest crashes. CL…
…OSED TREE
- Loading branch information
Showing
62 changed files
with
2,865 additions
and
5,044 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
[package] | ||
name = "webrtc-sdp" | ||
name = "rsdparsa" | ||
version = "0.1.0" | ||
authors = ["Nils Ohlmeier <github@ohlmeier.org>"] | ||
description = "This create parses strings in the format of the Session Description Protocol according to RFC4566. It specifically supports the subset of features required to support WebRTC according to the JSEP draft." | ||
homepage = "https://github.com/nils-ohlmeier/rsdparsa" | ||
readme = "README.md" | ||
keywords = ["webrtc", "sdp", "jsep"] | ||
categories = ["parsing", "network-programming"] | ||
license = "MPL-2.0" | ||
|
||
[badges] | ||
travis-ci = { repository = "nils-ohlmeier/rsdparsa", branch = "master" } | ||
codecov = { repository = "nils-ohlmeier/rsdparsa", branch = "master", service = "github" } | ||
|
||
[features] | ||
default = [] | ||
# serializability | ||
serialize = ["serde", "serde_derive"] | ||
|
||
[dependencies] | ||
log = {version = "0.4.6"} | ||
# clippy = {version = "*", optional = true} | ||
log = "0.4" | ||
serde = {version = "1.0" , optional = true} | ||
serde_derive = {version = "1.0" , optional = true} | ||
|
||
[dev-dependencies] | ||
serde_json = {version = "1.0"} | ||
# serde_json = {version = "1.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,13 @@ | ||
# webrtc-sdp | ||
# rsdparsa | ||
|
||
[](https://crates.io/crates/webrtc-sdp) | ||
[](https://travis-ci.org/nils-ohlmeier/rsdparsa) | ||
[](https://codecov.io/gh/nils-ohlmeier/rsdparsa) | ||
[](#License) | ||
[](https://deps.rs/repo/github/nils-ohlmeier/rsdparsa) | ||
|
||
A SDP parser written in Rust specifically aimed to handle WebRTC SDP offers and answers. | ||
A SDP parser written in Rust specifically aimed for WebRTC | ||
|
||
## Dependecies | ||
|
||
* Rust >= 1.30.0 | ||
* log module | ||
* serde module | ||
* serde-derive module | ||
|
||
Cargo installs the missing modules automatically when building webrtc-sdp for the first time. | ||
|
||
## The webrtc-sdp API | ||
|
||
The main function is: | ||
``` | ||
fn parse_sdp(sdp: &str, fail_on_warning: bool) -> Result<SdpSession, SdpParserError> | ||
``` | ||
The `sdp` parameter is the string which will get parsed. The `fail_on_warning` parameter determines how to treat warnings encountered during parsing. Any problems encountered during are stored until the whole string has been parsed. Any problem during parsing falls into two catgeories: | ||
|
||
* Fatal error preventing further parsing or processing of the SDP | ||
* Warning which don't block further processing of the SDP | ||
|
||
Warnings will be for example unknown parameters in attributes. Setting `fail_on_warning` to `true` makes most sense during development, when you want to be aware of all potential problems. In production `fail_on_warning` is expected to be `false`. | ||
|
||
`parse_sdp()` returns either an `SdpSession` struct ([code](https://github.com/nils-ohlmeier/rsdparsa/blob/master/src/lib.rs#L137)) which contains all the parsed information. Or in case a fatal error was encountered (or if `fail_on_warning` was set to `true` and any warnings were encountered) an `SdpParserError` ([code](https://github.com/nils-ohlmeier/rsdparsa/blob/master/src/error.rs#L117)) will be returned as a `Result`. | ||
|
||
## Examples | ||
|
||
The [file parser](https://github.com/nils-ohlmeier/rsdparsa/blob/master/examples/file_parser.rs) in the webrtc-sdp package gives you an easy example of how to invoke the webrtc-sdp parser. | ||
|
||
## Contributing | ||
|
||
As the Travis CI runs are checking for code formating and clippy warnings please run the following commands locally, before submitting a Pull Request. | ||
|
||
If you haven't clippy and Rust format installed already you add them like this: | ||
``` | ||
rustup component add rustfmt-preview | ||
rustup component add clippy | ||
``` | ||
|
||
Check with clippy for warnings in the code: | ||
``` | ||
cargo clippy --all-targets --all-features | ||
``` | ||
|
||
And format all of the code according to Rust code style convention: | ||
``` | ||
cargo fmt --all | ||
``` | ||
Requires minimum Rust 1.17 | ||
|
||
## License | ||
|
||
Licensed under [MPL-2.0](https://www.mozilla.org/MPL/2.0/) | ||
Licensed under [MPL](https://www.mozilla.org/MPL/2.0/). |
Oops, something went wrong.