sdp_transform 0.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 42

sdp-transform #

pub package [![Join the chat at https://gitter.im/flutter-webrtc/Lobby](https://badges.gitter.im/flutter-webrtc/Lobby.svg)](https://gitter.im/flutter-webrtc/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Dart version of the 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 #


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);
  });
}

Changelog #


[0.0.1] - 2019.01.19

  • Initial release.

[0.1.0] - 2019.01.20

  • Implement parser, writer and some functions and pass the test.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sdp_transform: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sdp_transform/sdp_transform.dart';
  
Version Uploaded Documentation Archive
0.1.0 Jan 20, 2019 Go to the documentation of sdp_transform 0.1.0 Download sdp_transform 0.1.0 archive
0.0.1 Jan 19, 2019 Go to the documentation of sdp_transform 0.0.1 Download sdp_transform 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13+1

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:sdp_transform/sdp_transform.dart.

Health issues and suggestions

Document public APIs. (-1 points)

17 out of 17 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/grammar.dart. (-5.36 points)

Analysis of lib/src/grammar.dart reported 11 hints, including:

line 90 col 17: The type of the function literal can't be inferred because the literal has a block as its body.

line 115 col 17: The type of the function literal can't be inferred because the literal has a block as its body.

line 131 col 17: The type of the function literal can't be inferred because the literal has a block as its body.

line 141 col 17: The type of the function literal can't be inferred because the literal has a block as its body.

line 153 col 17: The type of the function literal can't be inferred because the literal has a block as its body.

Format lib/src/parser.dart.

Run dartfmt to format lib/src/parser.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and sdp_transform.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK <3.0.0