[FFmpeg-devel] [patch]MMS protocol over TCP

Michael Niedermayer michaelni
Tue Apr 20 15:54:22 CEST 2010


On Tue, Apr 20, 2010 at 09:24:58PM +0800, zhentan feng wrote:
> Hi
> 
> [...]
> > > +/** Read at most one media packet (or a whole header). */
> > > +static int read_mms_packet(MMSContext *mms, uint8_t *buf, int buf_size)
> > > +{
> > > +    int result = 0;
> > > +    MMSSCPacketType packet_type;
> > > +    int size_to_copy;
> > > +
> > > +    do {
> > > +        if(mms->asf_header_read_pos < mms->asf_header_size) {
> > > +            /* Read from ASF header buffer */
> > > +            size_to_copy= FFMIN(buf_size,
> > > +                                mms->asf_header_size -
> > mms->asf_header_read_pos);
> > > +            memcpy(buf, mms->asf_header + mms->asf_header_read_pos,
> > size_to_copy);
> > > +            mms->asf_header_read_pos += size_to_copy;
> > > +            result += size_to_copy;
> > > +            dprintf(NULL, "Copied %d bytes from stored header. left:
> > %d\n",
> > > +                   size_to_copy, mms->asf_header_size -
> > mms->asf_header_read_pos);
> > > +            av_freep(&mms->asf_header);
> > > +        } else if(mms->pkt_buf_len) {
> > > +            /* Read from media packet buffer */
> > > +            result = read_data(mms, buf, buf_size);
> > > +        } else {
> > > +            /* Read from network */
> > > +            packet_type= get_tcp_server_response(mms);
> > > +            if (packet_type == SC_PKT_ASF_MEDIA) {
> > > +                if(mms->pkt_buf_len>mms->asf_packet_len) {
> >
> > > +                    dprintf(NULL, "Incoming packet"
> >
> > a non null context would be better
> >
> >
> It seems that we have discussed this in the earlier time of  this thread.
> Ronald said that:
> 
> > typedef struct URLContext {
> 
> #if LIBAVFORMAT_VERSION_MAJOR >= 53
> 
>    const AVClass *av_class; ///< information for av_log(). Set by
> > url_open().
> 
> #endif
> 
> 
> > #define LIBAVFORMAT_VERSION_MAJOR 52
> 
> No, not yet.
> 
> 
> IMHO, we can leave it as NULL for now.

yes, sorry, i remember it now

[...]
-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100420/76c86d8c/attachment.pgp>



More information about the ffmpeg-devel mailing list