-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[video_player] Windows Support #5884
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
Conversation
stuartmorgan-g
left a comment
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.
Very exciting!
I started to review but ran out of time for today after a few high level notes. Publishing those now so they don't have to wait for the rest of the review, but I'll try to do the real review ASAP since I'd love to see Windows support for video_player landed.
packages/video_player/video_player_windows/pigeons/messages.dart
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/windows/CMakeLists.txt
Outdated
Show resolved
Hide resolved
0f6b79c to
a2aa91b
Compare
|
When I updated to 16.0.0 of Pigeon, found a bug: flutter/flutter#141499 |
Thanks, that should probably be an easy fix. FYI we're generally moving away from |
|
@stuartmorgan I have no idea why the tests are timing out. They are working fine locally. |
tarrinneal
left a comment
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.
Just a little nit from me.
I think this generally looks great! I also don't have a lot of experience with c++ so I can't speak to best practices there.
packages/video_player/video_player_windows/pigeons/messages.dart
Outdated
Show resolved
Hide resolved
We have an ongoing problem in our Windows CI where some kinds of failures (even compile failures in at least some cases) somehow cause the CI to think something is still running and then they time out without much output, which unfortunately makes identifying the cause of a CI failure difficult. I'll try running the tests on my machine later today and see if I see any failures locally. |
stuartmorgan-g
left a comment
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.
I did a fairly high-level review, mostly about style guide notes, test structure, exceptions, Pigeon boundary. I haven't reviewed the specifics of the video implementation; I'll leave that to @cbracken since he'll most need to be familiar with it.
I haven't had a chance to play with it on my Windows machine yet, but I'm very much looking forward to seeing it in action :)
packages/video_player/video_player_windows/windows/video_player.h
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/windows/video_player.h
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/windows/video_player.h
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/test/windows_video_player_test.dart
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/test/windows_video_player_test.dart
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/windows/video_player_plugin.cpp
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_windows/lib/src/windows_video_player.dart
Outdated
Show resolved
Hide resolved
|
Went through most of the comments and fixed most of the issues. |
Looks like this is the And then also |
Running this under the debugger, in one case I saw an assertion failure in But the actual crash seems to be an abort coming from deep in the Flutter engine on the raster thread. I don't have a debug engine on Windows so I don't have more detail. Given that it's resize, I'm guessing that the most likely situation is that a buffer is being destroyed while the engine is still using it. |
|
I created a generic RunOnMainThread method, that adds a delegate to a queue, registers a top-level Window Proc Delegate, which dequeues the delegate and run it. This solved these issues, but I think other plugins might benefit from this, as there is an equivalent in Android and iOS. |
flutter/flutter#134346 has some related discussion; we've considered, rejected, and now are reconsidering building that into the plugin APIs. Your input there would be welcome as a significant stakeholder :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Hello, I've found an issue with video_player_windows. It throws an error when playing a locally stored video file with a filename containing Chinese characters. The error log is as follows: |
|
@FZY456 You've only included the stack there, not the actual error. |
|
|
From triage: What's the current status of this PR? Is it just waiting for an updated review? |
|
No, review is probably still updated, but there is work on my end. I just didn't have time to do yet. My bad. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
From triage: @azchohfi Is this still something you're planning to come back to? |
|
Unfortunately, I do not have time right now to look at this. I would say that most of the code works but it needs some tweaking to make it production ready. Feel free to work on top of this to get it merged. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
As there isn't a planned timeline to finish this PR, I'm going to go ahead and close it to reflect the fact that it's not active. The issue has been marked as having a partial PR, and we encourage anyone in the community interested in this functionality to pick up the work from here. |
|
For whoever willing to take the work from here, some observations on choppiness: If you run the example app and switch to "Asset" tab, the butterfly video will start playing in a very choppy manner. Try making the window smaller by re-sizing it slowly and at some threshold the video starts playing smoothly. On my machine, when the VideoPlayer size was 607.2 x 341.55 the video was playing smoothly and when the size was 608 x 342 the video became very choppy. You can try it yourself by wrapping the LayoutBuilder(
builder: (context, constraints) {
print('VideoPlayer size: ${constraints.maxWidth} x ${constraints.maxHeight}');
return VideoPlayer(_controller);
},
), |
Creates a video_player_windows package that uses Windows' Media Foundation APIs to deliver a decent video player on windows.
Fixes: flutter/flutter#37673
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).