feat: (for now android only!) codec configuration and retrieval methods
This commit is contained in:
parent
32789468a3
commit
90733a3768
6 changed files with 117 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import 'liblinphone_flutter_platform_interface.dart';
|
|||
import 'models/call_stats.dart';
|
||||
import 'models/call_type.dart';
|
||||
import 'models/dscp_values.dart';
|
||||
import 'models/lp_codec.dart';
|
||||
|
||||
/// An implementation of [LiblinphoneFlutterPlatform] that uses method channels.
|
||||
class MethodChannelLiblinphoneFlutter extends LiblinphoneFlutterPlatform {
|
||||
|
|
@ -175,4 +176,22 @@ class MethodChannelLiblinphoneFlutter extends LiblinphoneFlutterPlatform {
|
|||
final values = CallStats.fromJson(data);
|
||||
return values;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<LPCodec>> getAvailableAudioCodecs() async {
|
||||
final data = (await methodChannel.invokeMethod<List<Map<dynamic, dynamic>>>(
|
||||
'getAvailableAudioCodecs',
|
||||
))!;
|
||||
|
||||
final values = data.map(LPCodec.fromJson).toList(growable: true);
|
||||
return values;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> setAudioCodec(String mime, int clockRate) async {
|
||||
return (await methodChannel.invokeMethod<bool>(
|
||||
'setAudioCodec',
|
||||
<String, dynamic>{'mime': mime, 'clockRate': clockRate},
|
||||
))!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue