2

I am working on a project related to video streaming. I have been reading the http code extensively in the access_output and access modules. My question is regarding how the client asks the server to send more data in the application layer, specifically using http. I assume it is within the httpd file located in the src/network folder, but I have been writing to log files and I can't seem to figure out how the client asks for the data. It really seems like the server just sends it to the client without acknowledgement, but I highly doubt this is the case.

Thank you so much for your help!

Kevin
  • 23
  • 4
  • Do you mean as in **pseudo**-streaming, using HTTP byte-ranges? See http://stackoverflow.com/questions/8293687/sample-http-range-request-session and RFC 7233 https://tools.ietf.org/html/rfc7233. – aergistal Apr 13 '15 at 19:47
  • Yes so on the client side when I seek to an unloaded portion of the video on the server side how does the client tell the server what part of the video to send? Does the client use an HTTP-GET request using queries in httpd.c? – Kevin Apr 26 '15 at 23:08

1 Answers1

0

Requesting more data is achieved using HTTP GET with a Range header.

Examples:

Range: bytes=123-

Range: bytes=123-456

In VLC you can find the relevant code in modules/access/http.c:

static int Request( access_t *p_access, uint64_t i_tell )
{

    [...]

    /* Offset */
    if( p_sys->i_version == 1 && ! p_sys->b_continuous )
    {
        p_sys->b_persist = true;
        net_Printf( p_access, p_sys->fd, pvs,
                    "Range: bytes=%"PRIu64"-\r\n", i_tell );
        net_Printf( p_access, p_sys->fd, pvs, "Connection: close\r\n" );
    }

See also: HTTP Range Requests in the RFC.

Community
  • 1
  • 1
aergistal
  • 29,947
  • 5
  • 70
  • 92
  • So I found that throughout the whole client server interaction there was only one range request: Range: bytes=0- So this means the server is just free to send the whole video to the client without the client requesting more, is this correct? – Kevin Apr 28 '15 at 13:22
  • Yes, and in the case of a **seek** it will issue a new `Range` request starting at the requested offset. – aergistal Apr 28 '15 at 14:57