From d49057af76f50369e6b4a2bcd3168f24f1e28279 Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Tue, 27 Dec 2022 14:18:17 +0800 Subject: [PATCH] feat: [windows] Support render mode and mirror mode for AgoraVideoView with flutter texture rendering --- lib/src/impl/agora_video_view_impl.dart | 10 - .../agora_video_view_render_test.dart | 427 ++++++++++++++++-- ....texture.local.donot_handle_rendermode.png | Bin 0 -> 1599 bytes ....texture.local.with_default_rendermode.png | Bin 0 -> 1585 bytes ...endermode.with_videomirrormodedisabled.png | Bin 0 -> 1582 bytes ...texture.local.with_rendermodeadaptive.png} | Bin 1560 -> 1591 bytes ...ender.texture.local.with_rendermodefit.png | Bin 0 -> 1600 bytes ...er.texture.local.with_rendermodehidden.png | Bin 0 -> 1585 bytes ...texture.remote.donot_handle_rendermode.png | Bin 0 -> 1616 bytes ...agora_video_view_render.texture.remote.png | Bin 1566 -> 0 bytes ...texture.remote.with_default_rendermode.png | Bin 0 -> 1616 bytes ...ndermodede.with_videoMirrorModeEnabled.png | Bin 0 -> 1617 bytes ...texture.remote.with_rendermodeadaptive.png | Bin 0 -> 1634 bytes ...nder.texture.remote.with_rendermodefit.png | Bin 0 -> 1668 bytes ...r.texture.remote.with_rendermodehidden.png | Bin 0 -> 1643 bytes .../include/agora_rtc_engine/texture_render.h | 1 + windows/texture_render.cc | 10 + 17 files changed, 391 insertions(+), 57 deletions(-) create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.donot_handle_rendermode.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_default_rendermode.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_default_rendermode.with_videomirrormodedisabled.png rename test_shard/rendering_test/screenshot/{windows.agora_video_view_render.texture.local.png => windows.agora_video_view_render.texture.local.with_rendermodeadaptive.png} (60%) create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodefit.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodehidden.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.donot_handle_rendermode.png delete mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermode.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermodede.with_videoMirrorModeEnabled.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodeadaptive.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodefit.png create mode 100644 test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodehidden.png diff --git a/lib/src/impl/agora_video_view_impl.dart b/lib/src/impl/agora_video_view_impl.dart index 96433d656..6047cddd4 100644 --- a/lib/src/impl/agora_video_view_impl.dart +++ b/lib/src/impl/agora_video_view_impl.dart @@ -181,11 +181,6 @@ class _AgoraRtcRenderTextureState extends State @override void maybeCreateChannel(int viewId, String viewType) { - if (!(defaultTargetPlatform == TargetPlatform.macOS || - defaultTargetPlatform == TargetPlatform.iOS)) { - return; - } - // Only handle render mode on macos at this time final textureId = widget.controller.getTextureId(); methodChannel = MethodChannel('agora_rtc_engine/texture_render_$textureId'); @@ -257,11 +252,6 @@ class _AgoraRtcRenderTextureState extends State @override Widget build(BuildContext context) { if (widget.controller.getTextureId() != kTextureNotInit) { - if (!(defaultTargetPlatform == TargetPlatform.macOS || - defaultTargetPlatform == TargetPlatform.iOS)) { - return buildTexure(widget.controller.getTextureId()); - } - // Only handle render mode on macos at this time if (_height != 0 && _width != 0) { Widget result = buildTexure(widget.controller.getTextureId()); diff --git a/test_shard/rendering_test/integration_test/agora_video_view_render_test.dart b/test_shard/rendering_test/integration_test/agora_video_view_render_test.dart index f2d19902b..89a2d2dce 100644 --- a/test_shard/rendering_test/integration_test/agora_video_view_render_test.dart +++ b/test_shard/rendering_test/integration_test/agora_video_view_render_test.dart @@ -1001,66 +1001,399 @@ void main() { ); group( - 'AgoraVideoView Windows', + 'AgoraVideoView Windows screenshot test', () { - testWidgets( - 'local rendering screenshot test', - (WidgetTester tester) async { - final onFrameCompleter = Completer(); - late RtcEngineEx rtcEngine; + group('local rendering', () { + testWidgets( + 'do not handle render mode', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; - await tester.pumpWidget(LocalVideoView( - useFlutterTexture: true, - onRendered: (RtcEngineEx engine) async { - if (onFrameCompleter.isCompleted) { - return; - } + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + isRenderModeTest: false, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } - rtcEngine = engine; - onFrameCompleter.complete(); - }, - )); + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); - await tester.pumpAndSettle(const Duration(seconds: 10)); + await tester.pumpAndSettle(const Duration(seconds: 10)); - await onFrameCompleter.future; - await tester.pumpAndSettle(const Duration(seconds: 10)); + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); - await matchScreenShotDesktop( - rtcEngine, 'windows.agora_video_view_render.texture.local'); + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.donot_handle_rendermode'); - await waitDisposed(tester, binding); - }, - ); + await waitDisposed(tester, binding); + }, + ); - testWidgets( - 'remote rendering screenshot test', - (WidgetTester tester) async { - final onFrameCompleter = Completer(); - late RtcEngineEx rtcEngine; + testWidgets( + 'render mode default', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; - await tester.pumpWidget(RemoteVideoView( - useFlutterTexture: true, - onRendered: (RtcEngineEx engine) async { - if (onFrameCompleter.isCompleted) { - return; - } - rtcEngine = engine; - onFrameCompleter.complete(); - }, - )); + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } - await tester.pumpAndSettle(const Duration(seconds: 10)); + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); - await onFrameCompleter.future; - await tester.pumpAndSettle(const Duration(seconds: 10)); + await tester.pumpAndSettle(const Duration(seconds: 10)); - await matchScreenShotDesktop( - rtcEngine, 'windows.agora_video_view_render.texture.remote'); + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); - await waitDisposed(tester, binding); - }, - ); + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.with_default_rendermode'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeHidden', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeHidden, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.with_rendermodehidden'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeFit', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeFit, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.with_rendermodefit'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeAdaptive', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeAdaptive, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.with_rendermodeadaptive'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode default and videoMirrorModeDisabled', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(LocalVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + mirrorModeType: VideoMirrorModeType.videoMirrorModeDisabled, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.local.with_default_rendermode.with_videomirrormodedisabled'); + + await waitDisposed(tester, binding); + }, + ); + }); + + group('remote rendering', () { + testWidgets( + 'do not handle render mode', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + isRenderModeTest: false, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.donot_handle_rendermode'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode default', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.with_default_rendermode'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeHidden', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeHidden, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.with_rendermodehidden'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeFit', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeFit, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.with_rendermodefit'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode renderModeAdaptive', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + renderModeType: RenderModeType.renderModeAdaptive, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.with_rendermodeadaptive'); + + await waitDisposed(tester, binding); + }, + ); + + testWidgets( + 'render mode default and videoMirrorModeDisabled', + (WidgetTester tester) async { + final onFrameCompleter = Completer(); + late RtcEngineEx rtcEngine; + + await tester.pumpWidget(RemoteVideoView( + useFlutterTexture: true, + url: + 'https://download.agora.io/demo/test/agoravideoview_rendering_test_solid_spilt_asymmetrical.mp4', + mirrorModeType: VideoMirrorModeType.videoMirrorModeEnabled, + onRendered: (RtcEngineEx engine) async { + if (onFrameCompleter.isCompleted) { + return; + } + rtcEngine = engine; + onFrameCompleter.complete(); + }, + )); + + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await onFrameCompleter.future; + await tester.pumpAndSettle(const Duration(seconds: 10)); + + await matchScreenShotDesktop(rtcEngine, + 'windows.agora_video_view_render.texture.remote.with_default_rendermodede.with_videoMirrorModeEnabled'); + + await waitDisposed(tester, binding); + }, + ); + }); }, skip: !Platform.isWindows, ); diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.donot_handle_rendermode.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.donot_handle_rendermode.png new file mode 100644 index 0000000000000000000000000000000000000000..7e26121bac0754c728fed0e1fe8bc842a5eae6f4 GIT binary patch literal 1599 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P^tJY5_^Dj45hHS}^0WN^8t zpy_hto|n!Wrp&c2+n+1t#P&}(lp7IYXR_A!!0F@Shb=cZzI<2pW-Y^m>DM;%Gkmb; zZ`5#oavf-%RW|X0vaKTPQLeTD0x<+c(@Y2FGU9HVP{#FsLvw zIZ%T-wCLUX`DyV#9zOb%v-RJPIkk^9YR=jnI4LL~_Vv#Xqu+=4&C8#!UcLSMP4m8{ zh7Bf+j0%DR3_?Sn68rk0${HBLJ%1B4sT7vb7&)})n8ap%hI$tV1`igNhEZy`1;IW> YRVlf(EZZ*`0xJdvPgg&ebxsLQ0Axs1O8@`> literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_default_rendermode.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_default_rendermode.png new file mode 100644 index 0000000000000000000000000000000000000000..f4f8940d71d31d56dea11bb0f1f671016cd3b594 GIT binary patch literal 1585 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#LW8c)B=-R4~51y3zMAgNSS3 zWR|WkCL9qhUA+=reUTCk(eD%l|LX7FmHp4dP_XRoC1!>Qbw)-7 zK>-G#QED^@@TCH^(qDh#st#q%ZCjmqC+7UGUaciAfd*Yow@AD1y!UAfgzrXGI(h^!7 rQN=LF(SgB(g{8q|lp1D1P{-K9DV=Cp6nGO@6)O0ap*|#NzBK>< literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodeadaptive.png similarity index 60% rename from test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.png rename to test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodeadaptive.png index b3f91c17846ed006722995805eb65a524bd620e5..9084de1a6374519907c530ba782f3b7e34317120 100644 GIT binary patch delta 201 zcmV;)05<=a47UuBBs=~|L_t(|0qxZ>E<{lPK+!)85xq_*l@_40B8yVmiWR6>f>0QK zLZO+`%}m~yoU?-4-R1ma0)RhSj-E+2{PZz8W6jO|#pnd~h_e9$AOVvQ14bpVQLBTmX<95sXY7ReV4hZo ztI-*-H3q^)oju%+PS`1zqXS@zvoQqG0h3S!2NvWTYjYlOwM>i)00000NkvXXu0mjf DYb;z3 delta 166 zcmV;X09pUH444d%Bs$+oL_t(|0qxbXNkdTpK+$LTO_20fZeg350?r^#kO5pkce1c@ z1u?GR<>A9{&IGr++t-f)0Kc@Yv0p3#Evk?A&(#T2-HrX~gsFD-x2qGlA_l@#Pp6mF z2~$0fht&zw+adiUlN3($hpaGMh1UMGt0+|C7 UH)bU_5&!@I07*qoM6N<$g2bpw=l}o! diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodefit.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.local.with_rendermodefit.png new file mode 100644 index 0000000000000000000000000000000000000000..7388f8906416d162f2cc3bc9ad75d258b2391d9a GIT binary patch literal 1600 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P^tJzX3_Dj45hRrGQRWN^4B zn8SAPftU_+u&GqcZ0U^>>H3#_@*G_RY8D+-hd7rAC7QPbx?Z+b_CKD2wk;Y#Z(< W{<-TLcM(`KFnGH9xvXeD%l|LX7FmHp4dP_XRoC1!>Qbw)-7 zK>-G#QED^@@TCH^(qDh#st#q%ZCjmqC+7UGUaciAfd*Yow@AD1y!UAfgzrXGI(h^!7 rQN=LF(SgB(g{8q|lp1D1P{-K9DV=Cp6nGO@6)-YZ>|9EzP&%7udT~@R+{x_?ci^Gho>vtb_ z{T}~zUfbW#i4y(1Gmp9Y=U)1G`0XwI4T?-m4oV6PDx(zbg5XTnoU-nB^N$tI*!Rp; zpRrz9;Y`-ApPOF%JN(-)NI(7XkIL+rFIUuJ*ZgIet)y_~)w6$9Z^aw(N26t!rc8O2 XiON}Gr@Y#MH3fsGtDnm{r-UW|6%0F3 literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.png deleted file mode 100644 index dc0c5675bdf2f036ee11aeb11c4319a61bfef6c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1566 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#LWedb&7e}C2X=iRIfd0Xb%GBo^F zQD9JEVscO#rAC7QPbxSRV1IxAW_6ye@nt~r>xVxU)lAw-3OuD1)@SD#TuA#F5x1_K z_uO>zd3N#X=M!96SQ=a$7(7NPng@Zzs~=zOs+m6ckA^kP!+Jmx^b>w1cVQc8vEvQE Pa-YG|)z4*}Q$iB}$Ym5l diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermode.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermode.png new file mode 100644 index 0000000000000000000000000000000000000000..1f715c20115eb6a47238ff182d1897d4db3cc69e GIT binary patch literal 1616 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P^ZJzX3_Dj45hHT1i~Am9*K zttfOUtbjq~QUMoNp6mJA9iDlDQdwJ^G!mvYS)H2REBbnG)~cB=|Gm6@k%8g=i;}nO z3_t8SIT$({7$$IxQlmkDClwg1KK%Z=>-YZ>|9EzP&%7udT~@R+{x_?ci^Gho>vtb_ z{T}~zUfbW#i4y(1Gmp9Y=U)1G`0XwI4T?-m4oV6PDx(zbg5XTnoU-nB^N$tI*!Rp; zpRrz9;Y`-ApPOF%JN(-)NI(7XkIL+rFIUuJ*ZgIet)y_~)w6$9Z^aw(N26t!rc8O2 XiON}Gr@Y#MH3fsGtDnm{r-UW|6%0F3 literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermodede.with_videoMirrorModeEnabled.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_default_rendermodede.with_videoMirrorModeEnabled.png new file mode 100644 index 0000000000000000000000000000000000000000..bc2b51a948e0e04fa10b933d70dc6b953ebf53ee GIT binary patch literal 1617 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P?jJY5_^Dj45h-RQ~c$l!YM zZhuF|#)+M3*Af!^#gZh$k_FkODQGmkSaqWz?whgByx;?8k`s2YzmHdA__4V8A~VAc zHAY4SK>-G#QED^@@TG#Vum677R2@pIee>*P?)msnKi(9qfBtzt2gmBFT|4D%6N{gv z&YD&^E6%TPd3*omz4uCM%lBRX{4<_~rNPC4!DE!7T@XZEHL5z`R=fYU(fP}J-njWU z#tRFCeJv_9sXFxR%xQmzdHd((-Q3$Zk9ohE!kSlazGZ!B@!c(B%ka-(G-8Hl+O%Vw Y6{l2x&e<#!SXD51y85}Sb4q9e0QjIHJpcdz literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodeadaptive.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodeadaptive.png new file mode 100644 index 0000000000000000000000000000000000000000..f1daa31d91723e4259ff44442b6736b33321bc5b GIT binary patch literal 1634 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P?zJzX3_Dj45hHOvz+WM~V_ zH*(SpTCzlum3R4qCw^b!dEXiJiDkH=Qk`EC-^zUzG7AM+#HZ#E;t{>+)S z3=Q>@8yF^Va4>X^QlmkDFBR;r`cX5-_Td?$dB?t9&ivN1|In_vPydyD;bP0l+XkKf=MrU literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodefit.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodefit.png new file mode 100644 index 0000000000000000000000000000000000000000..b47d155ae7f371f37bc095eefd0968887539f7c4 GIT binary patch literal 1668 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P^RJzX3_Dj471uGze_s@? zI8A&EwFZB@O1TaS?83{ F1ORi?CTaix literal 0 HcmV?d00001 diff --git a/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodehidden.png b/test_shard/rendering_test/screenshot/windows.agora_video_view_render.texture.remote.with_rendermodehidden.png new file mode 100644 index 0000000000000000000000000000000000000000..599f0b9ac3b3b7825d139e43b0252925471938ba GIT binary patch literal 1643 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#P@$JY5_^Dj45hHS7{`6lr+4 z>gGik9+Prs{lqQXKe63AHoJn`w}&OrG4_^YxZ#!gnX@zZ_b==Airf3f{@y$uh9BO? z*NQVdFyiE3=xkt^z%fdV1_7Q_P!J{`UmsWcZ|~1inY`(t_it=o{hB>`{eeCXj`Xju ze$Ebk9xs2tul>DUPimjxdn+UU;;ZK0pIkgWdu@1vI}1yLivxoPnA)N7`TG0q!Z%tP z3L>A`)Y_j~D8E6Mkx@ZVfI(=KqE-+*JfxF+=IQT`pLg{fUM79;zn6o>>cf-uSD*V| zQs4LV?^R8u;xmQUCu%CxzxsHMdxJL9p-9{6k0q}~8|vXP1&y##3YK(-cu4GHjMq^v Vnb#t^A6SVnc)I$ztaD0e0swxcY2*L^ literal 0 HcmV?d00001 diff --git a/windows/include/agora_rtc_engine/texture_render.h b/windows/include/agora_rtc_engine/texture_render.h index d2d590482..6f2836c2f 100644 --- a/windows/include/agora_rtc_engine/texture_render.h +++ b/windows/include/agora_rtc_engine/texture_render.h @@ -40,6 +40,7 @@ class TextureRender : public agora::iris::IrisVideoFrameBufferDelegate flutter::TextureRegistrar *registrar_; agora::iris::IrisVideoFrameBufferManager *videoFrameBufferManager_; flutter::TextureVariant texture_; + std::unique_ptr> method_channel_; int64_t texture_id_ = -1; // std::unique_ptr> channel_; // unsigned int uid_; diff --git a/windows/texture_render.cc b/windows/texture_render.cc index 44e0d2522..a8c4bca5a 100644 --- a/windows/texture_render.cc +++ b/windows/texture_render.cc @@ -21,6 +21,11 @@ TextureRender::TextureRender(flutter::BinaryMessenger *messenger, pixel_buffer_(new FlutterDesktopPixelBuffer{nullptr, 0, 0}) { texture_id_ = registrar_->RegisterTexture(&texture_); + + method_channel_ = std::make_unique>( + messenger, + "agora_rtc_engine/texture_render_" + std::to_string(texture_id_), + &flutter::StandardMethodCodec::GetInstance()); } TextureRender::~TextureRender() @@ -43,6 +48,11 @@ void TextureRender::OnVideoFrameReceived(const IrisVideoFrame &video_frame, delete[] pixel_buffer_->buffer; } pixel_buffer_->buffer = new uint8_t[video_frame.y_buffer_length]; + + flutter::EncodableMap args = { + {EncodableValue("width"), EncodableValue(video_frame.width)}, + {EncodableValue("height"), EncodableValue(video_frame.height)}}; + method_channel_->InvokeMethod("onSizeChanged", std::make_unique(EncodableValue(args))); } memcpy((void *)pixel_buffer_->buffer, video_frame.y_buffer, video_frame.y_buffer_length);