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

Kostya kostya.shishkov
Thu Jul 23 05:34:13 CEST 2009


On Wed, Jul 22, 2009 at 12:01:46PM +0200, Michael Niedermayer wrote:
> On Wed, Jul 22, 2009 at 07:58:05AM +0300, Kostya wrote:
> > On Tue, Jul 21, 2009 at 11:30:26PM +0200, Michael Niedermayer wrote:
> > > On Tue, Jul 21, 2009 at 11:04:09AM +0300, Kostya wrote:
> > > > On Mon, Jul 20, 2009 at 05:05:41PM +0200, Michael Niedermayer wrote:
> > > > > On Sat, Jul 18, 2009 at 08:01:17PM +0300, Kostya wrote:
> > > > > > On Sat, Jul 18, 2009 at 11:29:34AM +0200, Michael Niedermayer wrote:
> > > > > > > On Fri, Jul 17, 2009 at 06:38:46PM +0300, Kostya wrote:
[...]
> 
> 
> > I think current initialization
> > for it is clearer. 
> 
> hmm, do you think :
> 
> uint8_t tosend    [RTMP_HANDSHAKE_PACKET_SIZE+1]={
>     3,
>     0,0,0,0,
>     RTMP_CLIENT_VER1,
>     RTMP_CLIENT_VER2,
>     RTMP_CLIENT_VER3,
>     RTMP_CLIENT_VER4,
> };
> 
> is worse? to me it looks clearer ...
 
done
 
> [...]
> > > [...]
> > > > +static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
> > > > +{
> > > > +    int i, t;
> > > > +
> > > > +    switch (pkt->type) {
> > > > +    case RTMP_PT_CHUNK_SIZE:
> > > > +        if (pkt->data_size != 4) {
> > > > +            //av_log(s, AV_LOG_ERROR, "Chunk size change packet is not 4 (%d)\n",
> > > > +            //       pkt->data_size);
> > > > +            return -1;
> > > > +        }
> > > > +        rt->chunk_size = AV_RB32(pkt->data);
> > > > +        if (rt->chunk_size <= 0) {
> > > > +            //av_log(s, AV_LOG_ERROR, "Incorrect chunk size %d\n", rt->chunk_size);
> > > > +            return -1;
> > > > +        }
> > > 
> > > this leaves an invalid chunk_size in the context, is it guranteed that its 
> > > not used?
> > 
> > Yes, it will return EIO in packet_read(). 
> 
> and we hope that no future calls happen after that?

Well, IIRC lavf should stop reading after EIO received and in my code it
will return that error after first bad read (both in init and main loop). 

> [...]
> > > [...]
> > > > +URLProtocol rtmp_protocol = {
> > > > +    "rtmp",
> > > > +    rtmp_open,
> > > > +    rtmp_read,
> > > > +    rtmp_write,
> > > > +    NULL, /* seek */
> > > 
> > > speaking of seeking, doesnt rtmp support seeking of some kind?
> > 
> > It does, the question is how to invoke it since it requires sending a
> > command to server "seek to Nth second" and FLV demuxer does not know
> > about that.
> > 
> > Can we introduce protocol-aware seeking, i.e. seek() call from demuxer
> > will try to call such seek and if it fails - generic one.
> 
> we possibly will have to add something somewhere ...
> i think this or a similar discussion occured already in the context of
> some other network stuff, maybe someone remembers what/if we decided
> something there?

Well, I remember only short discussion at SoC list, IIRC Ronald thought
it would be nice to have it also for RTP-ASF or something.

> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtmp.patch
Type: text/x-diff
Size: 42790 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090723/d53186b7/attachment.patch>



More information about the ffmpeg-devel mailing list