Subversion Repositories shark


Blame | Last modification | View Log | RSS feed

This demos reads a mpeg file named test.m2v.
Make sure that the BASE path in makefile points on your shark directory.

To start the application push 1.
Thereafter you can create a dummy task that will take around 10% of the time (wcet: 19344, mit: 200000).
This application use fsf frame work.

To be able to change the application this is how you should do.
The decoder is split into 3 parts: a input task (readTask), a decoder task (mpeg2decoder) and a display task (displayTask)

There are 5 files that are change from the original decoder. These files are gvideo.c, getbits.c, test2.c, getpic.c and global.h.

The different body of the tasks is in this file.

Reads a buffer of size 2048 from a bigger buffer and sends it throug a port to the decoder task.

This task decodes a sequence in the movie, this means that in one execution the task will receive several buffers from readTask and sends several decoded pictures to the display. This task use moste of the files in the application. The files that I have change in that the decoder use is getbits.c, getpic.c.

This function receive a decoded picture from the decoder and sends it to a function called displayTaskFunction. This function was named Write_Frame in the original decoder. I change the name so I could use this interface in the decoder.

A new function was written in this file, named int read(int Infile, void *Rdbfr, int rdsize). This function overrides the os read function. What this function does is receive a buffer from readTask.

A new function was written in this file, named void Write_Frame(unsigned char *src[], int frame). This function takes a decoded picture and sends it throug a port to the displayTask.

This file handle the times for the task, the server and so on that a required for shark. 

This file has global variable, some structs for message between the task and so on.

Some special notes:
When we are sending a decoded picture between the decoder and display task we must copy the picture. This because the decoder use a global buffer and the display can't use it because then we will get a race condition between the decoder and display e.g. the decoder will overwrite the decoded picture at the same time as display try to display it. So the solution is to create a dynamic allocated buffer copy the decoded picture to it. Sends the pointer to the allocated buffer to the display. Display takes the pointer to the buffer. Displays the buffer and after this deallocated the buffer.