简体   繁体   English

Media Recorder异常问题

[英]Media Recorder Exception Issue

I have a strange problem with the Android media recorder. Android媒体记录器出现一个奇怪的问题。 On a few devices the following code fails in a way that I do not understand: 少数设备下面的代码失败的方式,我不明白:

    if (mRecorder != null)
    {
      try
      {
          mRecorder.stop();
          mRecorder.release();
          camera.lock();
          mRecorder = null;
      }
      catch (Exception e)
      {
          ; // ignore
      }
    }

What seems to happen, is that some of the methods in the try block fails, with no exception being caught, and the method is never finished. 似乎发生的是,try块中的某些方法失败了,没有捕获到异常,并且该方法从未完成。 Has anybody any idea as to what may be happening? 有人对可能发生的事情有任何想法吗? As I have no access to the devices in question, I am unable to debug this issue. 由于我无权访问有问题的设备,因此无法调试此问题。

Above code snippet is correct only but before doing this you must need to ensure with below points : 上面的代码片段仅是正确的,但是在执行此操作之前,您必须确保以下几点:

  • MediaRecorder is already stopped and your trying again to stop it : Exception MediaRecorder已停止,您再次尝试停止它:异常

  • If MediaRecorder is already released and you are trying again to release it : Exception 如果MediaRecorder已经发布,并且您正尝试再次发布它:异常

  • Camera is released and you are trying to lock it again : Exception 相机被释放,您尝试再次锁定它:异常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM