MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

10
MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010

Transcript of MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Page 1: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

MP2 Discussion SessionCS414 Spring 2010

Long Vu2/16/2010

Page 2: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Video Server

Proxy 1

Stream Movie 2

Movie 1

Movie 2

Client

CS 414 - Spring 2009

System Overview

CS 414 - Spring 2010

Request for Movie 2

Session Control

Chunk 1 Chunk 7Chunk 5

Chunk 3Chunk 1

Chunk 3

Chunk 2Chunk 4

Chunk 6

Chunk 4Chunk 2

Chunk 5

Chunk 6

Chunk 7

Proxy 2

Page 3: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Control Plan and Data Plan

Page 4: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Stream Movie 2CS 414 - Spring 2009

Registration (Control Plan)

CS 414 - Spring 2010

Video Server

Proxy 1

Movie 1

Movie 2

Client

Proxy 2

Server:- Maintains peer list (proxy and client) information: IP, port (socket)- Loads the video file into its buffer to send to the proxies- Maintains which video chunk currently is hold by which proxy

Page 5: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Stream Movie 2CS 414 - Spring 2009

Case 1: Server/Client

CS 414 - Spring 2010

Video Server

Movie 1

Movie 2

Client

- Sever sends to the client the meta data: the frame rate, pCodecContext (to open the file at the client side)- Server pushes video chunks to the client (client does not send the ACK back to the server for each received video chunks)- Client has two threads (producer and consumer) to receive data from the server and to display

Page 6: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Possible Data Packet Format

typedef struct videoPakectT{int chunkIdx; int datalen; // len of the data contentint opt; // various uses char

data[VIDEO_PACKET_BUFF_SIZE];}VideoPacket;

Page 7: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

How the Client decodes the video?

Server sends pCodecContext to the Client

sendto(s, (char *) pCodecCtx, sizeof(AVCodecContext), 0, &si_other, slen);

Client fixes the pCodecContext

void fixCodecContext(AVCodecContext *s){AVCodecContext AVCodecContext temp;

avcodec_get_context_defaults(&temp); s->av_class= temp.av_class; s->get_buffer= avcodec_default_get_buffer; s->release_buffer= avcodec_default_release_buffer; s->get_format= avcodec_default_get_format; s->execute= avcodec_default_execute; s->palctrl = NULL; s->reget_buffer= avcodec_default_reget_buffer;

}

Page 8: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Video Server

Proxy 1

Stream Movie 2

Movie 1

Movie 2

Client

CS 414 - Spring 2009CS 414 - Spring 2010

Session Control

Chunk 1 Chunk 7Chunk 5

Chunk 3Chunk 1

Chunk 3

Chunk 2Chunk 4

Chunk 6

Chunk 4Chunk 2

Chunk 5

Chunk 6

Chunk 7

Proxy 2

Case 2: Server/Proxy/Client (Unlimited Buffer)

Page 9: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Case 2: Server/Proxy/Client (Unlimited Buffer)

At the Proxy- Receives the chunks from Server, no ACK (server push content)- Receives requests from Client and sends requested chunk to client

At the Client- Uses mutex, conditional variables for the buffer- Requests for video chunk

Page 10: MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.

Case 3: Server/Proxy/Client (Limited Buffer)

At the Client side:- Use a circular buffer- Use mutex, conditional variables for the buffer- Head pointer is to write- Tail pointer is to display- If writing speed is faster than the displaying speed, anytime head and tail point to the same cell, head stops and notify the proxy