VLC.MediaElement icon indicating copy to clipboard operation
VLC.MediaElement copied to clipboard

UWP Project

Open mscott161 opened this issue 7 years ago • 7 comments

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> <Button x:Name="btnStartCamera5" Content="Start" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> </StackPanel>

    <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>

mscott161 avatar Jan 24 '18 04:01 mscott161

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

kakone avatar Jan 24 '18 23:01 kakone

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.

mscott161 avatar Jan 25 '18 02:01 mscott161

Could you try with the new version 3.0.1 ?

kakone avatar Feb 19 '18 09:02 kakone

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.

mscott161 avatar Feb 25 '18 20:02 mscott161

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.<InitAsync>d__178.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.<UpdateSizeAsync>d__191.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.<<OnApplyTemplate>b__166_1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state) at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

taoyouh avatar Apr 01 '18 02:04 taoyouh

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

taoyouh avatar Apr 01 '18 03:04 taoyouh

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.

taoyouh avatar Apr 08 '18 02:04 taoyouh