Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flutter-webrtc/dart-sdp-transform
A simple parser/writer for the Session Description Protocol
https://github.com/flutter-webrtc/dart-sdp-transform
dart flutter json sdp
Last synced: 1 day ago
JSON representation
A simple parser/writer for the Session Description Protocol
- Host: GitHub
- URL: https://github.com/flutter-webrtc/dart-sdp-transform
- Owner: flutter-webrtc
- License: mit
- Created: 2018-11-03T14:12:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-04T13:54:17.000Z (about 3 years ago)
- Last Synced: 2024-06-20T00:28:55.261Z (5 months ago)
- Topics: dart, flutter, json, sdp
- Language: Dart
- Size: 50.8 KB
- Stars: 16
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sdp-transform
[![pub package](https://img.shields.io/pub/v/sdp_transform.svg)](https://pub.dartlang.org/packages/sdp_transform) [![Gitter](https://badges.gitter.im/flutter-webrtc/Lobby.svg)](https://gitter.im/flutter-webrtc/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)Dart version of the [sdp-transform](https://github.com/clux/sdp-transform) JavaScript library.
dart-sdp-transform is a simple parser and writer of SDP. Defines internal grammar based on RFC4566 - SDP, RFC5245 - ICE, and many more.
## Usage
```dart
import 'dart:io';
import 'dart:convert';
import 'package:sdp_transform/sdp_transform.dart';main() {
new File('./test/ssrc.sdp').readAsString().then((String contents) {
print('original sdp => ' + contents);
var session = parse(contents);
print('convert to json => ' + json.encode(session));var params = parseParams(session['media'][1]['fmtp'][0]['config']);
print('params => ' + params.toString());var payloads = parsePayloads(session['media'][1]["payloads"]);
print('payloads => ' + payloads.toString());String imageAttributesStr = "[x=1280,y=720] [x=320,y=180]";
var imageAttributes = parseImageAttributes(imageAttributesStr);
print('imageAttributes => ' + imageAttributes.toString());// // a=simulcast:send 1,~4;2;3 recv c
String simulcastAttributesStr = "1,~4;2;3";
var simulcastAttributes = parseSimulcastStreamList(simulcastAttributesStr);
print('simulcastAttributes => ' + simulcastAttributes.toString());var sdp = write(session, null);
print('convert to sdp => ' + sdp);
});
}```