-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
Merge pull request from flutter/engine
- Add Success and Error handler for EventSink. - Send Event message or error using MethodCodec.
- Add GLFWPixelBuffer to manage Texture buffer copy. - Remove unnecessary offscreen context in ExternalTextureGL. - Create GL_TEXTURE_2D Texture using the height and width of GLFWPixelBuffer.
@chinmaygarde @stuartmorgan |
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.
A few initial high-level comments.
@@ -0,0 +1,116 @@ | |||
// Copyright 2013 The Flutter Authors. All rights reserved. |
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.
Please split event channel support out into a separate precursor PR to keep the scope smaller.
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.
Ok, I will submit event_channel.h in another PR.
|
||
namespace flutter { | ||
|
||
template <typename T> |
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.
Most of the things in this file need declaration comments, per Google's C++ style guide.
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.
This applies to all of the class declarations, method declarations, and typedefs in this PR, not just this file.
I would expect that to be a separate target, rather than part of the GLFW target; I'm not sure why it was done that way in the Fuchsia build. Also, adding that may require changes to the license script, as I remember that at least parts of |
Probably I got it wrong, I see engine/DEPS just checkout glfw source from Fuchsia, but compile it with buildroot/build/secondary/third_party/glfw/BUILD.gn. |
That's what would be needed, yes, but my comment was to suggest that we should have a separate target for that, not fold it into the primary GLFW target as was done in the file you linked to. Please test licenses locally before sending the buildroot patch though, so that it doesn't end up being something that prevents buildroot rolls and needs to be reverted (since the problem won't show up in CI until the PR that tries to roll buildroot forward). |
- Add comments to related classes. - Remove std::shared_ptr<> for PixelBuffer. - Optimize texture rendering code.
f724359
to
7796843
Compare
da077a6
to
8b6234f
Compare
8b6234f
to
4c5f065
Compare
Fixed a few bugs and tested under Linux. |
I'm trying to run this pull request. I've been able to render a texture to screen by indirectly triggering If I call
it's worth noticing that Is there something I'm missing? Is there a way to call Thank you so much (I'm also doing some modifications on the engine to render with arbitrary opengl calls, I guess it's going to be very useful for the community) |
Any embedder.h API that doesn't explicitly say otherwise must be called from the same thread as the engine was created on; that includes this one.
If you have a use case where you are doing things on another thread, it's your responsibility to dispatch the calls to the correct thread.
There are a variety of ways to pass information between threads; that's off-topic for this PR though.
I would encourage you to open a "Feature request" issue with your proposal for discussion before implementing a new feature in the engine. |
Thanks for the information. I spent the day thinking on how I could do that and couldn't end in a conclusion. It seems that my only option is to run I also checked @cloudwebrtc's demo of RTC app and there's no custom event loop at all: https://github.com/cloudwebrtc/flutter-webrtc-demo/blob/desktop/linux/flutter_webrtc_demo.cc so I wondered how it's done. I gone and found how |
Plugins don't intrinsically have their own threads, so it's not clear what you are asking here. They are constructed on, and receive method calls on, the same thread that is used for all other embedder API calls. |
I was analyzing how @cloudwebrtc's flutter-webrtc-demo does the Anyways, is my only option to use |
Again, how to write multi-threaded code using the GLFW embedding is off-topic for this PR; please find another forum for that conversation. The discussion here should be focused on the review of this PR and the process for getting it landed. |
@chinmaygarde if you get a moment, would you mind taking a look? |
@stuartmorgan Updated, please review. :) |
I'll do a full review of the changes when I get a chance, but this still need a review from @chinmaygarde. |
Appreciate if I can get hint to play mp4 file for Linux or Windows Desktop. |
@venkata-subbarao As I said above: "The discussion here should be focused on the review of this PR and the process for getting it landed." This isn't the right place to ask for help using this API; please use a support forum for that.
This PR is no longer relevant to Windows. |
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 small things left from me.
Still needs a review from @chinmaygarde on the texture aspects.
// |height| and |width| parameters of bounds. | ||
// In some cases, we need to scale the texture to the bounds size to reduce | ||
// memory usage. | ||
virtual const PixelBuffer* CopyPixelBuffer(size_t width, size_t height) = 0; |
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.
This still needs to be addressed.
This comment has been minimized.
This comment has been minimized.
Polite ping to have a look again. It looks like the pixel buffer pointer has been documented by @cloudwebrtc |
@winwisely99 As I said above, this needs a review from @chinmaygarde. Further review from me before then isn't going to advance this. |
Totally sympathetic to crazy times right now, but It would be great if @chinmaygarde was able to provide an update on their review as it seems there has been no immediate action and this pull is becoming stale. If those conversations are happening elsewhere than I apologize. |
@chinmaygarde Kindly update |
Now that both Windows and Linux have switched away from GLFW, I'm going to close this; while we still build the GLFW embedding for limited internal use, implementing this would no longer affect any of the embeddings used by the @cloudwebrtc, if you are still interested in implementing this for GLFW for some reason despite that, please comment and I'll re-open, but the way to move forward to support a project like your plugin would be texture support for the Windows (Win32) and Linux (GTK) embeddings. |
@stuartmorgan I don't get it. Wasn't the goal to be independent from the GUI API? So both Qt, GTK, etc would work? Now GTK is chosen to be the default/official for linux then? I thought GLFW was the right way as it would work with all of them, even had some modifications that could do YUV420P conversion in shader, I was about to finish it |
This is covered (as it has always been) in the desktop documentation
GLFW didn't work with any of them; neither add-to-app nor |
@stuartmorgan what's the way forward for bringing texture support to windows? |
@peerwaya I'm not sure what you're asking, but if you have technical questions about how to implement it the right place would be flutter/flutter#38601, not here. |
PR for flutter/flutter#30718.
II tested RGB rendering under windows, tried window scaling, and the video showed everything is fine. But it seems that we need to add glad support to
third_party/glfw/BULLD.gn
.Screenshot (Windows 10/ Ubuntu 16.04)