Download presentation
Presentation is loading. Please wait.
Published byClaribel Walton Modified over 9 years ago
1
MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010
2
Video Server Proxy 1 Stream Movie 2 Movie 1Movie 2 Client CS 414 - Spring 2009 System Overview CS 414 - Spring 2010 Request for Movie 2 Session Control Chunk 1Chunk 7 Chunk 5 Chunk 3 Chunk 1 Chunk 3 Chunk 2 Chunk 4 Chunk 6 Chunk 4 Chunk 2 Chunk 5 Chunk 6 Chunk 7 Proxy 2
3
Control Plan and Data Plan
4
Stream Movie 2 CS 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
5
Stream Movie 2 CS 414 - Spring 2009 Case 1: Server/Client CS 414 - Spring 2010 Video Server Movie 1Movie 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
6
Possible Data Packet Format typedef struct videoPakectT{ int chunkIdx; int datalen; // len of the data content int opt; // various useschar data[VIDEO_PACKET_BUFF_SIZE]; }VideoPacket;
7
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; }
8
Video Server Proxy 1 Stream Movie 2 Movie 1Movie 2 Client CS 414 - Spring 2009 CS 414 - Spring 2010 Session Control Chunk 1Chunk 7 Chunk 5 Chunk 3 Chunk 1 Chunk 3 Chunk 2 Chunk 4 Chunk 6 Chunk 4 Chunk 2 Chunk 5 Chunk 6 Chunk 7 Proxy 2 Case 2: Server/Proxy/Client (Unlimited Buffer)
9
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
10
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
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.