Git Product home page Git Product logo

Comments (5)

ThibaultBee avatar ThibaultBee commented on July 19, 2024

Hi,
FYI, the crash is in the release part of one of the encoder but I don't understand why.
So here comes more questions:

  • could you reproduce this crash in the sample app?
  • on which devices?
  • is there any logs relevant before the crash trace?
  • is it random?

from streampack.

mrhoibq avatar mrhoibq commented on July 19, 2024

hi ThibaultBee,

It always happens on just 1 of my test devices (Galaxy note 5 (Model: SM-N920L) - Android 7). Currently, I'm using RTMP.

Btw, I've found a way to work around this: If I delay about 500ms before calling stream.release(), then it works. : D

Thanks for your reply, and thanks for your lib! ๐Ÿ‘

from streampack.

ThibaultBee avatar ThibaultBee commented on July 19, 2024

Hi,
I am not really satisfied with this workaround.
I guess the live stream is running, and you called stopStream, then release. Right?
Do you call stopStream and release from the same thread?

The call to MediaCodec release is not sync with the called to MediaCodec stop. This might explains the crash.
I can provide a fix for this but could test it?

from streampack.

mrhoibq avatar mrhoibq commented on July 19, 2024

Hi ThibaultBee,

I called stop and then release in the same method, and of course, in the same thread. The code runs just fine, but it only crashed on one of my test devices.

I think it may relate to the PreviewView. Because after I delay a few milliseconds to wait for the view to completely leave the composition (My app uses Jetpack Compose, not a normal native app), then calling release won't crash anymore.

from streampack.

mrhoibq avatar mrhoibq commented on July 19, 2024

Hi ThibaultBee,

I've checked the code again and found that although I call both stop and release in the same method and in the same thread. But actually, the stop() method in the StreamManager which I customized a little bit, was really doing its job on a background thread. After removing the thread, the code runs well on the device without having to delay. So this is my implementation error only, not lib's error. Thanks for your support!

from streampack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.