[FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server

Michael Niedermayer michaelni at gmx.at
Sun Mar 22 00:24:36 CET 2015


On Sat, Mar 21, 2015 at 11:00:09PM +0100, Stephan Holljes wrote:
> Hi,
> 
> this is a patch for a proof-of-concept for an http server.
> 
> Usage on the server side:
> 
> ffmpeg -i test.mp3 -c copy -listen 1 -f mp3 http://0.0.0.0
> 
> Usage on the client side:
> 
> ffplay http://localhost:8080
> 
> I looked at tls.c and tcp.c and copied parts of the code.
> Please comment.
> 
> Regards,
> Stephan Holljes
> 
> ---
>  libavformat/http.c |  113
> ++++++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 83 insertions(+), 30 deletions(-)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index da3c9be..d61e4e2 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -96,8 +96,12 @@ typedef struct HTTPContext {
>      int send_expect_100;
>      char *method;
>      int reconnect;
> +    int listen;
> +    int fd;
> +    int header_sent;
>  } HTTPContext;
> 
> +
>  #define OFFSET(x) offsetof(HTTPContext, x)
>  #define D AV_OPT_FLAG_DECODING_PARAM
>  #define E AV_OPT_FLAG_ENCODING_PARAM
> @@ -127,6 +131,7 @@ static const AVOption options[] = {
>      { "end_offset", "try to limit the request to bytes preceding this
> offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D
> },
>      { "method", "Override the HTTP method", OFFSET(method),
> AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
>      { "reconnect", "auto reconnect after disconnect before EOF",
> OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
> +    { "listen", "listen on HTTP", OFFSET(listen), AV_OPT_TYPE_INT, { .i64
> = 0 }, 0, 1, D },

it appears this patch has been corrupted by extra newlines from
word/line wrap

please resend as an attachment

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150322/b66bfe68/attachment.asc>


More information about the ffmpeg-devel mailing list