From 8d5fdf17b1b69a47a157325d2261ecee84841347 Mon Sep 17 00:00:00 2001 From: Xiaowei Guan Date: Wed, 30 Sep 2026 13:29:16 +0800 Subject: [PATCH 1/2] Update pigeon to 29.0.4 --- packages/video_player/CHANGELOG.md | 3 +- packages/video_player/README.md | 2 +- packages/video_player/lib/src/messages.g.dart | 400 ++++++------ packages/video_player/pubspec.yaml | 5 +- packages/video_player/tizen/project_def.prop | 7 + packages/video_player/tizen/src/messages.cc | 574 +++++++++++++++++- packages/video_player/tizen/src/messages.h | 127 +++- 7 files changed, 858 insertions(+), 260 deletions(-) diff --git a/packages/video_player/CHANGELOG.md b/packages/video_player/CHANGELOG.md index 50c75bbbb..8570a4902 100644 --- a/packages/video_player/CHANGELOG.md +++ b/packages/video_player/CHANGELOG.md @@ -1,7 +1,8 @@ -## NEXT +## 2.5.16 * Omit obvious local variable types. * Reformat with a line length of 100. +* Update pigeon to 29.0.4. ## 2.5.15 diff --git a/packages/video_player/README.md b/packages/video_player/README.md index 3ba09a67d..19a1363cf 100644 --- a/packages/video_player/README.md +++ b/packages/video_player/README.md @@ -15,7 +15,7 @@ This package is not an _endorsed_ implementation of `video_player`. Therefore, y ```yaml dependencies: video_player: ^2.14.0 - video_player_tizen: ^2.5.15 + video_player_tizen: ^2.5.16 ``` Then you can import `video_player` in your Dart code: diff --git a/packages/video_player/lib/src/messages.g.dart b/packages/video_player/lib/src/messages.g.dart index 11a7b417e..c9227c611 100644 --- a/packages/video_player/lib/src/messages.g.dart +++ b/packages/video_player/lib/src/messages.g.dart @@ -1,36 +1,100 @@ -// Autogenerated from Pigeon (v25.5.0), do not edit directly. +// Autogenerated from Pigeon (v29.0.4), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; - -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; + +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && - a.entries.every( - (MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key]), - ); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class TextureMessage { TextureMessage({required this.textureId}); @@ -58,12 +122,17 @@ class TextureMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(textureId, other.textureId); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'TextureMessage(textureId: $textureId)'; + } } class LoopingMessage { @@ -95,12 +164,17 @@ class LoopingMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(textureId, other.textureId) && _deepEquals(isLooping, other.isLooping); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'LoopingMessage(textureId: $textureId, isLooping: $isLooping)'; + } } class VolumeMessage { @@ -132,12 +206,17 @@ class VolumeMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(textureId, other.textureId) && _deepEquals(volume, other.volume); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'VolumeMessage(textureId: $textureId, volume: $volume)'; + } } class PlaybackSpeedMessage { @@ -169,12 +248,17 @@ class PlaybackSpeedMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(textureId, other.textureId) && _deepEquals(speed, other.speed); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'PlaybackSpeedMessage(textureId: $textureId, speed: $speed)'; + } } class PositionMessage { @@ -206,12 +290,17 @@ class PositionMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(textureId, other.textureId) && _deepEquals(position, other.position); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'PositionMessage(textureId: $textureId, position: $position)'; + } } class CreateMessage { @@ -248,7 +337,7 @@ class CreateMessage { uri: result[1] as String?, packageName: result[2] as String?, formatHint: result[3] as String?, - httpHeaders: (result[4] as Map?)!.cast(), + httpHeaders: (result[4]! as Map).cast(), ); } @@ -261,12 +350,21 @@ class CreateMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(asset, other.asset) && + _deepEquals(uri, other.uri) && + _deepEquals(packageName, other.packageName) && + _deepEquals(formatHint, other.formatHint) && + _deepEquals(httpHeaders, other.httpHeaders); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'CreateMessage(asset: $asset, uri: $uri, packageName: $packageName, formatHint: $formatHint, httpHeaders: $httpHeaders)'; + } } class MixWithOthersMessage { @@ -296,12 +394,17 @@ class MixWithOthersMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(mixWithOthers, other.mixWithOthers); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()); + int get hashCode => _deepHash([runtimeType, ..._toList()]); + + @override + String toString() { + return 'MixWithOthersMessage(mixWithOthers: $mixWithOthers)'; + } } class _PigeonCodec extends StandardMessageCodec { @@ -361,280 +464,181 @@ class _PigeonCodec extends StandardMessageCodec { } class TizenVideoPlayerApi { - /// Constructor for [TizenVideoPlayerApi]. The [binaryMessenger] named argument is - /// available for dependency injection. If it is left null, the default + /// Constructor for [TizenVideoPlayerApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. TizenVideoPlayerApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : pigeonVar_binaryMessenger = binaryMessenger, pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? pigeonVar_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); final String pigeonVar_messageChannelSuffix; Future initialize() async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.initialize$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future create(CreateMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.create$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as TextureMessage?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as TextureMessage; } Future dispose(TextureMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.dispose$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future setLooping(LoopingMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.setLooping$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future setVolume(VolumeMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.setVolume$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future setPlaybackSpeed(PlaybackSpeedMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.setPlaybackSpeed$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future play(TextureMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.play$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future position(TextureMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.position$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as PositionMessage?)!; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ); + return pigeonVar_replyValue! as PositionMessage; } Future seekTo(PositionMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.seekTo$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future pause(TextureMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.pause$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } Future setMixWithOthers(MixWithOthersMessage msg) async { - final String pigeonVar_channelName = + final pigeonVar_channelName = 'dev.flutter.pigeon.video_player_tizen.TizenVideoPlayerApi.setMixWithOthers$pigeonVar_messageChannelSuffix'; - final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + final pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([msg]); - final List? pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + final pigeonVar_replyList = await pigeonVar_sendFuture as List?; + + _extractReplyValueOrThrow(pigeonVar_replyList, pigeonVar_channelName, isNullValid: true); } } diff --git a/packages/video_player/pubspec.yaml b/packages/video_player/pubspec.yaml index a8c43c422..b800b6f76 100644 --- a/packages/video_player/pubspec.yaml +++ b/packages/video_player/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_tizen description: Tizen implementation of the video_player plugin. homepage: https://github.com/flutter-tizen/plugins repository: https://github.com/flutter-tizen/plugins/tree/main/packages/video_player -version: 2.5.15 +version: 2.5.16 environment: sdk: ^3.12.0 @@ -20,7 +20,8 @@ flutter: dependencies: flutter: sdk: flutter + meta: ^1.8.0 video_player_platform_interface: ^6.9.0 dev_dependencies: - pigeon: ^25.5.0 + pigeon: ^29.0.4 diff --git a/packages/video_player/tizen/project_def.prop b/packages/video_player/tizen/project_def.prop index fb232a89d..05cfd1722 100644 --- a/packages/video_player/tizen/project_def.prop +++ b/packages/video_player/tizen/project_def.prop @@ -19,6 +19,13 @@ USER_INC_DIRS = inc src USER_INC_FILES = USER_CPP_INC_FILES = +# User compiler options +# Force-include a compatibility header that provides AsVariant(), a helper +# that casts flutter::EncodableValue to its base std::variant type so that +# std::visit in Pigeon-generated code (messages.cc) works with the Tizen SDK +# toolchain (libstdc++ older than GCC 11). +USER_CPP_OPTS += -include src/encodable_value_compat.h + # User libraries USER_LIB_DIRS += lib/${BUILD_ARCH} USER_LIBS += ftpw_video_player diff --git a/packages/video_player/tizen/src/messages.cc b/packages/video_player/tizen/src/messages.cc index 635b40827..ea79ee646 100644 --- a/packages/video_player/tizen/src/messages.cc +++ b/packages/video_player/tizen/src/messages.cc @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v25.5.0), do not edit directly. +// Autogenerated from Pigeon (v29.0.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -10,16 +10,19 @@ #include #include +#include +#include #include #include +#include #include namespace video_player_tizen { -using flutter::BasicMessageChannel; -using flutter::CustomEncodableValue; -using flutter::EncodableList; -using flutter::EncodableMap; -using flutter::EncodableValue; +using ::flutter::BasicMessageChannel; +using ::flutter::CustomEncodableValue; +using ::flutter::EncodableList; +using ::flutter::EncodableMap; +using ::flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { return FlutterError( @@ -28,6 +31,307 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +namespace { +template +bool PigeonInternalDeepEquals(const T& a, const T& b); + +bool PigeonInternalDeepEquals(const double& a, const double& b); + +template +bool PigeonInternalDeepEquals(const std::vector& a, const std::vector& b); + +template +bool PigeonInternalDeepEquals(const std::map& a, const std::map& b); + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b); + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b); + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b); + +template +bool PigeonInternalDeepEquals(const T& a, const T& b) { + return a == b; +} + +template +bool PigeonInternalDeepEquals(const std::vector& a, + const std::vector& b) { + if (a.size() != b.size()) { + return false; + } + for (size_t i = 0; i < a.size(); ++i) { + if (!PigeonInternalDeepEquals(a[i], b[i])) { + return false; + } + } + return true; +} + +template +bool PigeonInternalDeepEquals(const std::map& a, + const std::map& b) { + if (a.size() != b.size()) { + return false; + } + for (const auto& kv : a) { + bool found = false; + for (const auto& b_kv : b) { + if (PigeonInternalDeepEquals(kv.first, b_kv.first)) { + if (PigeonInternalDeepEquals(kv.second, b_kv.second)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; +} + +bool PigeonInternalDeepEquals(const double& a, const double& b) { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (a == b) || (std::isnan(a) && std::isnan(b)); +} + +template +bool PigeonInternalDeepEquals(const std::optional& a, + const std::optional& b) { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +template +bool PigeonInternalDeepEquals(const std::unique_ptr& a, + const std::unique_ptr& b) { + if (a.get() == b.get()) { + return true; + } + if (!a || !b) { + return false; + } + return PigeonInternalDeepEquals(*a, *b); +} + +bool PigeonInternalDeepEquals(const ::flutter::EncodableValue& a, + const ::flutter::EncodableValue& b) { + if (a.index() != b.index()) { + return false; + } + if (const double* da = std::get_if(&a)) { + return PigeonInternalDeepEquals(*da, std::get(b)); + } else if (const ::flutter::EncodableList* la = + std::get_if<::flutter::EncodableList>(&a)) { + return PigeonInternalDeepEquals(*la, std::get<::flutter::EncodableList>(b)); + } else if (const ::flutter::EncodableMap* ma = + std::get_if<::flutter::EncodableMap>(&a)) { + return PigeonInternalDeepEquals(*ma, std::get<::flutter::EncodableMap>(b)); + } + return a == b; +} + +template +size_t PigeonInternalDeepHash(const T& v); + +size_t PigeonInternalDeepHash(const double& v); + +template +size_t PigeonInternalDeepHash(const std::vector& v); + +template +size_t PigeonInternalDeepHash(const std::map& v); + +template +size_t PigeonInternalDeepHash(const std::optional& v); + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v); + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v); + +template +size_t PigeonInternalDeepHash(const T& v) { + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::vector& v) { + size_t result = 1; + for (const auto& item : v) { + result = result * 31 + PigeonInternalDeepHash(item); + } + return result; +} + +template +size_t PigeonInternalDeepHash(const std::map& v) { + size_t result = 0; + for (const auto& kv : v) { + result += ((PigeonInternalDeepHash(kv.first) * 31) ^ + PigeonInternalDeepHash(kv.second)); + } + return result; +} + +size_t PigeonInternalDeepHash(const double& v) { + if (std::isnan(v)) { + // Normalize NaN to a consistent hash. + return std::hash()(std::numeric_limits::quiet_NaN()); + } + if (v == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return std::hash()(0.0); + } + return std::hash()(v); +} + +template +size_t PigeonInternalDeepHash(const std::optional& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +template +size_t PigeonInternalDeepHash(const std::unique_ptr& v) { + return v ? PigeonInternalDeepHash(*v) : 0; +} + +size_t PigeonInternalDeepHash(const ::flutter::EncodableValue& v) { + size_t result = v.index(); + if (const double* dv = std::get_if(&v)) { + result = result * 31 + PigeonInternalDeepHash(*dv); + } else if (const ::flutter::EncodableList* lv = + std::get_if<::flutter::EncodableList>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*lv); + } else if (const ::flutter::EncodableMap* mv = + std::get_if<::flutter::EncodableMap>(&v)) { + result = result * 31 + PigeonInternalDeepHash(*mv); + } else { + std::visit( + [&result](const auto& val) { + using T = std::decay_t; + if constexpr (!std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v && + !std::is_same_v) { + result = result * 31 + PigeonInternalDeepHash(val); + } + }, + AsVariant(v)); + } + return result; +} + +template +std::string PigeonInternalToString(const T& v); + +std::string PigeonInternalToString(const bool& v); + +template +std::string PigeonInternalToString(const std::vector& v); + +template +std::string PigeonInternalToString(const std::map& v); + +template +std::string PigeonInternalToString(const std::optional& v); + +template +std::string PigeonInternalToString(const std::unique_ptr& v); + +std::string PigeonInternalToString(const ::flutter::EncodableValue& v); + +template +std::string PigeonInternalToString(const T& v) { + std::stringstream ss; + if constexpr (std::is_enum_v) { + ss << static_cast(v); + } else { + ss << v; + } + return ss.str(); +} + +std::string PigeonInternalToString(const bool& v) { + return v ? "true" : "false"; +} + +template +std::string PigeonInternalToString(const std::vector& v) { + std::stringstream ss; + ss << "["; + for (size_t i = 0; i < v.size(); ++i) { + if (i > 0) { + ss << ", "; + } + ss << PigeonInternalToString(v[i]); + } + ss << "]"; + return ss.str(); +} + +template +std::string PigeonInternalToString(const std::map& v) { + std::stringstream ss; + ss << "{"; + bool first = true; + for (const auto& kv : v) { + if (!first) { + ss << ", "; + } + first = false; + ss << PigeonInternalToString(kv.first) << ": " + << PigeonInternalToString(kv.second); + } + ss << "}"; + return ss.str(); +} + +template +std::string PigeonInternalToString(const std::optional& v) { + return v ? PigeonInternalToString(*v) : "null"; +} + +template +std::string PigeonInternalToString(const std::unique_ptr& v) { + return v ? PigeonInternalToString(*v) : "null"; +} + +std::string PigeonInternalToString(const ::flutter::EncodableValue& v) { + return std::visit( + [](const auto& val) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + return std::string("null"); + } else if constexpr (std::is_same_v) { + return val ? std::string("true") : std::string("false"); + } else if constexpr (std::is_same_v) { + return "\"" + val + "\""; + } else if constexpr (std::is_same_v) { + return std::string("[custom]"); + } else { + return PigeonInternalToString(val); + } + }, + AsVariant(v)); +} + +} // namespace // TextureMessage TextureMessage::TextureMessage(int64_t texture_id) : texture_id_(texture_id) {} @@ -50,6 +354,30 @@ TextureMessage TextureMessage::FromEncodableList(const EncodableList& list) { return decoded; } +bool TextureMessage::operator==(const TextureMessage& other) const { + return PigeonInternalDeepEquals(texture_id_, other.texture_id_); +} + +bool TextureMessage::operator!=(const TextureMessage& other) const { + return !(*this == other); +} + +size_t TextureMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(texture_id_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const TextureMessage& obj) { + os << "TextureMessage("; + os << "texture_id: "; + os << PigeonInternalToString(obj.texture_id_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const TextureMessage& v) { return v.Hash(); } + // LoopingMessage LoopingMessage::LoopingMessage(int64_t texture_id, bool is_looping) @@ -78,6 +406,34 @@ LoopingMessage LoopingMessage::FromEncodableList(const EncodableList& list) { return decoded; } +bool LoopingMessage::operator==(const LoopingMessage& other) const { + return PigeonInternalDeepEquals(texture_id_, other.texture_id_) && + PigeonInternalDeepEquals(is_looping_, other.is_looping_); +} + +bool LoopingMessage::operator!=(const LoopingMessage& other) const { + return !(*this == other); +} + +size_t LoopingMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(texture_id_); + result = result * 31 + PigeonInternalDeepHash(is_looping_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const LoopingMessage& obj) { + os << "LoopingMessage("; + os << "texture_id: "; + os << PigeonInternalToString(obj.texture_id_); + os << ", is_looping: "; + os << PigeonInternalToString(obj.is_looping_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const LoopingMessage& v) { return v.Hash(); } + // VolumeMessage VolumeMessage::VolumeMessage(int64_t texture_id, double volume) @@ -106,6 +462,34 @@ VolumeMessage VolumeMessage::FromEncodableList(const EncodableList& list) { return decoded; } +bool VolumeMessage::operator==(const VolumeMessage& other) const { + return PigeonInternalDeepEquals(texture_id_, other.texture_id_) && + PigeonInternalDeepEquals(volume_, other.volume_); +} + +bool VolumeMessage::operator!=(const VolumeMessage& other) const { + return !(*this == other); +} + +size_t VolumeMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(texture_id_); + result = result * 31 + PigeonInternalDeepHash(volume_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const VolumeMessage& obj) { + os << "VolumeMessage("; + os << "texture_id: "; + os << PigeonInternalToString(obj.texture_id_); + os << ", volume: "; + os << PigeonInternalToString(obj.volume_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const VolumeMessage& v) { return v.Hash(); } + // PlaybackSpeedMessage PlaybackSpeedMessage::PlaybackSpeedMessage(int64_t texture_id, double speed) @@ -136,6 +520,36 @@ PlaybackSpeedMessage PlaybackSpeedMessage::FromEncodableList( return decoded; } +bool PlaybackSpeedMessage::operator==(const PlaybackSpeedMessage& other) const { + return PigeonInternalDeepEquals(texture_id_, other.texture_id_) && + PigeonInternalDeepEquals(speed_, other.speed_); +} + +bool PlaybackSpeedMessage::operator!=(const PlaybackSpeedMessage& other) const { + return !(*this == other); +} + +size_t PlaybackSpeedMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(texture_id_); + result = result * 31 + PigeonInternalDeepHash(speed_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const PlaybackSpeedMessage& obj) { + os << "PlaybackSpeedMessage("; + os << "texture_id: "; + os << PigeonInternalToString(obj.texture_id_); + os << ", speed: "; + os << PigeonInternalToString(obj.speed_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const PlaybackSpeedMessage& v) { + return v.Hash(); +} + // PositionMessage PositionMessage::PositionMessage(int64_t texture_id, int64_t position) @@ -165,6 +579,34 @@ PositionMessage PositionMessage::FromEncodableList(const EncodableList& list) { return decoded; } +bool PositionMessage::operator==(const PositionMessage& other) const { + return PigeonInternalDeepEquals(texture_id_, other.texture_id_) && + PigeonInternalDeepEquals(position_, other.position_); +} + +bool PositionMessage::operator!=(const PositionMessage& other) const { + return !(*this == other); +} + +size_t PositionMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(texture_id_); + result = result * 31 + PigeonInternalDeepHash(position_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const PositionMessage& obj) { + os << "PositionMessage("; + os << "texture_id: "; + os << PigeonInternalToString(obj.texture_id_); + os << ", position: "; + os << PigeonInternalToString(obj.position_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const PositionMessage& v) { return v.Hash(); } + // CreateMessage CreateMessage::CreateMessage(const EncodableMap& http_headers) @@ -272,6 +714,62 @@ CreateMessage CreateMessage::FromEncodableList(const EncodableList& list) { return decoded; } +bool CreateMessage::operator==(const CreateMessage& other) const { + return PigeonInternalDeepEquals(asset_, other.asset_) && + PigeonInternalDeepEquals(uri_, other.uri_) && + PigeonInternalDeepEquals(package_name_, other.package_name_) && + PigeonInternalDeepEquals(format_hint_, other.format_hint_) && + PigeonInternalDeepEquals(http_headers_, other.http_headers_); +} + +bool CreateMessage::operator!=(const CreateMessage& other) const { + return !(*this == other); +} + +size_t CreateMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(asset_); + result = result * 31 + PigeonInternalDeepHash(uri_); + result = result * 31 + PigeonInternalDeepHash(package_name_); + result = result * 31 + PigeonInternalDeepHash(format_hint_); + result = result * 31 + PigeonInternalDeepHash(http_headers_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const CreateMessage& obj) { + os << "CreateMessage("; + os << "asset: "; + if (obj.asset_) { + os << PigeonInternalToString(*obj.asset_); + } else { + os << "null"; + } + os << ", uri: "; + if (obj.uri_) { + os << PigeonInternalToString(*obj.uri_); + } else { + os << "null"; + } + os << ", package_name: "; + if (obj.package_name_) { + os << PigeonInternalToString(*obj.package_name_); + } else { + os << "null"; + } + os << ", format_hint: "; + if (obj.format_hint_) { + os << PigeonInternalToString(*obj.format_hint_); + } else { + os << "null"; + } + os << ", http_headers: "; + os << PigeonInternalToString(obj.http_headers_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const CreateMessage& v) { return v.Hash(); } + // MixWithOthersMessage MixWithOthersMessage::MixWithOthersMessage(bool mix_with_others) @@ -296,10 +794,36 @@ MixWithOthersMessage MixWithOthersMessage::FromEncodableList( return decoded; } +bool MixWithOthersMessage::operator==(const MixWithOthersMessage& other) const { + return PigeonInternalDeepEquals(mix_with_others_, other.mix_with_others_); +} + +bool MixWithOthersMessage::operator!=(const MixWithOthersMessage& other) const { + return !(*this == other); +} + +size_t MixWithOthersMessage::Hash() const { + size_t result = 1; + result = result * 31 + PigeonInternalDeepHash(mix_with_others_); + return result; +} + +std::ostream& operator<<(std::ostream& os, const MixWithOthersMessage& obj) { + os << "MixWithOthersMessage("; + os << "mix_with_others: "; + os << PigeonInternalToString(obj.mix_with_others_); + os << ")"; + return os; +} + +size_t PigeonInternalDeepHash(const MixWithOthersMessage& v) { + return v.Hash(); +} + PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, ::flutter::ByteStreamReader* stream) const { switch (type) { case 129: { return CustomEncodableValue(TextureMessage::FromEncodableList( @@ -330,12 +854,12 @@ EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( std::get(ReadValue(stream)))); } default: - return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + return ::flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } void PigeonInternalCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + const EncodableValue& value, ::flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(TextureMessage)) { @@ -395,23 +919,23 @@ void PigeonInternalCodecSerializer::WriteValue( return; } } - flutter::StandardCodecSerializer::WriteValue(value, stream); + ::flutter::StandardCodecSerializer::WriteValue(value, stream); } /// The codec used by TizenVideoPlayerApi. -const flutter::StandardMessageCodec& TizenVideoPlayerApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( +const ::flutter::StandardMessageCodec& TizenVideoPlayerApi::GetCodec() { + return ::flutter::StandardMessageCodec::GetInstance( &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `TizenVideoPlayerApi` to handle messages through the // `binary_messenger`. -void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void TizenVideoPlayerApi::SetUp(::flutter::BinaryMessenger* binary_messenger, TizenVideoPlayerApi* api) { TizenVideoPlayerApi::SetUp(binary_messenger, api, ""); } -void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, +void TizenVideoPlayerApi::SetUp(::flutter::BinaryMessenger* binary_messenger, TizenVideoPlayerApi* api, const std::string& message_channel_suffix) { const std::string prepended_suffix = @@ -427,7 +951,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { std::optional output = api->Initialize(); if (output.has_value()) { @@ -454,7 +978,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -490,7 +1014,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -525,7 +1049,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -560,7 +1084,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -595,7 +1119,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -631,7 +1155,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -666,7 +1190,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -702,7 +1226,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -739,7 +1263,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); @@ -774,7 +1298,7 @@ void TizenVideoPlayerApi::SetUp(flutter::BinaryMessenger* binary_messenger, if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, - const flutter::MessageReply& reply) { + const ::flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_msg_arg = args.at(0); diff --git a/packages/video_player/tizen/src/messages.h b/packages/video_player/tizen/src/messages.h index 3f6859394..abfd8cee5 100644 --- a/packages/video_player/tizen/src/messages.h +++ b/packages/video_player/tizen/src/messages.h @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v25.5.0), do not edit directly. +// Autogenerated from Pigeon (v29.0.4), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_H_ @@ -10,6 +10,7 @@ #include #include +#include #include namespace video_player_tizen { @@ -22,17 +23,17 @@ class FlutterError { explicit FlutterError(const std::string& code, const std::string& message) : code_(code), message_(message) {} explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) + const ::flutter::EncodableValue& details) : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } - const flutter::EncodableValue& details() const { return details_; } + const ::flutter::EncodableValue& details() const { return details_; } private: std::string code_; std::string message_; - flutter::EncodableValue details_; + ::flutter::EncodableValue details_; }; template @@ -64,9 +65,17 @@ class TextureMessage { int64_t texture_id() const; void set_texture_id(int64_t value_arg); + bool operator==(const TextureMessage& other) const; + bool operator!=(const TextureMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, const TextureMessage& obj); + private: - static TextureMessage FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static TextureMessage FromEncodableList(const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; int64_t texture_id_; @@ -84,9 +93,17 @@ class LoopingMessage { bool is_looping() const; void set_is_looping(bool value_arg); + bool operator==(const LoopingMessage& other) const; + bool operator!=(const LoopingMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, const LoopingMessage& obj); + private: - static LoopingMessage FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static LoopingMessage FromEncodableList(const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; int64_t texture_id_; @@ -105,9 +122,17 @@ class VolumeMessage { double volume() const; void set_volume(double value_arg); + bool operator==(const VolumeMessage& other) const; + bool operator!=(const VolumeMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, const VolumeMessage& obj); + private: - static VolumeMessage FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static VolumeMessage FromEncodableList(const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; int64_t texture_id_; @@ -126,10 +151,19 @@ class PlaybackSpeedMessage { double speed() const; void set_speed(double value_arg); + bool operator==(const PlaybackSpeedMessage& other) const; + bool operator!=(const PlaybackSpeedMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, + const PlaybackSpeedMessage& obj); + private: static PlaybackSpeedMessage FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; int64_t texture_id_; @@ -148,9 +182,18 @@ class PositionMessage { int64_t position() const; void set_position(int64_t value_arg); + bool operator==(const PositionMessage& other) const; + bool operator!=(const PositionMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, const PositionMessage& obj); + private: - static PositionMessage FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static PositionMessage FromEncodableList( + const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; int64_t texture_id_; @@ -161,13 +204,13 @@ class PositionMessage { class CreateMessage { public: // Constructs an object setting all non-nullable fields. - explicit CreateMessage(const flutter::EncodableMap& http_headers); + explicit CreateMessage(const ::flutter::EncodableMap& http_headers); // Constructs an object setting all fields. explicit CreateMessage(const std::string* asset, const std::string* uri, const std::string* package_name, const std::string* format_hint, - const flutter::EncodableMap& http_headers); + const ::flutter::EncodableMap& http_headers); const std::string* asset() const; void set_asset(const std::string_view* value_arg); @@ -185,19 +228,27 @@ class CreateMessage { void set_format_hint(const std::string_view* value_arg); void set_format_hint(std::string_view value_arg); - const flutter::EncodableMap& http_headers() const; - void set_http_headers(const flutter::EncodableMap& value_arg); + const ::flutter::EncodableMap& http_headers() const; + void set_http_headers(const ::flutter::EncodableMap& value_arg); + + bool operator==(const CreateMessage& other) const; + bool operator!=(const CreateMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, const CreateMessage& obj); private: - static CreateMessage FromEncodableList(const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + static CreateMessage FromEncodableList(const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; std::optional asset_; std::optional uri_; std::optional package_name_; std::optional format_hint_; - flutter::EncodableMap http_headers_; + ::flutter::EncodableMap http_headers_; }; // Generated class from Pigeon that represents data sent in messages. @@ -209,16 +260,26 @@ class MixWithOthersMessage { bool mix_with_others() const; void set_mix_with_others(bool value_arg); + bool operator==(const MixWithOthersMessage& other) const; + bool operator!=(const MixWithOthersMessage& other) const; + /// Returns a hash code value for the object. This method is supported for the + /// benefit of hash tables. + size_t Hash() const; + /// Stream output operator for formatted string representation. + friend std::ostream& operator<<(std::ostream& os, + const MixWithOthersMessage& obj); + private: static MixWithOthersMessage FromEncodableList( - const flutter::EncodableList& list); - flutter::EncodableList ToEncodableList() const; + const ::flutter::EncodableList& list); + ::flutter::EncodableList ToEncodableList() const; friend class TizenVideoPlayerApi; friend class PigeonInternalCodecSerializer; bool mix_with_others_; }; -class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer + : public ::flutter::StandardCodecSerializer { public: PigeonInternalCodecSerializer(); inline static PigeonInternalCodecSerializer& GetInstance() { @@ -226,12 +287,12 @@ class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const ::flutter::EncodableValue& value, + ::flutter::ByteStreamWriter* stream) const override; protected: - flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + ::flutter::EncodableValue ReadValueOfType( + uint8_t type, ::flutter::ByteStreamReader* stream) const override; }; // Generated interface from Pigeon that represents a handler of messages from @@ -258,16 +319,16 @@ class TizenVideoPlayerApi { const MixWithOthersMessage& msg) = 0; // The codec used by TizenVideoPlayerApi. - static const flutter::StandardMessageCodec& GetCodec(); + static const ::flutter::StandardMessageCodec& GetCodec(); // Sets up an instance of `TizenVideoPlayerApi` to handle messages through the // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, TizenVideoPlayerApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, + static void SetUp(::flutter::BinaryMessenger* binary_messenger, TizenVideoPlayerApi* api, const std::string& message_channel_suffix); - static flutter::EncodableValue WrapError(std::string_view error_message); - static flutter::EncodableValue WrapError(const FlutterError& error); + static ::flutter::EncodableValue WrapError(std::string_view error_message); + static ::flutter::EncodableValue WrapError(const FlutterError& error); protected: TizenVideoPlayerApi() = default; From 22ac152ab5373fc5e42ff949eb38778c2434eef7 Mon Sep 17 00:00:00 2001 From: Xiaowei Guan Date: Wed, 30 Sep 2026 13:49:37 +0800 Subject: [PATCH 2/2] Add missing head file --- .../tizen/src/encodable_value_compat.h | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/video_player/tizen/src/encodable_value_compat.h diff --git a/packages/video_player/tizen/src/encodable_value_compat.h b/packages/video_player/tizen/src/encodable_value_compat.h new file mode 100644 index 000000000..893e97124 --- /dev/null +++ b/packages/video_player/tizen/src/encodable_value_compat.h @@ -0,0 +1,29 @@ +// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef VIDEO_PLAYER_TIZEN_ENCODABLE_VALUE_COMPAT_H_ +#define VIDEO_PLAYER_TIZEN_ENCODABLE_VALUE_COMPAT_H_ + +#include + +namespace video_player_tizen { + +// std::visit does not accept classes derived from std::variant (such as +// flutter::EncodableValue) with libstdc++ older than GCC 11, which the Tizen +// SDK toolchain ships (LLVM-10 clang++ with GCC 9.2 headers). Cast to the +// base variant type before visiting. +// +// This header is force-included into every translation unit via +// USER_CPP_OPTS in project_def.prop, so Pigeon-generated code (messages.cc) +// can call AsVariant() without including this header explicitly. Keep the +// generated-file patch minimal: only the two std::visit call sites in +// messages.cc need to wrap their argument with AsVariant(). +inline const ::flutter::internal::EncodableValueVariant& AsVariant( + const ::flutter::EncodableValue& value) { + return value; +} + +} // namespace video_player_tizen + +#endif // VIDEO_PLAYER_TIZEN_ENCODABLE_VALUE_COMPAT_H_