[FFmpeg-devel] [PATCH] RTMP client support for lavf

Diego Biurrun diego
Wed Jul 22 15:47:22 CEST 2009


On Wed, Jul 22, 2009 at 10:35:45AM +0300, Kostya wrote:
> On Wed, Jul 22, 2009 at 07:58:05AM +0300, Kostya wrote:
> [...]
> > 
> > patch will be sent later
> 
> And here it is.

> --- libavformat/rtmpproto.c	(revision 0)
> +++ libavformat/rtmpproto.c	(revision 0)
> @@ -0,0 +1,676 @@
> +
> +/** RTMP protocol handler state */
> +typedef enum {
> +    STATE_START,      ///< client has not done anything

client has not done anything yet

> +    int           chunk_size;                 ///< size of chunks packet divided into

size of the chunks the packet is divided into

> +    int           main_channel_id;            ///< an additional channel id which is used for some invokes

ID, invocations

> +/**
> + * Generates 'connect' call and sends it to server.

the server

> + * Generates 'createStream' call and sends it to server. It should make server
> + * allocate some channel for media streams.

ditto, in both places

> +/**
> + * Generates 'play' call and sends it to server, then pings server
> + * to start actual playing.

again

> +/**
> + * Generates ping reply and sends it to server.

guess :)

> +/**
> + * Performs handshake with server by means of exchanging HMAC-SHA2 signed ppseudorangom data.

pseudoranDom, long line

> +/**
> + * Parses received packet and may perform some action depending on packet contents.
> + * @return 0 for no errors, -1 for serious errors which prevent further communications,
> + *         positive values for not critical errors

long lines

s/not critical/uncritical/

> +    switch (pkt->type) {
> +    case RTMP_PT_CHUNK_SIZE:
> +        if (pkt->data_size != 4) {
> +            av_log(LOG_CONTEXT, AV_LOG_ERROR, "Chunk size change packet is not 4 (%d)\n",

4 what?

> +/**
> + * Opens RTMP connection and verifies that stream can be played.

the stream

> + *
> + * URL syntax: rtmp://server[:port][/app][/playpath]
> + *             where 'app' is first one or two directories in the path (/ondemand/, /flash/live/, etc)
> + *             and 'playpath' is file name (the rest of path, may be prefixed with "mp4:")

a filename, the path

> +        av_log(LOG_CONTEXT, AV_LOG_ERROR, "RTMP output is not supported yet\n");

.

> --- libavformat/rtmppkt.c	(revision 0)
> +++ libavformat/rtmppkt.c	(revision 0)
> @@ -0,0 +1,266 @@
> +void ff_amf_write_object_end(uint8_t **dst)
> +{
> +    // first two bytes are field name length = 0, AMF object should end with it and end marker

long line

Diego



More information about the ffmpeg-devel mailing list