This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
Rewrite the Wpf control and version bump to 3.0.0 #365
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.
Motivation
There are many Wpf bugs that are caused by the airspace issue #296 .
The Wpf control as it is now is just a wrapper around the WinForms control, which can be easily reproduced.
User are asking for a Wpf control that is not dependant on a WinForms component ( see #249 ).
Options that were available
Keep things as-is
Not a good option in my opinion, because many issues would have been left unanswered.
Try to use DirectX
Wpf is based on DirectX, it seemed to be a good option at first. However, using DirectX from WPF is really hard and suffers from too many bugs ( see sharpdx/SharpDX#599 (comment) ) . Most of the time, people are suggesting to use WinForms to use DirectX with best performance, but that would bring us no gain over the "keep as-is" method.
Moreover, things are not ready in libvlc to use DirectX from outside in the classic build (winrt build are available, but not really applicable for us...)
Using a Wpf bitmap
This is the solution that have been chosen. Warnings are there in the libvlc documentation to discourage the use of this method, because there is a copy of buffers involved, which slows down the rendering and consumes more resources.
However, this is a technique that have been used in older version of Vlc.DotNet and in other bindings like Meta.Vlc. It provides a good experience for WPF developpers, since an ImageSource can be used in a ImageBrush and painted everywhere !
If performance is critical, it is still possible to use the WinForms control in WPF.
What needs to be done