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

Stephan Holljes klaxa1337 at googlemail.com
Sun Mar 22 00:33:57 CET 2015


Hi,

what would be the correct way to create patches that won't be corrupted? I
merely tried to copy what I have seen on the mailing-list before,
apparently I didn't do a very good job ;)

Regards,
Stephan Holljes

On Sun, Mar 22, 2015 at 12:24 AM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poc_http_server.patch
Type: text/x-patch
Size: 5875 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150322/88bdad0c/attachment.bin>


More information about the ffmpeg-devel mailing list