c# - WindowPhone 7.x | How to correctly close/pause video recording when app going to background -


when lock phone during video recording, app hung stack trace below:

system.windows.dll!ms.internal.nativephotomethods.capman_disconnect(int dwseq)
system.windows.dll!system.windows.media.capturesource.capturethread() + 0x2dd bytes mscorlib.dll!system.threading.threadhelper.threadstarthelper(system.threading.threadhelper t) + 0x1d bytes
mscorlib.dll!system.threading.threadhelper.threadstart_context(object state) + 0xb bytes
mscorlib.dll!system.threading.executioncontext.run(system.threading.executioncontext executioncontext, system.threading.contextcallback callback, object state) + 0x63 bytes
mscorlib.dll!system.threading.threadhelper.threadstarthelper() + 0x2a bytes

when call capturesource.stop() (on lock event phoneapplicationframe.obscured), app hang different stack trace:

mscorlib.dll!system.threading.thread.join() system.windows.dll!system.windows.media.capturesource.stopmanagedimagecapture() + 0x3e bytes
system.windows.dll!system.windows.media.capturesource.stop() + 0x10 bytes
helloworld.dll!helloworld.app.rootframe_obscured(object sender, microsoft.phone.controls.obscuredeventargs e) line 96 + 0xa bytes c# microsoft.phone.dll!system.windows.controls.frame.fireeventhandler(system.eventhandler handler, object sender, microsoft.phone.controls.obscuredeventargs args) + 0xd bytes microsoft.phone.dll!microsoft.phone.controls.phoneapplicationframe.shellpagemanager_onlockstatechange(object sender, microsoft.phone.shell.interop.lockstatechangeeventargs args) + 0x48 bytes
microsoft.phone.interop.dll!microsoft.phone.shell.interop.shellpagemanager.shellpagecallback_onlockstatechange(object source, microsoft.phone.shell.interop.lockstatechangeeventargs e) + 0x12 bytes
microsoft.phone.interop.dll!microsoft.phone.shell.interop.shellpagecallback.fireonlockstatechange(bool flocked) + 0x41 bytes
[external code]

how can prevent hanging , correctly pause/close capturesource?

try implement obscured event windows phone

here's obscured event's link

this event fired when screen covers app. try stopping / pausingthe video , there. see if works. if not please leave reply


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -