Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tool/terra] Full migrate to new terra #1608

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/agora_media_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,8 @@ class VideoFrame {
final Uint8List? pixelBuffer;

/// The meta information in the video frame. To use this parameter, please.
@JsonKey(name: 'metaInfo')
@VideoFrameMetaInfoConverter()
@JsonKey(name: 'metaInfo')
final VideoFrameMetaInfo? metaInfo;

/// @nodoc
Expand Down
46 changes: 23 additions & 23 deletions lib/src/agora_media_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,6 @@ abstract class MediaPlayer {
Future<void> selectMultiAudioTrack(
{required int playoutTrackIndex, required int publishTrackIndex});

/// Set media player options for providing technical previews or special customization features.
///
/// The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInString is that the value parameter of this method is of type Int, while the value of setPlayerOptionInString is of type String. These two methods cannot be used together. Ensure that you call this method before open or openWithMediaSource.
///
/// * [key] The key of the option.
/// * [value] The value of the key.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> setPlayerOptionInInt({required String key, required int value});

/// Set media player options for providing technical previews or special customization features.
///
/// Ensure that you call this method before open or openWithMediaSource. The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInInt is that the value parameter of this method is of type String, while the value of setPlayerOptionInInt is of type String. These two methods cannot be used together.
///
/// * [key] The key of the option.
/// * [value] The value of the key.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> setPlayerOptionInString(
{required String key, required String value});

/// @nodoc
Future<void> takeScreenshot(String filename);

Expand Down Expand Up @@ -429,6 +406,29 @@ abstract class MediaPlayer {
/// @nodoc
Future<void> setSoundPositionParams(
{required double pan, required double gain});

/// Set media player options for providing technical previews or special customization features.
///
/// The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInString is that the value parameter of this method is of type Int, while the value of setPlayerOptionInString is of type String. These two methods cannot be used together. Ensure that you call this method before open or openWithMediaSource.
///
/// * [key] The key of the option.
/// * [value] The value of the key.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> setPlayerOptionInInt({required String key, required int value});

/// Set media player options for providing technical previews or special customization features.
///
/// Ensure that you call this method before open or openWithMediaSource. The media player supports setting options through key and value. In general, you don't need to know about the option settings. You can use the default option settings of the media player. The difference between this method and setPlayerOptionInInt is that the value parameter of this method is of type String, while the value of setPlayerOptionInInt is of type String. These two methods cannot be used together.
///
/// * [key] The key of the option.
/// * [value] The value of the key.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> setPlayerOptionInString(
{required String key, required String value});
}

/// This class provides methods to manage cached media files.
Expand Down
82 changes: 41 additions & 41 deletions lib/src/agora_rtc_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3343,18 +3343,6 @@ abstract class RtcEngine {
Future<void> startPreview(
{VideoSourceType sourceType = VideoSourceType.videoSourceCameraPrimary});

/// Enables the local video preview.
///
/// You can call this method to enable local video preview. Call this method after the following:
/// Call setupLocalVideo to initialize the local preview.
/// Call enableVideo to enable the video module.
/// The local preview enables the mirror mode by default.
/// After the local video preview is enabled, if you call leaveChannel to exit the channel, the local preview remains until you call stopPreview to disable it.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> startPreviewWithoutSourceType();

/// Stops the local video preview.
///
/// After calling startPreview to start the preview, if you want to close the local video preview, call this method. Call this method before joining a channel or after leaving a channel.
Expand Down Expand Up @@ -5413,23 +5401,6 @@ abstract class RtcEngine {
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> startScreenCapture(ScreenCaptureParameters2 captureParams);

/// Starts screen capture.
///
/// This method, as well as startScreenCapture, startScreenCaptureByDisplayId, and startScreenCaptureByWindowId, can all be used to start screen capture, with the following differences: startScreenCapture only applies to Android and iOS, whereas this method only applies to Windows and iOS. startScreenCaptureByDisplayId and startScreenCaptureByWindowId only support capturing video from a single screen or window. By calling this method and specifying the sourceType parameter, you can capture multiple video streams used for local video mixing or multi-channel publishing.
/// This method applies to the macOS and Windows only.
/// If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
///
/// * [sourceType] The type of the video source. See VideoSourceType.
/// Windows supports up to four screen capture video streams.
/// macOS supports only one screen capture video stream. You can only set this parameter to videoSourceScreen (2).
/// * [config] The configuration of the captured screen. See ScreenCaptureConfiguration.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> startScreenCaptureBySourceType(
{required VideoSourceType sourceType,
required ScreenCaptureConfiguration config});

/// Updates the screen capturing parameters.
///
/// If the system audio is not captured when screen sharing is enabled, and then you want to update the parameter configuration and publish the system audio, you can refer to the following steps:
Expand Down Expand Up @@ -5469,18 +5440,6 @@ abstract class RtcEngine {
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> stopScreenCapture();

/// Stops screen capture.
///
/// After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
/// This method applies to the macOS and Windows only.
/// If you call startScreenCapture, startScreenCaptureByWindowId, or startScreenCaptureByDisplayId to start screen capure, Agora recommends that you call stopScreenCapture instead to stop the capture.
///
/// * [sourceType] The type of the video source. See VideoSourceType.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> stopScreenCaptureBySourceType(VideoSourceType sourceType);

/// Retrieves the call ID.
///
/// When a user joins a channel on a client, a callId is generated to identify the call from the client. Some methods, such as rate and complain, must be called after the call ends to submit feedback to the SDK. These methods require the callId parameter. Call this method after joining a channel.
Expand Down Expand Up @@ -6272,6 +6231,35 @@ abstract class RtcEngine {
/// true : The current device supports the specified feature. false : The current device does not support the specified feature.
Future<bool> isFeatureAvailableOnDevice(FeatureType type);

/// Starts screen capture.
///
/// This method, as well as startScreenCapture, startScreenCaptureByDisplayId, and startScreenCaptureByWindowId, can all be used to start screen capture, with the following differences: startScreenCapture only applies to Android and iOS, whereas this method only applies to Windows and iOS. startScreenCaptureByDisplayId and startScreenCaptureByWindowId only support capturing video from a single screen or window. By calling this method and specifying the sourceType parameter, you can capture multiple video streams used for local video mixing or multi-channel publishing.
/// This method applies to the macOS and Windows only.
/// If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
///
/// * [sourceType] The type of the video source. See VideoSourceType.
/// Windows supports up to four screen capture video streams.
/// macOS supports only one screen capture video stream. You can only set this parameter to videoSourceScreen (2).
/// * [config] The configuration of the captured screen. See ScreenCaptureConfiguration.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> startScreenCaptureBySourceType(
{required VideoSourceType sourceType,
required ScreenCaptureConfiguration config});

/// Stops screen capture.
///
/// After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
/// This method applies to the macOS and Windows only.
/// If you call startScreenCapture, startScreenCaptureByWindowId, or startScreenCaptureByDisplayId to start screen capure, Agora recommends that you call stopScreenCapture instead to stop the capture.
///
/// * [sourceType] The type of the video source. See VideoSourceType.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> stopScreenCaptureBySourceType(VideoSourceType sourceType);

/// Releases the RtcEngine instance.
///
/// This method releases all resources used by the Agora SDK. Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new RtcEngine instance.
Expand All @@ -6281,6 +6269,18 @@ abstract class RtcEngine {
/// * [sync] Whether the method is called synchronously: true : Synchronous call. false : Asynchronous call. Currently this method only supports synchronous calls. Do not set this parameter to this value.
Future<void> release({bool sync = false});

/// Enables the local video preview.
///
/// You can call this method to enable local video preview. Call this method after the following:
/// Call setupLocalVideo to initialize the local preview.
/// Call enableVideo to enable the video module.
/// The local preview enables the mirror mode by default.
/// After the local video preview is enabled, if you call leaveChannel to exit the channel, the local preview remains until you call stopPreview to disable it.
///
/// Returns
/// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly.
Future<void> startPreviewWithoutSourceType();

/// Gets the AudioDeviceManager object to manage audio devices.
///
/// Returns
Expand Down
5 changes: 4 additions & 1 deletion lib/src/binding/agora_base_event_impl.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/// GENERATED BY terra, DO NOT MODIFY BY HAND.

// ignore_for_file: public_member_api_docs, unused_local_variable, unused_import

import 'package:agora_rtc_engine/src/binding_forward_export.dart';
import 'package:agora_rtc_engine/src/binding/impl_forward_export.dart';
import 'package:iris_method_channel/iris_method_channel.dart';

class AudioEncodedFrameObserverWrapper implements EventLoopEventHandler {
const AudioEncodedFrameObserverWrapper(this.audioEncodedFrameObserver);

final AudioEncodedFrameObserver audioEncodedFrameObserver;

@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) {
Expand All @@ -19,6 +22,7 @@ class AudioEncodedFrameObserverWrapper implements EventLoopEventHandler {

@override
int get hashCode => audioEncodedFrameObserver.hashCode;

@override
bool handleEventInternal(
String eventName, String eventData, List<Uint8List> buffers) {
Expand Down Expand Up @@ -103,7 +107,6 @@ class AudioEncodedFrameObserverWrapper implements EventLoopEventHandler {
if (handleEventInternal(newEvent, eventData, buffers)) {
return true;
}

return false;
}
}
8 changes: 7 additions & 1 deletion lib/src/binding/agora_h265_transcoder_event_impl.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/// GENERATED BY terra, DO NOT MODIFY BY HAND.

// ignore_for_file: public_member_api_docs, unused_local_variable, unused_import

import 'package:agora_rtc_engine/src/binding_forward_export.dart';
import 'package:agora_rtc_engine/src/binding/impl_forward_export.dart';
import 'package:iris_method_channel/iris_method_channel.dart';

class H265TranscoderObserverWrapper implements EventLoopEventHandler {
const H265TranscoderObserverWrapper(this.h265TranscoderObserver);

final H265TranscoderObserver h265TranscoderObserver;

@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) {
Expand All @@ -19,6 +22,7 @@ class H265TranscoderObserverWrapper implements EventLoopEventHandler {

@override
int get hashCode => h265TranscoderObserver.hashCode;

@override
bool handleEventInternal(
String eventName, String eventData, List<Uint8List> buffers) {
Expand All @@ -35,6 +39,7 @@ class H265TranscoderObserverWrapper implements EventLoopEventHandler {
if (result == null) {
return true;
}

h265TranscoderObserver.onEnableTranscode!(result);
return true;

Expand All @@ -54,6 +59,7 @@ class H265TranscoderObserverWrapper implements EventLoopEventHandler {
transcodeChannel == null) {
return true;
}

h265TranscoderObserver.onQueryChannel!(
result, originChannel, transcodeChannel);
return true;
Expand All @@ -70,6 +76,7 @@ class H265TranscoderObserverWrapper implements EventLoopEventHandler {
if (result == null) {
return true;
}

h265TranscoderObserver.onTriggerTranscode!(result);
return true;
}
Expand All @@ -84,7 +91,6 @@ class H265TranscoderObserverWrapper implements EventLoopEventHandler {
if (handleEventInternal(newEvent, eventData, buffers)) {
return true;
}

return false;
}
}
29 changes: 15 additions & 14 deletions lib/src/binding/agora_h265_transcoder_impl.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// GENERATED BY terra, DO NOT MODIFY BY HAND.

// ignore_for_file: public_member_api_docs, unused_local_variable, unused_import, annotate_overrides

import 'package:agora_rtc_engine/src/binding_forward_export.dart';
import 'package:agora_rtc_engine/src/binding/impl_forward_export.dart';
import 'package:iris_method_channel/iris_method_channel.dart';
Expand Down Expand Up @@ -85,35 +86,35 @@ class H265TranscoderImpl implements H265Transcoder {

@override
void registerTranscoderObserver(H265TranscoderObserver observer) {
// Implementation template
// Implementation template
// final apiType = '${isOverrideClassName ? className : 'H265Transcoder'}_registerTranscoderObserver_e1ee996';
// final param = createParams({// 'observer':observer// });
// final callApiResult = irisMethodChannel.invokeMethod(IrisMethodCall(apiType, jsonEncode(param), buffers:null));
// final param = createParams({
// 'observer': observer
// });
// final callApiResult = await irisMethodChannel.invokeMethod(IrisMethodCall(apiType, jsonEncode(param), buffers:null));
// if (callApiResult.irisReturnCode < 0) {
// throw AgoraRtcException(code: callApiResult.irisReturnCode);
// throw AgoraRtcException(code: callApiResult.irisReturnCode);
// }
// final rm = callApiResult.data;
// final result = rm['result'];
// if (result < 0) {
// throw AgoraRtcException(code: result);
// }
// if (result < 0) { throw AgoraRtcException(code: result); }
throw UnimplementedError('Unimplement for registerTranscoderObserver');
}

@override
void unregisterTranscoderObserver(H265TranscoderObserver observer) {
// Implementation template
// Implementation template
// final apiType = '${isOverrideClassName ? className : 'H265Transcoder'}_unregisterTranscoderObserver_e1ee996';
// final param = createParams({// 'observer':observer// });
// final callApiResult = irisMethodChannel.invokeMethod(IrisMethodCall(apiType, jsonEncode(param), buffers:null));
// final param = createParams({
// 'observer': observer
// });
// final callApiResult = await irisMethodChannel.invokeMethod(IrisMethodCall(apiType, jsonEncode(param), buffers:null));
// if (callApiResult.irisReturnCode < 0) {
// throw AgoraRtcException(code: callApiResult.irisReturnCode);
// throw AgoraRtcException(code: callApiResult.irisReturnCode);
// }
// final rm = callApiResult.data;
// final result = rm['result'];
// if (result < 0) {
// throw AgoraRtcException(code: result);
// }
// if (result < 0) { throw AgoraRtcException(code: result); }
throw UnimplementedError('Unimplement for unregisterTranscoderObserver');
}
}
Loading
Loading