-
Notifications
You must be signed in to change notification settings - Fork 19
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
Texture api change #86
Texture api change #86
Conversation
FIrst of all, Thanks !!! I love this patch! 👍 ❤️
But I don't know whether we can handle these difference... |
@xiaowei-guan |
|
ok. |
For this, you may see comments inside Texture_registrar.h,
If we make it common, maybe we can contribute it to community |
If this can be the starting point for contributing to flutter, I'll be absolutely happy. 😄 |
shell/platform/common/cpp/client_wrapper/core_implementations.cc
Outdated
Show resolved
Hide resolved
shell/platform/common/cpp/client_wrapper/include/flutter/texture_registrar.h
Outdated
Show resolved
Hide resolved
1.Delete tizen texture api, use common api, add GpuBufferTexture for gpu buffer. 2.Delete ref/unref tbm_surface code in engine, add destructioncall for delete tbm_surface. 3.Support pixel buffer texture.
@xiaowei-guan |
1.Get texture register flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrar>(registrar)->texture_registrar() 2.RegisterTexture textureVariant_ =
std::make_unique<flutter::TextureVariant>(flutter::GpuBufferTexture(
[this](size_t width,
size_t height) -> const FlutterDesktopGpuBuffer * {
this->CopyGpuBuffer(width, height);
},
[this]() -> void { this->Destruction(); }));
LOG_INFO("[VideoPlayer] register texture");
textureId_ = textureRegistrar->RegisterTexture(textureVariant_.get()); 3.MarkTextureFrameAvailable textureRegistrar_->MarkTextureFrameAvailable(player->textureId_); 4.UnregisterTexture textureRegistrar_->UnregisterTexture(textureId_); |
Thanks for quick response:exclamation: Well, please see if I understand it or not:
Is it correct what I understand? |
1.when we get packet from decoder,store the packet, and call MarkTextureFrameAvailable
3.when Flutter GL render finish , will trigger destruction_gpu_buffer_callback_ |
I have upload some code, it can work. |
Thanks! I'll check that code first! |
Thank you. I'll ask you one more thing
|
1.Implement GPU buffer texture. 2.Remove ref/unref tbm surface code.
I view the Engine code, I find we can call MarkTextureFrameAvailable multiple, It can be successful only once, during the rendering process of one frame . so : |
1.Use C++ style casts 2.Rename variable and function, make the code more friendly. 3.Add copyright info.
1.Rename static veriable(nextTextureId -> kNextTextureId) 2.Modify comment, make it more clear. 3.Rename function name(FlutterDesktopDestructionCallback)
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 think we can see the end of the long journey 👏
Overall, the texture-related code seems to be neat, so I love it.
Thanks for your hard working!
To complete this task, you gave a lot of useful suggestions, thank you very much~ |
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.
Are we going to submit the change related to the public API and client_wrapper to the upstream?
Yes, we want to try submit this change to upstream. |
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.
LGTM
This warning log shouldn't be displayed when launching a headless app.
* Add platfrom surface buffer structor * Texture api change(draft) 1.Delete tizen texture api, use common api, add GpuBufferTexture for gpu buffer. 2.Delete ref/unref tbm_surface code in engine, add destructioncall for delete tbm_surface. 3.Support pixel buffer texture. * Revert code to original * Support GPU buffer texture 1.Implement GPU buffer texture. 2.Remove ref/unref tbm surface code. * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL Class ExternamTextureSurfaceGL handle tbm surface texture render. * Remove not used code * Fix wild pointer issue If plugin call UnregisterTexture, then will remove external texture, But at this time, gpu render is not finish. when gpu render finished, tiggle destruction callback, need check whether external texture pointer is wild pointer * Convert unique_ptr to shared_ptr when create external texture * Code format * Fix arm64 build error * Remove not used file * Remove unnecessary headers * Refactor based on comments 1.Remove not used file. 2.Rename define of head file. 2.Rename of variable. * Refactor based on comments 1.Return nullptr for default case when create external texture. 2.Rename methode name from texture_registrar to GetTextureRegistrar. 3.Change OnCollectTextur to static function. * Fix code review issue 1.Use C++ style casts 2.Rename variable and function, make the code more friendly. 3.Add copyright info. * Fix code review issue 1.Rename static veriable(nextTextureId -> kNextTextureId) 2.Modify comment, make it more clear. 3.Rename function name(FlutterDesktopDestructionCallback) * Fix code review issue * Remove warning log This warning log shouldn't be displayed when launching a headless app.
* Add platfrom surface buffer structor * Texture api change(draft) 1.Delete tizen texture api, use common api, add GpuBufferTexture for gpu buffer. 2.Delete ref/unref tbm_surface code in engine, add destructioncall for delete tbm_surface. 3.Support pixel buffer texture. * Revert code to original * Support GPU buffer texture 1.Implement GPU buffer texture. 2.Remove ref/unref tbm surface code. * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL Class ExternamTextureSurfaceGL handle tbm surface texture render. * Remove not used code * Fix wild pointer issue If plugin call UnregisterTexture, then will remove external texture, But at this time, gpu render is not finish. when gpu render finished, tiggle destruction callback, need check whether external texture pointer is wild pointer * Convert unique_ptr to shared_ptr when create external texture * Code format * Fix arm64 build error * Remove not used file * Remove unnecessary headers * Refactor based on comments 1.Remove not used file. 2.Rename define of head file. 2.Rename of variable. * Refactor based on comments 1.Return nullptr for default case when create external texture. 2.Rename methode name from texture_registrar to GetTextureRegistrar. 3.Change OnCollectTextur to static function. * Fix code review issue 1.Use C++ style casts 2.Rename variable and function, make the code more friendly. 3.Add copyright info. * Fix code review issue 1.Rename static veriable(nextTextureId -> kNextTextureId) 2.Modify comment, make it more clear. 3.Rename function name(FlutterDesktopDestructionCallback) * Fix code review issue * Remove warning log This warning log shouldn't be displayed when launching a headless app.
* Add platfrom surface buffer structor * Texture api change(draft) 1.Delete tizen texture api, use common api, add GpuBufferTexture for gpu buffer. 2.Delete ref/unref tbm_surface code in engine, add destructioncall for delete tbm_surface. 3.Support pixel buffer texture. * Revert code to original * Support GPU buffer texture 1.Implement GPU buffer texture. 2.Remove ref/unref tbm surface code. * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL Class ExternamTextureSurfaceGL handle tbm surface texture render. * Remove not used code * Fix wild pointer issue If plugin call UnregisterTexture, then will remove external texture, But at this time, gpu render is not finish. when gpu render finished, tiggle destruction callback, need check whether external texture pointer is wild pointer * Convert unique_ptr to shared_ptr when create external texture * Code format * Fix arm64 build error * Remove not used file * Remove unnecessary headers * Refactor based on comments 1.Remove not used file. 2.Rename define of head file. 2.Rename of variable. * Refactor based on comments 1.Return nullptr for default case when create external texture. 2.Rename methode name from texture_registrar to GetTextureRegistrar. 3.Change OnCollectTextur to static function. * Fix code review issue 1.Use C++ style casts 2.Rename variable and function, make the code more friendly. 3.Add copyright info. * Fix code review issue 1.Rename static veriable(nextTextureId -> kNextTextureId) 2.Modify comment, make it more clear. 3.Rename function name(FlutterDesktopDestructionCallback) * Fix code review issue * Remove warning log This warning log shouldn't be displayed when launching a headless app.
* Add platfrom surface buffer structor * Texture api change(draft) 1.Delete tizen texture api, use common api, add GpuBufferTexture for gpu buffer. 2.Delete ref/unref tbm_surface code in engine, add destructioncall for delete tbm_surface. 3.Support pixel buffer texture. * Revert code to original * Support GPU buffer texture 1.Implement GPU buffer texture. 2.Remove ref/unref tbm surface code. * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL Class ExternamTextureSurfaceGL handle tbm surface texture render. * Remove not used code * Fix wild pointer issue If plugin call UnregisterTexture, then will remove external texture, But at this time, gpu render is not finish. when gpu render finished, tiggle destruction callback, need check whether external texture pointer is wild pointer * Convert unique_ptr to shared_ptr when create external texture * Code format * Fix arm64 build error * Remove not used file * Remove unnecessary headers * Refactor based on comments 1.Remove not used file. 2.Rename define of head file. 2.Rename of variable. * Refactor based on comments 1.Return nullptr for default case when create external texture. 2.Rename methode name from texture_registrar to GetTextureRegistrar. 3.Change OnCollectTextur to static function. * Fix code review issue 1.Use C++ style casts 2.Rename variable and function, make the code more friendly. 3.Add copyright info. * Fix code review issue 1.Rename static veriable(nextTextureId -> kNextTextureId) 2.Modify comment, make it more clear. 3.Rename function name(FlutterDesktopDestructionCallback) * Fix code review issue * Remove warning log This warning log shouldn't be displayed when launching a headless app.
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
* Add platfrom surface buffer structure * Support GPU buffer texture * Change file permission * Add FlutterDesktopGpuBufferTextureConfig in FlutterDesktopTextureInfo. * Add buffer parameter at Destruction callback * Change class name ExternalTextureGL to ExternalTextureSurfaceGL * Fix wild pointer issue * Convert unique_ptr to shared_ptr when create external texture * Fix arm64 build error
1.Merge flutter_tizen_texture_registrar.h into common interface
we add GpuBufferTexture in Texture_registrar.h for tbm surface.
2.Delete ref/unref tbm_surface code.
we add destruction_callback in GpuBufferTexture, notify app to destory tbm surface.
3.Support pixel buffer texture.
we can implement pixel buffer texture.
This code only completes the basic architecture,we don't implement the detail,
We need to discuss the feasibility of this code first, and need more suggestions.