DesignVideo

Version 7 (Saúl Ibarra Corretgé, 09/02/2009 09:00 pm)

1 2 Adrian Georgescu
[[TOC(Design*, depth=1)]]
2 2 Adrian Georgescu
3 2 Adrian Georgescu
= Video blueprint =
4 3 Adrian Georgescu
5 3 Adrian Georgescu
Design and implement Ticket [ticket:18]
6 4 Saúl Ibarra Corretgé
7 4 Saúl Ibarra Corretgé
== Goals ==
8 4 Saúl Ibarra Corretgé
9 4 Saúl Ibarra Corretgé
Te goal is to implement videostream.py, an H.264 video handler for encoding/decoding video frames comming to/from the media layer. It must compy with the IMediaStream interface, the same way audiostream does.
10 4 Saúl Ibarra Corretgé
11 4 Saúl Ibarra Corretgé
12 4 Saúl Ibarra Corretgé
== Roadmap ==
13 4 Saúl Ibarra Corretgé
14 4 Saúl Ibarra Corretgé
In order to achive the goal, the following subtasks need to be done:
15 4 Saúl Ibarra Corretgé
  * Implement a wrapper class around the VLC Python bindings. http://wiki.videolan.org/Python_bindings
16 4 Saúl Ibarra Corretgé
  * Create videostream.py implementing IMediaStream interface.
17 4 Saúl Ibarra Corretgé
    * Use the VLC wrapper class to encode/decode the stream.
18 4 Saúl Ibarra Corretgé
  * Bundle the VLC Python wrapper together with SIPSIMPLE so that it get's compiled and installed when installing SIPSIMPLE.
19 1 Adrian Georgescu
  * Create sip_video_session.py script (or modify sip_audio_session_script) so that it uses video capabilities.
20 6 Saúl Ibarra Corretgé
21 6 Saúl Ibarra Corretgé
22 6 Saúl Ibarra Corretgé
At the time of mangling the SDPs, two approaches can be taken in order to add video support:
23 6 Saúl Ibarra Corretgé
  * Modify PJSIP's PJMEDIA component to encode/decode video streams and handle them the same as audio streams from the upper layers.
24 6 Saúl Ibarra Corretgé
  * Just use PJMEDIA to do the SDP negotiation and audio part. Video would be external to the PJMEDIA layer.
25 6 Saúl Ibarra Corretgé
26 6 Saúl Ibarra Corretgé
For this case the second approach seems to be a better one. When receiving an incoming call or making a call, the SDPs will be mangled so that they include H.264 stream information i.e.
27 6 Saúl Ibarra Corretgé
{{{
28 6 Saúl Ibarra Corretgé
...
29 6 Saúl Ibarra Corretgé
m=video 6001 RTP/AVP 98
30 6 Saúl Ibarra Corretgé
a=rtpmap:98 H264/90000
31 6 Saúl Ibarra Corretgé
...
32 6 Saúl Ibarra Corretgé
}}}
33 6 Saúl Ibarra Corretgé
34 6 Saúl Ibarra Corretgé
So in the case of an incoming call, an VLC player instance will be opened for playing the stream at the IP and port specified by the SDP. For an outgoing call, an VLC will stream H.264 video taken from a selected video source (webcam, still picture, ...) from the sipsimpleclient listen IP and will randomly select a port (in a given range) which doesn't interfere with the audio ports.
35 6 Saúl Ibarra Corretgé
36 6 Saúl Ibarra Corretgé
This way audio and video components are sepparate, but it's not necesary to modify the underlying media handling component: pjmedia.
37 4 Saúl Ibarra Corretgé
38 4 Saúl Ibarra Corretgé
39 4 Saúl Ibarra Corretgé
== Components ==
40 4 Saúl Ibarra Corretgé
41 5 Saúl Ibarra Corretgé
[[Image(videostream-components.png)]]
42 4 Saúl Ibarra Corretgé
43 4 Saúl Ibarra Corretgé
44 4 Saúl Ibarra Corretgé
== Classes == 
45 4 Saúl Ibarra Corretgé
46 4 Saúl Ibarra Corretgé
ToDo
47 7 Saúl Ibarra Corretgé
48 7 Saúl Ibarra Corretgé
49 7 Saúl Ibarra Corretgé
== Code mockup == 
50 7 Saúl Ibarra Corretgé
51 7 Saúl Ibarra Corretgé
ToDo