Giter Club home page Giter Club logo

Comments (12)

coolwr avatar coolwr commented on June 23, 2024

What device model and iOS version are you using? Does this error occur
every time? In what situation do you get the error? Can you list the steps?
What AppRTC Server are you connecting to and is the remote device a web
browser or another iOS device?

--kelly

On Thu, Jul 30, 2015 at 6:46 AM, Kos [email protected] wrote:

Arising some error,
onVideoError: NSConcreteNotification 0x16fc1a50 {name =
AVCaptureSessionRuntimeErrorNotification; object =
-> ; userInfo = {
AVCaptureSessionErrorKey = "Error Domain=AVFoundationErrorDomain
Code=-11800 "The operation could not be completed" UserInfo=0x16fb5230
{NSLocalizedDescription=The operation could not be completed,
NSUnderlyingError=0x16d0ae60 "The operation couldn\U2019t be completed.
(OSStatus error -12780.)", NSLocalizedFailureReason=An unknown error
occurred (-12780)}";
}}
Than: WARNING: Renegotiation needed but unimplemented.

Than the App freezing
What should I do if delegate calls a peerConnectionOnRenegotiationNeeded
method?
I disabled an execution of device rotation.
Any ideas ?
Thanks!


Reply to this email directly or view it on GitHub
#5.

from apprtc-ios.

kos9kus avatar kos9kus commented on June 23, 2024

So, I have a iPhone5, ios 8.4
Steps: I set connection up, similar to example, then a connection is established, everything's fine, video and audio exchanging is running, then rotate the device at 180grad ( tentatively ) then local video view is freezing and in this moment the error arises. The freezing is going until I rotate the device again by the same manner and the freezing is gone, a behavior of running is very weird, following log:
onVideoError: NSConcreteNotification 0x16fc1a50 {name = AVCaptureSessionRuntimeErrorNotification; object = <AVCaptureSession: 0x180a35a0 [AVCaptureSessionPresetInputPriority]>
<AVCaptureDeviceInput: 0x16dd1ba0 [Front Camera]> -> <AVCaptureVideoDataOutput: 0x180d8a30>; userInfo = {
AVCaptureSessionErrorKey = "Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x16fb5230 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x16d0ae60 "The operation couldn\U2019t be completed. (OSStatus error -12780.)", NSLocalizedFailureReason=An unknown error occurred (-12780)}";
}}
WARNING: Renegotiation needed but unimplemented.
WARNING: Renegotiation needed but unimplemented.
Exchange happens between browser and device.
I use default google stun servers.
I think, a server side is not guilty, it depends on some video capture system. Presumably, the webrtc lib consists of a lot of wrappers of native classes ( ObjC ) and probably inside of some class call a rotation method of device.
What should i do when delegate call a peerConnectionOnRenegotiationNeeded method?
What are cases a Renegotiation occurs ??
Because the "onVideoError" error occurs in the same time with the Renegotiation WARNING.
My take on it, this 2 events are connected with each other.
Thanks

from apprtc-ios.

coolwr avatar coolwr commented on June 23, 2024

Yes, rotation seems to cause a problem and lead to crashing. What needs to
happen is before rotation the app will need to destroy the views and
recreate them after rotation in the correct orientation.

On Thu, Jul 30, 2015 at 7:59 AM, Kos [email protected] wrote:

So, I have a iPhone5, ios 8.4
Steps: I set connection up, similar to example, then a connection is
established, everything's fine, View and audio exchanging is running, then
rotate the device at 180grad ( tentatively ) then local video view is
freezing and in this moment the error arises. The freezing is going until I
rotate the device again by the same manner and the freezing is gone, a
behavior of running is very weird, following log:
onVideoError: NSConcreteNotification 0x16fc1a50 {name =
AVCaptureSessionRuntimeErrorNotification; object =
-> ; userInfo = {
AVCaptureSessionErrorKey = "Error Domain=AVFoundationErrorDomain
Code=-11800 "The operation could not be completed" UserInfo=0x16fb5230
{NSLocalizedDescription=The operation could not be completed,
NSUnderlyingError=0x16d0ae60 "The operation couldn\U2019t be completed.
(OSStatus error -12780.)", NSLocalizedFailureReason=An unknown error
occurred (-12780)}";
}}
WARNING: Renegotiation needed but unimplemented.
WARNING: Renegotiation needed but unimplemented.
Exchange happens between browser and device.
I use default google stun servers.
I think, a server side is not guilty, it depends on some video capture
system. Presumably, the webrtc lib consists of a lot of wrappers of native
classes ( ObjC ) and probably inside of some class call a rotation method
of device.
What should i do when delegate call a peerConnectionOnRenegotiationNeeded
method?
What are cases a Renegotiation occurs ??
Because the "onVideoError" error occurs in the same time with the
Renegotiation WARNING.
My take on it, this 2 events are connected with each other.
Thanks


Reply to this email directly or view it on GitHub
#5 (comment).

from apprtc-ios.

kos9kus avatar kos9kus commented on June 23, 2024

Must I do it within peerConnectionOnRenegotiationNeeded method?

from apprtc-ios.

coolwr avatar coolwr commented on June 23, 2024

Last time i looked into the issue it was related to
ARTCVideoChatViewController's videoView:didChangeVideoSize: method that is
called when orientation change. Looks like changing the frame size for
the RTCEAGLVideoView for the local and remote views is what leads to the
error.

-k

On Fri, Jul 31, 2015 at 10:50 AM, Kos [email protected] wrote:

Must I do it within peerConnectionOnRenegotiationNeeded method?


Reply to this email directly or view it on GitHub
#5 (comment).

from apprtc-ios.

kos9kus avatar kos9kus commented on June 23, 2024

Hello,
Look, Presumably I found a point that causes an issue.
Acoording to ticket: https://code.google.com/p/webrtc/issues/detail?id=3162&can=1&q=onVideoError&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20Area%20Status%20Owner%20Summary
There are discussing about stop video session on a background thread, so it's fine, a following code of ARDAppClient:

- (void)orientationChanged:(NSNotification *)notification {
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    if (UIDeviceOrientationIsLandscape(orientation) || UIDeviceOrientationIsPortrait(orientation)) {
        //Remove current video track
        RTCMediaStream *localStream = _peerConnection.localStreams[0];
        [localStream removeVideoTrack:localStream.videoTracks[0]];

        RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack];
        if (localVideoTrack) {
            [localStream addVideoTrack:localVideoTrack];
            [_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack];
        }
        [_peerConnection removeStream:localStream];
        [_peerConnection addStream:localStream];
    }
}

A [localStream removeVideoTrack:localStream.videoTracks[0]] and RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack] are called from different threads and probably the system tries to call removeVideoTrack and createLocalVideoTrack simultaneously. I made a test, I inserted a pause (sth like sleep() ) between removeVideoTrack and createLocalVideoTrack, for convincing that a removeVideoTrack was executed and createLocalVideoTrack will be executed after, the problem is gone.
Look at my stack while my test was running:
screen shot 2015-08-06 at 16 48 51

The didChangeVideoSizes is selector that handles an error onVideoError ( when I talked about in the beginning).
What do you think about it? Would you agree that handling of two methods of video Capture is not good simultaneously?

from apprtc-ios.

coolwr avatar coolwr commented on June 23, 2024

Thats great to hear you solved the problem! Do you want to issue a pull
request and I can merge it into the code repository?

thanks!

On Thu, Aug 6, 2015 at 7:18 AM, Kos [email protected] wrote:

Hello,
Look, Presumably I found a point that causes a issue.
Acoording to ticket:
https://code.google.com/p/webrtc/issues/detail?id=3162&can=1&q=onVideoError&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20Area%20Status%20Owner%20Summary
There are discussing about stop video session on a background thread, so
it's fine, next a following code of ARDAppClient:

  • (void)orientationChanged:(NSNotification *)notification {
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    if (UIDeviceOrientationIsLandscape(orientation) || UIDeviceOrientationIsPortrait(orientation)) {
    //Remove current video track
    RTCMediaStream *localStream = _peerConnection.localStreams[0];
    [localStream removeVideoTrack:localStream.videoTracks[0]];

    RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack];
    if (localVideoTrack) {
        [localStream addVideoTrack:localVideoTrack];
        [_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack];
    }
    [_peerConnection removeStream:localStream];
    [_peerConnection addStream:localStream];
    

    }
    }

A [localStream removeVideoTrack:localStream.videoTracks[0]] and
RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack] are called
from different threads and probably the system tries to call
removeVideoTrack and createLocalVideoTrack simultaneously. I made a test, I
inserted a pause (sth like sleep() ) between removeVideoTrack and
createLocalVideoTrack, for convincing that a removeVideoTrack was executed
and createLocalVideoTrack will be executed after, the problem is gone.
Look at my stack while my test was running:
[image: screen shot 2015-08-06 at 16 48 51]
https://cloud.githubusercontent.com/assets/7373566/9113418/27ef23f4-3c5d-11e5-81f8-f5f57d73a7ea.png

The didChangeVideoSizes is selector that handles an error onVideoError (
when I talked about in the beginning).
What do you think about it? Would you agree that handling of two methods
of video Capture is not good simultaneously?


Reply to this email directly or view it on GitHub
#5 (comment).

from apprtc-ios.

SoapyCro avatar SoapyCro commented on June 23, 2024

Hi, I'm having the exact problem. For me, this error is occurring only when I add mandatoryConstraints for maxWidth and maxHeight. Without them, everything seems fine. By trial and error method I managed to find out that inserting 0.4 seconds pause anywhere between [localStream removeVideoTrack:localStream.videoTracks[0]]; and [_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack]; fixes the problem. Anything below 0.4 seconds doesn't work for me. Since pausing for 0.4 seconds is creating a delay I was wondering if there is a more elegant solution for this problem?

Thanks!

from apprtc-ios.

kos9kus avatar kos9kus commented on June 23, 2024

Guys look at my pull request. There are improvements regarding the issue

from apprtc-ios.

SoapyCro avatar SoapyCro commented on June 23, 2024

Yep, works like a charm now. Thanks!
One more thing, when I used the default way to detect orientation changes using UIDeviceOrientation, it would register FaceUp and FaceDown orientation change and cause local view to be reloaded unnecessarily so I switched to UIInterfaceOrientation and that seems to work better for me.

from apprtc-ios.

kadamska avatar kadamska commented on June 23, 2024

I'm using @kos9kus 's fix, and generally it works - rotates fine, with one exception - front camera, when orientation is set to 4 (UIDeviceOrientationLandscapeRight). Then I just get a black screen. Any ideas?

from apprtc-ios.

Morris-Lin0408 avatar Morris-Lin0408 commented on June 23, 2024

Hello guys! I Maybe fix it. This is my solution :

In ARDAppClient class

  • (void)orientationChanged:(NSNotification )notification
    {
    /

    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    if (UIDeviceOrientationIsLandscape(orientation) || UIDeviceOrientationIsPortrait(orientation))
    {
    //Remove current video track
    RTCMediaStream *localStream = _peerConnection.localStreams[0];
    RTCVideoTrack *localVideoTrack = localStream.videoTracks[0];
    [localStream removeVideoTrack:localVideoTrack];

    //RTCVideoTrack *localVideoTrack = [self createLocalVideoTrack];
    if (localVideoTrack)
    {
        [localStream addVideoTrack:localVideoTrack];
        [_delegate appClient:self didReceiveLocalVideoTrack:localVideoTrack];
    }
    [_peerConnection removeStream:localStream];
    [_peerConnection addStream:localStream];
    

    }
    */
    }
    Do nothing in it

from apprtc-ios.

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.