riteshSTPL / spydroid-ipcamera

Automatically exported from code.google.com/p/spydroid-ipcamera
GNU General Public License v3.0
0 stars 0 forks source link

Bug: H.264 cannot work well #76

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open chrome, select H.264 and click connect button, video will be shown.
2. Click disconnect button and select H.263, then click connect button.
3. then click disconnect and select H.264, click connect, but the video cannot 
be shown.

Original issue reported on code.google.com by shawnhu...@gmail.com on 25 Nov 2012 at 6:52

GoogleCodeExporter commented 8 years ago
I checked it again, and found the bug's path.
Step 1: uninstall the spydroid(v6.3)
Step 2: Install the spydroid v6.3 again.
Step 3: Transfer the video stream(H.264)
Step 4: Stop the stream, then you cannot transfer the H.264 video stream, but 
H.263 is okay.

Original comment by shawnhu...@gmail.com on 25 Nov 2012 at 4:12

GoogleCodeExporter commented 8 years ago
I try to debug it and found a way can fix it temporarily.
In the prepare() of VideoStream.java, find the code below:
            if (mode==MODE_DEFAULT) {
                super.setMaxDuration(1000);
                super.setMaxFileSize(Integer.MAX_VALUE);
            } else if (modeDefaultWasUsed) {
                // On some phones a RuntimeException might be thrown :/
                try {
                    super.setMaxDuration(0);
                    super.setMaxFileSize(Integer.MAX_VALUE); 
                } catch (RuntimeException e) {
                    Log.e(TAG,"setMaxDuration or setMaxFileSize failed !");
                }
            }

Add some else code as below
 else {
                super.setMaxDuration(0);
                super.setMaxFileSize(Integer.MAX_VALUE); 
            }

Then this bug can be fixed.

Original comment by shawnhu...@gmail.com on 25 Nov 2012 at 7:53