WindowPhone 7.x|如何在应用程序进入后台时正确关闭/暂停视频录制

本文关键字:暂停 视频 后台 应用程序 WindowPhone | 更新日期: 2023-09-27 18:26:57

当我在视频录制过程中锁定手机时,我的应用程序挂起了堆栈跟踪,如下所示:

System.Windows.dll!MS.Internal.NativePhotoMethods.CapMan_Disconnect(int dwSeq)
System.Windows.dll!System.Windows.Media.CaptureSource.CaptureThread()+0x2dd字节mscorlib.dll!System.Threading.ThreadHelper.ThreadStartHelper(System.Threading.ThreadHelper t)+0x1d字节
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(对象状态)+0xb字节
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext ExecutionContext,System.Threading.Context回调,对象状态)+0x63字节
mscorlib.dll!System.Threading.ThreadHelper.ThreadStartHelper()+0x2a字节

当我调用captureSource.Stop()(锁定事件PhoneApplicationFrame.Obscure)时,我的应用程序挂起了不同的堆栈跟踪:

mscorlib.dll!System.Threading.Thread.Join()System.Windows.dll!System.Windows.Media.CaptureSource.StopManagedImageCapture()+0x3e字节
System.Windows.dll!System.Windows.Media.CaptureSource.Stop()+0x10字节
HelloWorld.dll!HelloWorld.App.RootFrame_Obscured(对象发送器,Microsoft.Phone.Controls.ObscuredEventArgs e)第96行+0xa字节C#Microsoft.Phone.dll!System.Windows.Controls.Frame.FireEventHandler(System.EventHandler处理程序,对象发送器,Microsoft.Phone.Controls.ObscuredEventArgs参数)+0xd字节Microsoft.Phone.dll!Microsoft.Phone.Controls.PhoneApplicationFrame.ShellPageManager_OnLockStateChange(对象发送方,Microsoft.Phone.Shell.Interop.LockStateChangeEventArgs args)+0x48字节
Microsoft.Phone.Interop.dll!Microsoft.Phone.Shell.Interop.ShellPageManager.ShellPageCallback_OnLockStateChange(对象源,Microsoft.Phone.Shell。Interop.LockStateChangeEventArgs e)+0x12字节
Microsoft.Phone.Interop.dll!Microsoft.Phone.Shell.Interop.ShellPageCallback.FireOnLockStateChange(bool fLocked)+0x41字节
【外部代码】

如何防止挂起并正确暂停/关闭CaptureSource

WindowPhone 7.x|如何在应用程序进入后台时正确关闭/暂停视频录制

尝试为windows Phone 实现模糊事件

以下是Obscured Event的链接

当屏幕覆盖应用程序时,会触发此事件。尝试立即停止/暂停视频。看看它是否有效。如果没有,请留下回复