ekumenlabs / AndroidStreamingClient

Library that receives UDP packets wrapped into RTP and coded in H264, decodes the corresponding frames and plays the resulting stream in an Android SurfaceView
Apache License 2.0
129 stars 45 forks source link

Application crashes / stops working when screen locks #6

Open adamantivm opened 9 years ago

adamantivm commented 9 years ago

We need to implement whatever mechanisms are necessary so that it can gracefully handle the Activity lifecycle

ashyonline commented 9 years ago

Tests and results:

Running video publisher in a device, mission control in another one

video_publisher is:

  1. minimized: when maximized, the video player continues playing video
  2. rotated: video player continues playing
  3. locked: video_publisher device: video_publisher stops streaming (solved after handling VideoPublisherMainActivity life cycle). After fix, it sends packages.
  4. closed: TO-FIX: Close video_publisher and restart the application: doesn't reconnect. If I restart mission_control after restarting video_publisher, they both stream and play perfectly.

mission_control is:

  1. minimized: TO-FIX: it doesn't play any more frames (frames arrive but they are dropped). Activity clycle: OnPause->OnStop->OnResume.
  2. rotated: when device is rotated, it keeps playing video. Activity cycle: OnPause->OnStop->OnResume.
  3. locked: it keeps playing. Activity cycle: OnPause->OnStop->OnResume.
  4. closed: when restarted, it reconnects.

Note: I'm having issues using the samsung S4 to publish video. The frames come out off order (most of them) and the video in mission_control is delayed, fragmented and not clear at all.

ashyonline commented 9 years ago

Two cases are still having trouble. Test and fix.

FlyingPumba commented 9 years ago

Wouldn't this be fixed if #3 would be correctly fixed ?

ashyonline commented 9 years ago

No.

The no fixed cases are:

Video publisher is closed and restarted. Mission control is minimized.