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

Error : Cannot send video as audio #26

Open
ShGup opened this issue Aug 29, 2015 · 5 comments
Open

Error : Cannot send video as audio #26

ShGup opened this issue Aug 29, 2015 · 5 comments

Comments

@ShGup
Copy link

ShGup commented Aug 29, 2015

Hi,
Using the SDK, We are trying to publish both Audio and Video.
nativeHandler.startGetCaptureSourcesForAudio(true, video: true)

However, when I try to handle the answer received, following error is encountered:

0:06:19.694238000 �[334m 837�[00m 0x1036df070 �[31;01mERROR �[00m �[00m owrtransportagent owr_transport_agent.c:703:handle_new_send_source:�[00m Cannot send video as audio

0:07:14.218096000 �[334m 837�[00m 0x1036df070 �[31;01mERROR �[00m �[00m owrtransportagent owr_transport_agent.c:703:handle_new_send_source:�[00m Cannot send audio as video

(If I only try to Set Capture Source as Audio, things work fine. )

I tied matching the answer SDP from your native-demo project and my project and they both look similar. The only difference was the order of mediaDescriptions was reversed. In my answer, audio was the first media and yours video was the first media. (I dont think that should matter though). Let me know if you need my sample answer sdp

@ShGup
Copy link
Author

ShGup commented Aug 30, 2015

Alright.. Looks like I found the issue. It is indeed the order of media in the answer received.

handleAnswerReceived() function:
for (item = media_sessions; item; item = item->next) {
media_session = OWR_MEDIA_SESSION(item->data);
...

now the media_sessions are in the order of "Video" and "Audio".
My sdp answer generated from server was in the order of "Audio" and "Video"

So the "audio" payload was sent with "Video" media session and hence creating the problem.

(Just to quickly test, i reversed the media_sessions list and tried. It worked)

A simple fix would be in this line:

NSDictionary *mediaDescription = sdp[@"mediaDescriptions"][i++];
mtype = [mediaDescription[@"type"] UTF8String];

instead of using variable i, find that media description object in answer whose mtype = media_session source type.

@superdump
Copy link
Contributor

You're welcome to make a patch and pull request for this fix. Perhaps take the first video session and set the video source on it, and the first audio session and set the audio source on it. Or something more flexible if you're interested in implementing it.

@ShGup
Copy link
Author

ShGup commented Sep 1, 2015

Sure thing :)
I'll be glad to fix this.

@stefanalund
Copy link
Contributor

Nice @ShGup, looking forward to it!

@stefanalund
Copy link
Contributor

@ShGup we would really appreciate a PR for your fix. Let us know if you are unable to do it and we will add it to our TODO list. Thanks in advance.

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

3 participants