Skip to content

Commit

Permalink
Merge branch 'main' into gxz/iris_web-0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Mar 8, 2024
2 parents 6981c8d + 5646230 commit e28de28
Show file tree
Hide file tree
Showing 60 changed files with 5,787 additions and 5,815 deletions.
2 changes: 1 addition & 1 deletion android/src/main/cpp/iris_rtc_rendering_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ class NativeTextureRenderer final
}
}

~NativeTextureRenderer() final { Dispose(); }
~NativeTextureRenderer() final {}

void OnVideoFrameReceived(const void *videoFrame,
const IrisRtcVideoFrameConfig &config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void releaseRef() {
class PlatformRenderPool {

private final Map<Integer, SimpleRef> renders = new HashMap<>();

SimpleRef createView(int platformViewId,
Context context,
AgoraPlatformViewFactory.PlatformViewProvider viewProvider) {
Expand Down Expand Up @@ -182,10 +183,8 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
case "createTextureRender": {
final Map<?, ?> args = (Map<?, ?>) call.arguments;

@SuppressWarnings("ConstantConditions")
final long irisRtcRenderingHandle = getLong(args.get("irisRtcRenderingHandle"));
@SuppressWarnings("ConstantConditions")
final long uid = getLong(args.get("uid"));
@SuppressWarnings("ConstantConditions") final long irisRtcRenderingHandle = getLong(args.get("irisRtcRenderingHandle"));
@SuppressWarnings("ConstantConditions") final long uid = getLong(args.get("uid"));
final String channelId = (String) args.get("channelId");
final int videoSourceType = (int) args.get("videoSourceType");
final int videoViewSetupMode = (int) args.get("videoViewSetupMode");
Expand All @@ -205,13 +204,25 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
result.success(success);
break;
}
case "dispose": {
disposeAllRenderers();
result.success(true);
break;
}
case "updateTextureRenderData":
default:
result.notImplemented();
break;
}
}

private void disposeAllRenderers() {
for (final TextureRenderer textureRenderer : textureRendererMap.values()) {
textureRenderer.dispose();
}
textureRendererMap.clear();
}

/**
* Flutter may convert a long to int type in java, we force parse a long value via this function
*/
Expand Down
6 changes: 0 additions & 6 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ dependencies:
permission_handler: ^10.2.0
path_provider: ^2.0.8

video_raw_data:
git:
url: https://github.com/AgoraIO-Extensions/RawDataPluginSample.git
path: frameworks/flutter/video_raw_data
ref: 51dde78706a015743a993368f25a06df7960378e

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
6 changes: 3 additions & 3 deletions lib/src/agora_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ class WatermarkOptions {
this.watermarkRatio,
this.mode});

/// Is the watermark visible in the local preview view? true : (Default) The watermark is visible in the local preview view. false : The watermark is not visible in the local preview view.
/// Whether the watermark is visible in the local preview view: true : (Default) The watermark is visible in the local preview view. false : The watermark is not visible in the local preview view.
@JsonKey(name: 'visibleInPreview')
final bool? visibleInPreview;

Expand Down Expand Up @@ -3578,7 +3578,7 @@ enum RtmpStreamPublishReason {
@JsonValue(15)
rtmpStreamPublishReasonInvalidAppid,

/// 16: Your project does not have permission to use streaming services. Refer to Media Push to enable the Media Push permission.
/// 16: Your project does not have permission to use streaming services.
@JsonValue(16)
rtmpStreamPublishReasonInvalidPrivilege,

Expand Down Expand Up @@ -5721,7 +5721,7 @@ enum ChannelMediaRelayError {
@JsonValue(1)
relayErrorServerErrorResponse,

/// 2: No server response. You can call leaveChannel to leave the channel. This error can also occur if your project has not enabled co-host token authentication. You can to enable the service for cohosting across channels before starting a channel media relay.
/// 2: No server response. This error may be caused by poor network connections. If this error occurs when initiating a channel media relay, you can try again later; if this error occurs during channel media relay, you can call leaveChannel to leave the channel. This error can also occur if the channel media relay service is not enabled in the project. You can contact to enable the service.
@JsonValue(2)
relayErrorServerNoResponse,

Expand Down
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
9 changes: 4 additions & 5 deletions lib/src/agora_media_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,12 @@ abstract class MediaEngine {

/// Pulls the remote audio data.
///
/// Before calling this method, you need to call setExternalAudioSink to notify the app to enable and set the external rendering. After a successful call of this method, the app pulls the decoded and mixed audio data for playback.
/// This method only supports pulling data from custom audio source. If you need to pull the data captured by the SDK, do not call this method.
/// Before calling this method, call setExternalAudioSink (enabled : true) to notify the app to enable and set the external audio rendering. After a successful call of this method, the app pulls the decoded and mixed audio data for playback.
/// Call this method after joining a channel.
/// Once you enable the external audio sink, the app will not retrieve any audio data from the onPlaybackAudioFrame callback.
/// The difference between this method and the onPlaybackAudioFrame callback is as follows:
/// Both this method and onPlaybackAudioFrame callback can be used to get audio data after remote mixing. Note that after calling setExternalAudioSink to enable external audio rendering, the app no longer receives data from the onPlaybackAudioFrame callback. Therefore, you should choose between this method and the onPlaybackAudioFrame callback based on your actual business requirements. The specific distinctions between them are as follows:
/// After calling this method, the app automatically pulls the audio data from the SDK. By setting the audio data parameters, the SDK adjusts the frame buffer to help the app handle latency, effectively avoiding audio playback jitter.
/// The SDK sends the audio data to the app through the onPlaybackAudioFrame callback. Any delay in processing the audio frames may result in audio jitter.
/// After a successful method call, the app automatically pulls the audio data from the SDK. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
/// This method is only used for retrieving audio data after remote mixing. If you need to get audio data from different audio processing stages such as capture and playback, you can register the corresponding callbacks by calling registerAudioFrameObserver.
///
/// * [frame] Pointers to AudioFrame.
///
Expand Down
51 changes: 30 additions & 21 deletions lib/src/agora_media_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,18 @@ abstract class MediaPlayer {
/// 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> selectAudioTrack(int index);

/// @nodoc
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.
/// Selects the audio tracks that you want to play on your local device and publish to the channel respectively.
///
/// 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.
/// You can call this method to determine the audio track to be played on your local device and published to the channel. Before calling this method, you need to open the media file with the openWithMediaSource method and set enableMultiAudioTrack in MediaSource as true.
///
/// * [key] The key of the option.
/// * [value] The value of the key.
/// * [playoutTrackIndex] The index of audio tracks for local playback. You can obtain the index through getStreamInfo.
/// * [publishTrackIndex] The index of audio tracks to be published in the channel. You can obtain the index through getStreamInfo.
///
/// 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});
/// < 0: Failure.
Future<void> selectMultiAudioTrack(
{required int playoutTrackIndex, required int publishTrackIndex});

/// @nodoc
Future<void> takeScreenshot(String filename);
Expand Down Expand Up @@ -420,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
Loading

0 comments on commit e28de28

Please sign in to comment.