Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Method called after release() #71

Open
phongbm opened this issue Mar 30, 2017 · 1 comment
Open

[BUG] Method called after release() #71

phongbm opened this issue Mar 30, 2017 · 1 comment

Comments

@phongbm
Copy link

phongbm commented Mar 30, 2017

I hava a problem, the following:

  • onPause(): I finish R5Stream
    `private void finishLiveStreaming() {
    if (stream != null) {
    stream.stop();

          videoPreview.getHolder().removeCallback(this);
    
          R5Camera r5Camera = ((R5Camera) stream.getVideoSource());
          r5Camera.stopEncoding();
          r5Camera.setPreviewDisplay(null);
    
          camera = r5Camera.getCamera();
          camera.setPreviewCallback(null);
          camera.stopPreview();
          camera.release();
          camera = null;
    
          stream = null;
          isRunningLiveStreaming = false;
          isEndedLiveStreaming = true;
      }
    

    }`

  • When resume app, I have an exception
    FATAL EXCEPTION: main Process: com.phongbm.eg, PID: 16096 java.lang.RuntimeException: Method called after release() at android.hardware.Camera.setPreviewSurface(Native Method) at android.hardware.Camera.setPreviewDisplay(Camera.java:742) at com.red5pro.streaming.source.R5Camera.setPreviewDisplay(Unknown Source) at com.red5pro.streaming.source.R5Publisher.surfaceChanged(Unknown Source) at android.view.SurfaceView.updateWindow(SurfaceView.java:590) at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:238) at android.view.View.dispatchWindowVisibilityChanged(View.java:8709) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1270) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1339) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1078) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5876) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5292) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

Please help me.
Sorry my English is not good.

@HoldenMills
Copy link
Contributor

Hello,

Please take a look at this FAQ that should help guide you through the process of dealing with interruptions to your stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants