lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
335 stars 137 forks source link

Video issue on IOS #70

Open jlavyan opened 11 years ago

jlavyan commented 11 years ago

How i can enable Video ?

jlavyan commented 11 years ago

Hello, Please can help with IOS Video What steps i should do for enable Video Thanks

lukeweber commented 11 years ago

I got the video example to compile for Android with vp8 and I wasn't impressed with a very fast multicore arm phone. At the smallest screen size, it was choppy, froze and eventually died with the basic example code. IPhone is likely to be a little better, due to probably having a better video driver(I assume), but I don't expect great things personally.

That being said, if you're interested, I'm sure you'll no doubt have build errors before it works correctly.

A good starting point, if you still wish to continue, would be IPhone instructions in the readme.

Then you'll probably want to uncomment the video dependencies I removed from the libjingle.gyp

+++ b/libjingle.gyp
@@ -754,9 +754,9 @@
       ],
       'dependencies': [
         '<(DEPTH)/third_party/libsrtp/libsrtp.gyp:libsrtp',
-        #'<(DEPTH)/third_party/webrtc/modules/modules.gyp:video_capture_module',
-        #'<(DEPTH)/third_party/webrtc/modules/modules.gyp:video_render_module',
-        #'<(DEPTH)/third_party/webrtc/video_engine/video_engine.gyp:video_engine_core',
+        '<(DEPTH)/third_party/webrtc/modules/modules.gyp:video_capture_module',
+        '<(DEPTH)/third_party/webrtc/modules/modules.gyp:video_render_module',
+        '<(DEPTH)/third_party/webrtc/video_engine/video_engine.gyp:video_engine_core',
         '<(DEPTH)/third_party/webrtc/voice_engine/voice_engine.gyp:voice_engine_core',
         '<(DEPTH)/third_party/webrtc/system_wrappers/source/system_wrappers.gyp:system_wrappers',
         'libjingle',

Then the command you'll run to build your xcode( Notice enable_video=1 )

./build/gyp_chromium --depth=.  -DOS=ios -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=1 webrtcjingle.gyp

Then you'll need to make sure it builds. I can assure you, you'll certainly have build issues in gyp files that you'll need to resolve. You'll just have to poke around and when a module doesn't compile, read a bit through the gyp and there might be some logic for Android, which in many cases, also applies to IOS, and if there's a special mac case, many times that might apply as well. Occasionally, they have IOS as a case that they've already considered, but this isn't the rule.

Then, you'll need to find a good video rendering driver for IOS. I know I've seen patches around. I think searching on discuss-webrtc would be a decent approach, but a quick google found me this post, pointing to an un-working patch for IOS video. https://groups.google.com/forum/#!topic/discuss-webrtc/M2LA4_6Z6a4. With a little more searching it might be there, or maybe the mac drivers in webrtc trunk actually support IOS, you'd have to pop it open and see what's there.

Then finally, you'll face the issues described below, where libjingle still needs some changes, to hook up correctly to webrtc, not as having it's own driver, but expecting webrtc to do the processing of the video. https://groups.google.com/forum/?fromgroups=#!topic/webrtc-jingle/nCu4ru2A7nk

Because of the performance and me not seeing this working well across a large number of devices on Android/IOS, it's not a priority for me at the moment. If someone gets it working on IOS, I'm always happy to merge back the pull request as another build option. As well, you might get milage from resyncing the repos as well to the latest and greatest from libjingle and mainly webrtc. I'll probably resync the repos in a few weeks myself, but I've been on a freeze trying to stabilise what I have lately as updates can break things.

Best of luck to you, here to support if I can help you, but not on my immediate list of things to knock down personally.

jlavyan commented 11 years ago

Hi, thank you for quick response I will tray get video on iphone and let you know about my result so the next step can be improve the video quality

jlavyan commented 11 years ago

Hello Luke Weber (lukeweber) I have done video driver for IOS and tested, but can find how i can enable Video call mode, where i can find video call mode enable I mean this one, please see ..

SEND >>>>>>>>>>>>>>>> : Fri May 24 00:50:09 2013

``` ```

I want add in SDP m=video and add my codecs, VP8 or H264 Can you please help ?

Thanks

gqbyte69 commented 11 years ago

Anybody had luck with this?

jlavyan commented 11 years ago

I am trying find the place where i can change Media No result for now ..

lukeweber commented 11 years ago

I'm guessing that when video is enabled, it should show up in the offer correctly.

libjingle/talk/media/webrtc/webrtcvideoengine.cc

const WebRtcVideoEngine::VideoCodecPref
    WebRtcVideoEngine::kVideoCodecPrefs[] = {
    {kVp8PayloadName, 100, 0},
    {kRedPayloadName, 116, 1},
    {kFecPayloadName, 117, 2},
};

Whether libjingle even thinks it has video as a starting point would be in clientsignalingthread.cc

  int capabilities = sp_media_client_->GetCapabilities();
  my_status_.set_voice_capability((capabilities & cricket::AUDIO_RECV) != 0);
  my_status_.set_video_capability((capabilities & cricket::VIDEO_RECV) != 0);
  my_status_.set_camera_capability((capabilities & cricket::VIDEO_SEND) != 0);

As well have a look at callclient.cc, See the stuff about has_video and setting the options on a call. This would probably trigger sending the video codecs that you've compiled into webrtc. You'd need to port that into the call logic on clientsignalingthread.cc

Okay, best of luck,

Luke

jlavyan commented 11 years ago

Hi Luke Thanks for response. From call.cc i have enabled has_video and now transport is created for Video Call::Call(MediaSessionClient* sessionclient) : id(talk_base::CreateRandomNonZeroId()), sessionclient(session_client), localrenderer(NULL), hasvideo(true), <---------- this one hasdata(false), muted_(false), videomuted(false), send_tovoicemail(true), playingdtmf(false) { }

I want understand from where i should put Video Data for sending and from where i will handle video data for draw.

Thank you for big help. rgs Grigori Jlavyan