-
Notifications
You must be signed in to change notification settings - Fork 52
[flutter_webrtc_tizen]Upgrade flutter webrtc to 1.4.1 #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xiaowei-guan
wants to merge
14
commits into
flutter-tizen:master
Choose a base branch
from
xiaowei-guan:upgrade_webrtc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
efcf27b
Merge flutter-webrtc 1.3.0 code
xiaowei-guan 74cb2cf
Update libwebrtc lib files
xiaowei-guan 94edd72
Fix analyze issue
xiaowei-guan a5bb086
Implement Tizen TaskRunner
xiaowei-guan 39d451b
Update tizen task runner
xiaowei-guan 7558aa8
Bump version to 0.2.0
xiaowei-guan 8e96aac
Upgrade to m144
xiaowei-guan cdb26b3
code format
xiaowei-guan 5cc6e5c
Fix code review issue
xiaowei-guan 8ab0060
Fix code review issue
xiaowei-guan 465b318
Fix coredump issue
xiaowei-guan 8bb9e37
Update readme
xiaowei-guan 04bd337
Update example webrtc version
xiaowei-guan e37912b
Merge branch 'master' into upgrade_webrtc
xiaowei-guan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,8 +40,8 @@ For other Tizen devices : | |
|
|
||
| ```yaml | ||
| dependencies: | ||
| flutter_webrtc: ^0.9.46 | ||
| flutter_webrtc_tizen: ^0.1.3 | ||
| flutter_webrtc: ^1.3.1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| flutter_webrtc_tizen: ^0.2.0 | ||
| ``` | ||
|
|
||
| ## Functionality | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ | |
|
|
||
| #include <list> | ||
| #include <memory> | ||
| #include <mutex> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| #include <optional> | ||
| #include <queue> | ||
| #include <string> | ||
|
|
||
| typedef flutter::EncodableValue EncodableValue; | ||
|
|
@@ -26,6 +29,8 @@ typedef flutter::EventSink<EncodableValue> EventSink; | |
| typedef flutter::MethodCall<EncodableValue> MethodCall; | ||
| typedef flutter::MethodResult<EncodableValue> MethodResult; | ||
|
|
||
| class TaskRunner; | ||
|
|
||
| // foo.StringValue() becomes std::get<std::string>(foo) | ||
| // foo.IsString() becomes std::holds_alternative<std::string>(foo) | ||
|
|
||
|
|
@@ -88,6 +93,14 @@ inline double findDouble(const EncodableMap& map, const std::string& key) { | |
| return 0.0; | ||
| } | ||
|
|
||
| inline std::optional<double> maybeFindDouble(const EncodableMap& map, | ||
| const std::string& key) { | ||
| auto it = map.find(EncodableValue(key)); | ||
| if (it != map.end() && TypeIs<double>(it->second)) | ||
| return GetValue<double>(it->second); | ||
| return std::nullopt; | ||
| } | ||
|
xiaowei-guan marked this conversation as resolved.
|
||
|
|
||
| inline std::vector<uint8_t> findVector(const EncodableMap& map, | ||
| const std::string& key) { | ||
| auto it = map.find(EncodableValue(key)); | ||
|
|
@@ -161,7 +174,8 @@ class MethodResultProxy { | |
| class EventChannelProxy { | ||
| public: | ||
| static std::unique_ptr<EventChannelProxy> Create( | ||
| BinaryMessenger* messenger, const std::string& channelName); | ||
| BinaryMessenger* messenger, TaskRunner* task_runner, | ||
| const std::string& channelName); | ||
|
|
||
| virtual ~EventChannelProxy() = default; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/flutter_webrtc/tizen/inc/flutter_data_packet_cryptor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #ifndef FLUTTER_WEBRTC_RTC_DATA_PACKET_CRYPTOR_HXX | ||
| #define FLUTTER_WEBRTC_RTC_DATA_PACKET_CRYPTOR_HXX | ||
|
|
||
| #include "flutter_common.h" | ||
| #include "flutter_webrtc_base.h" | ||
| #include "rtc_data_packet_cryptor.h" | ||
|
|
||
| namespace flutter_webrtc_plugin { | ||
|
|
||
| class FlutterDataPacketCryptor { | ||
| public: | ||
| FlutterDataPacketCryptor(FlutterWebRTCBase* base) : base_(base) {} | ||
|
|
||
| bool HandleDataPacketCryptorMethodCall( | ||
| const MethodCallProxy& method_call, | ||
| std::unique_ptr<MethodResultProxy> result, | ||
| std::unique_ptr<MethodResultProxy>* outResult); | ||
|
|
||
| void CreateDataPacketCryptor(const EncodableMap& constraints, | ||
| std::unique_ptr<MethodResultProxy> result); | ||
|
|
||
| void DataPacketCryptorDispose(const EncodableMap& constraints, | ||
| std::unique_ptr<MethodResultProxy> result); | ||
|
|
||
| void DataPacketCryptorEncrypt(const EncodableMap& constraints, | ||
| std::unique_ptr<MethodResultProxy> result); | ||
|
|
||
| void DataPacketCryptorDecrypt(const EncodableMap& constraints, | ||
| std::unique_ptr<MethodResultProxy> result); | ||
|
|
||
| private: | ||
| FlutterWebRTCBase* base_; | ||
| std::map<std::string, scoped_refptr<libwebrtc::RTCDataPacketCryptor>> | ||
| data_packet_cryptors_; | ||
| }; | ||
|
|
||
| } // namespace flutter_webrtc_plugin | ||
|
|
||
| #endif // FLUTTER_WEBRTC_RTC_DATA_PACKET_CRYPTOR_HXX |
36 changes: 36 additions & 0 deletions
36
packages/flutter_webrtc/tizen/inc/flutter_frame_capturer.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #ifndef FLUTTER_WEBRTC_RTC_FRAME_CAPTURER_HXX | ||
| #define FLUTTER_WEBRTC_RTC_FRAME_CAPTURER_HXX | ||
|
|
||
| #include <mutex> | ||
|
|
||
| #include "flutter_common.h" | ||
| #include "flutter_webrtc_base.h" | ||
| #include "rtc_video_frame.h" | ||
| #include "rtc_video_renderer.h" | ||
|
|
||
| namespace flutter_webrtc_plugin { | ||
|
|
||
| using namespace libwebrtc; | ||
|
|
||
| class FlutterFrameCapturer | ||
| : public RTCVideoRenderer<scoped_refptr<RTCVideoFrame>> { | ||
| public: | ||
| FlutterFrameCapturer(RTCVideoTrack* track, std::string path); | ||
|
|
||
| virtual void OnFrame(scoped_refptr<RTCVideoFrame> frame) override; | ||
|
|
||
| void CaptureFrame(std::unique_ptr<MethodResultProxy> result); | ||
|
|
||
| private: | ||
| RTCVideoTrack* track_; | ||
| std::string path_; | ||
| std::mutex mutex_; | ||
| scoped_refptr<RTCVideoFrame> frame_; | ||
| volatile bool catch_frame_; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| bool SaveFrame(); | ||
| }; | ||
|
|
||
| } // namespace flutter_webrtc_plugin | ||
|
|
||
| #endif // !FLUTTER_WEBRTC_RTC_FRAME_CAPTURER_HXX | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef FLUTTER_WEBRTC_PLUGIN_FLUTTER_UTF8_SANITIZE_H_ | ||
| #define FLUTTER_WEBRTC_PLUGIN_FLUTTER_UTF8_SANITIZE_H_ | ||
|
|
||
| #include <string> | ||
|
|
||
| namespace flutter_webrtc_plugin { | ||
|
|
||
| // ADM/device buffers may not be valid UTF-8. Flutter StandardMessageCodec | ||
| // decodes as UTF-8; invalid bytes cause FormatException. Use before | ||
| // EncodableValue and when comparing ids from Dart. | ||
| std::string SanitizeUtf8ForFlutter(const std::string& input); | ||
|
|
||
| } // namespace flutter_webrtc_plugin | ||
|
|
||
| #endif // FLUTTER_WEBRTC_PLUGIN_FLUTTER_UTF8_SANITIZE_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a discrepancy between the version mentioned here (1.3.1) and the version mentioned in the PR title and example pubspecs (1.4.1). Please ensure the version is consistent across all files.