kakone / VLC.MediaElement

MediaElement clone powered by VLC
GNU Lesser General Public License v2.1
68 stars 33 forks source link

UWP Project #55

Open mscott161 opened 6 years ago

mscott161 commented 6 years ago

Error D3D when running 6 MediaElements in an UWP app. I setup a Grid with 2 rows and 3 columns. I set the source URL in the Loaded event. I do not have to call Play because it errors with a D3D error.

<Page x:Class="UWP.VLCViewer.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UWP.VLCViewer" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vlc="using:VLC" mc:Ignorable="d" Background="Black" Loaded="Page_Loaded">

<Grid Background="Black" BorderBrush="White" BorderThickness="1">
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="*" />
        <RowDefinition Height="100" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <StackPanel x:Name="stackPanel1" Grid.Row="0" Grid.Column="0" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera1" AreTransportControlsEnabled="False" HardwareAcceleration="True"
                      ></vlc:MediaElement>
        <Button x:Name="btnStartCamera1" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </StackPanel>

    <StackPanel x:Name="stackPanel2" Grid.Row="0" Grid.Column="1" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera2" AreTransportControlsEnabled="False" HardwareAcceleration="True"
                 ></vlc:MediaElement>
        <Button x:Name="btnStartCamera2" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </StackPanel>

    <StackPanel x:Name="stackPanel3" Grid.Row="0" Grid.Column="2" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera3" AreTransportControlsEnabled="False" HardwareAcceleration="True"
  ></vlc:MediaElement>
        <Button x:Name="btnStartCamera3" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </StackPanel>

    <StackPanel x:Name="stackPanel4" Grid.Row="1" Grid.Column="0" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera4" AreTransportControlsEnabled="False" HardwareAcceleration="True"
    ></vlc:MediaElement>
        <Button x:Name="btnStartCamera4" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </StackPanel>

    <StackPanel x:Name="stackPanel5" Grid.Row="1" Grid.Column="1" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera5" AreTransportControlsEnabled="False" HardwareAcceleration="True"

</vlc:MediaElement>

    <StackPanel x:Name="stackPanel6" Grid.Row="1" Grid.Column="2" Orientation="Vertical">
        <vlc:MediaElement x:Name="Camera6" AreTransportControlsEnabled="False" HardwareAcceleration="True"
                      ></vlc:MediaElement>
        <Button x:Name="btnStartCamera6" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </StackPanel>

</Grid>

kakone commented 6 years ago

What is your graphic card ? Did you try disabling the hardware acceleration ?

mscott161 commented 6 years ago

I am using a Surface Pro 3 16gb ram running Windows 10 Fall Creator Update. The program ran fine twice then stopped working in Visual Studio 2017.

kakone commented 6 years ago

Could you try with the new version 3.0.1 ?

mscott161 commented 6 years ago

Tried version 3.0.1 on 2 different computers. The second computer has a high end graphics card with 32gb of ram. i turn hardware acceleration off and still no difference. the message i get is

"The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.\r\nEnable the D3D debug layer in order to see details via debug messages.\r\n\r\nCould not create swapChain"

I even put the start media source to the big buck bunny video. I tested the url to make sure it was good first.

taoyouh commented 6 years ago

I met this problem too. Version 3.0.1 Device: HP desktop PC with AMD HD5450 OS: Windows 10 1709 Hardware acceleration: False Stack trace:

at libVLCX.Instance..ctor(IList`1 argv, SwapChainPanel panel) at VLC.MediaElement.d178.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at VLC.MediaElement.d191.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at VLC.MediaElement.<b__166_1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state) at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

taoyouh commented 6 years ago

Changing target version to 16299 fixed this problem Crash: min 14393 target 14393 on 16299 Ok: min 14393 target 16299 on 16299

taoyouh commented 6 years ago

As it doesn't seem to work on Anniversary Edition, maybe we should change this line in the readme file:

Requires Windows 10 Anniversary Edition and matching Windows SDK.