一段时间后,MediaElement口吃并变黑 [英] MediaElement stutters and goes black after a while

查看:113
本文介绍了一段时间后,MediaElement口吃并变黑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在开发一个利用C ++ / XAML中的MediaElement类的城域应用程序。


我的应用程序在执行过程中多次交换视频,似乎在一段时间(15分钟)之后,在视频中间它将只是口吃几帧,然后变黑,音频仍然在后台播放。


我正在使用这行代码交换视频:

 

ME-> Source = this-> BaseUri-> CombineUri(< filename>);

" ;这"是指我的"主页"。在Visual Studio 11中创建新项目时创建的类。"ME"是mediaElement。


有谁知道这个的原因?发生这种情况时,我的计算机上的内存不会高于应用程序启动时的内存,所以我不相信它是内存泄漏。这可能是视频卡问题吗?并不总是发生在同一个视频上。


非常感谢你们给予的任何帮助!如果您需要更多信息,请告诉我。


谢谢,


Alex

解决方案

Hello Alex,


这听起来像资源问题。可能发生的事情是由于内存泄漏导致视频内存不足。您是否在更改URL之前完全关闭媒体元素(即停止媒体元素并等待
"已停止"状态)?我不知道你是否可以在Windows 8上运行GPUView,但你可能想尝试一下,看看你是否可以验证你是否在泄漏视频内存。我将在星期一与一些人讨论,看看我们是否可以拿出其他资源以获得
你来到这个问题的底部。


GPUView登陆页面:


http:/ /msdn.microsoft.com/en-us/library/windows/hardware/ff570133(v=vs.85).aspx


-James


Hello,

I'm developing a metro app that utilizes the MediaElement class in C++/XAML.

My app has the video being swapped many times over the course of the execution, and it seems that after a while (15 minutes), in the middle of a video it will just stutter for a few frames and then go black with the audio still playing in the background.

I'm using this line of code to swap the video:

ME->Source = this->BaseUri->CombineUri( <filename> );

"this" refers to my "MainPage" class that is created when a new project is made in Visual Studio 11. "ME" is the mediaElement.

Does anyone know a cause of this? The memory on my computer when this happens is not any higher than when the application starts so I don't believe it's a memory leak. Could it be a video card problem? Doesn't always happen on the same video.

I would appreciate any help you guys can give thanks! If you need any more information let me know.

Thanks,

Alex

解决方案

Hello Alex,

It does sound like a resource problem. Likely what is happening is that you are running out of video memory due to a memory leak. Are you shutting down the Media Element completely before changing the URL (i.e. stopping the Media Element and waiting for the "stopped" state)?. I don't know if you can run GPUView on windows 8 but you might want to give that a try and see if you can verify if you are leaking video memory. I'll talk with some folks on Monday and see if we can come up with other resources for you to get to the bottom of this issue.

GPUView landing page:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff570133(v=vs.85).aspx

-James


这篇关于一段时间后,MediaElement口吃并变黑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆