17 | | Media will be designed to work with the FFmpeg (http://ffmpeg.org/) and within timelines. |
18 | | |
19 | | A C++ wrapper for capturing video will be created to work with FFmpeg for Linux, Windows and Mac OS X as well as for their 64bit versions. |
20 | | |
21 | | A C++ wrapper for playing back audio will be created to work with SDL or PortAudio for all platforms. |
22 | | |
23 | | A protocol has to be defined for communication between the FFmpeg wrappers and Sophie. |
| 17 | * Write a C++ program that uses ffmpeg to render a frame from a video and send it back to Sophie2 |
| 18 | * Compite this program on every platform Sophie2 support |
| 19 | * Write a simple demo that plays a video |
44 | | The communication between the C++ program and the Java program (Sophie2, except the demos) will be sequence of integers. We chose integers over string because there are too many encodings for strings. Every integer sequence will be in the following format: [[BR]] |
45 | | <size> <id> ... [[BR]] |
46 | | <size> and <id> are mandatory and their meanings are : |
47 | | * size - the length of the integer sequence |
48 | | * id - command/sequence id |
49 | | |
50 | | Example(start command, whose id is 0) : 2 0 |
51 | | |
52 | | The communication will be in the following way: |
53 | | * the Java program sends a command through the standard input of the C++ process |
54 | | * the C++ program creates a respones on the base of the command |
55 | | * the C++ program returns the reposne through its standard output |
56 | | * the Java program receives the respone and acts on the base of it |
57 | | |
58 | | This means that the Java program will be blocked until it recieves mething from the standard input of the process so the Java wrapper will be in separate thread. Also the control of the C++ application will be in the Java part - it will run and stop it. |
59 | | |
60 | | The flow of communication written above is common for all other wrapers and native applications. This code will reside in classes called Bridges. [[BR]] |
61 | | There will be some common commands and responses: |
62 | | * StartCommand |
63 | | * StopCommand |
64 | | * OkResponse |
65 | | * ErrorResponse |
66 | | |
67 | | Design of the C++ part: |
68 | | |
69 | | Design of the Java part: |