[MPlayer-dev-eng] rtmpe support
Diego Biurrun
diego at biurrun.de
Fri Mar 12 12:41:25 CET 2010
On Thu, Mar 11, 2010 at 11:27:57PM -0800, Howard Chu wrote:
> I've written the attached module to let mplayer use rtmpdump's librtmp.
.. some comments ..
> #include "stream.h"
> #include "m_option.h"
> #include "m_struct.h"
> #include "libmpdemux/demuxer.h"
> #undef closesocket /* silence warning */
What warning?
> static struct rtmp_params {
> AVal swfUrl;
> AVal pageUrl;
> AVal tcUrl;
> AVal app;
> AVal playpath;
> AVal token;
> int isLive;
> int swfVerify;
Please use 4 spaces indentation for new files.
> #define ST_OFF(f) M_ST_OFF(struct rtmp_params,f)
> static const m_option_t rtmp_params_fields[] = {
> { "swfurl", ST_OFF(swfUrl), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "pageurl", ST_OFF(pageUrl), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "tcurl", ST_OFF(tcUrl), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "app", ST_OFF(app), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "playpath", ST_OFF(playpath), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "token", ST_OFF(token), CONF_TYPE_STRING, 0, 0, 0, NULL },
> { "islive", ST_OFF(isLive), CONF_TYPE_FLAG, 0, 0, 1, NULL },
> { "swfverify", ST_OFF(swfVerify), CONF_TYPE_FLAG, 0, 0, 1, NULL },
extra good karma for aligning this
> static int
> rtmp_stream_read (stream_t *s, char *buffer, int size)
Please use K&R style, i.e. keep the type on the same line as the
function name.
> switch(cmd)
> {
K&R style: switch (cmd) {
> mp_msg (MSGT_OPEN, MSGL_INFO, "STREAM_RTMP, URL: %s\n", stream->url);
> if (mode != STREAM_READ)
> {
ditto
.. more below ..
> if (p->swfUrl.av_val) p->swfUrl.av_len = strlen(p->swfUrl.av_val);
> if (p->pageUrl.av_val) p->pageUrl.av_len = strlen(p->pageUrl.av_val);
> if (p->tcUrl.av_val) p->tcUrl.av_len = strlen(p->tcUrl.av_val);
> if (p->app.av_val) p->app.av_len = strlen(p->app.av_val);
> if (p->playpath.av_val) p->playpath.av_len = strlen(p->playpath.av_val);
> if (p->token.av_val) p->token.av_len = strlen(p->token.av_val);
Please break those lines.
> } else
> {
} else {
> p->playpath = playpath;
> }
> playpath.av_val = NULL;
> playpath.av_len = 0;
Indentation is off.
> stream->priv = r;
> stream->type = STREAMTYPE_STREAM;
> stream->fill_buffer = rtmp_stream_read;
> stream->control = rtmp_stream_ctrl;
> stream->close = rtmp_stream_close;
align
Diego
More information about the MPlayer-dev-eng
mailing list