[MPlayer-dev-eng] rtmpe support

Howard Chu hyc at highlandsun.com
Sat Mar 13 01:00:50 CET 2010


Diego Biurrun wrote:
> 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?

librtmp/rtmp.h has #define closesocket(s)	close(s)
which the compiler complains about since you have #define closesocket	close
in some previous header file. I've moved the #undef to rtmp.h.

> Please use 4 spaces indentation for new files.

Done, used indent -kr.

>> #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

Done.

>>    stream->priv = r;
>>    stream->type = STREAMTYPE_STREAM;
>>    stream->fill_buffer = rtmp_stream_read;
>>    stream->control = rtmp_stream_ctrl;
>>    stream->close = rtmp_stream_close;
>
> align

Done.

After chatting on #mplayerdev with uau and Compn I've implemented the options 
by piggybacking them on the main URL. That's all working well now, but seeking 
is still broken.

But this works:

mplayer 
"rtmpe://cdn-auth.akamai.crackle.com/ondemand/crackle/1/n/sk/6dpvb_306p.mp4 
swfurl=http://crackle.com/flash/CracklePlayer.swf?id=2419511&site=219 
pageurl=http://www.youtube.com/watch?v=yPeNnReBK0A&feature=spotlight swfverify=1"

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stream_rtmp.c
Type: text/x-csrc
Size: 7366 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100312/09d89d36/attachment.c>


More information about the MPlayer-dev-eng mailing list