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

zhentan feng spyfeng
Wed Mar 24 15:33:01 CET 2010


Hi

On Wed, Mar 24, 2010 at 1:19 AM, Ronald S. Bultje <rsbultje at gmail.com>wrote:

> Hi,
>
> On Tue, Mar 23, 2010 at 12:56 PM, zhentan feng <spyfeng at gmail.com> wrote:
> > I implement MMS protocol over TCP based on other developers' patch.
> > The patch is  against the latest svn trunk and attached below.
> > thanks Ronald's great help.
> [..]
> > Index: libavformat/asfenc.c
> > ===================================================================
> > --- libavformat/asfenc.c      (revision 22644)
> > +++ libavformat/asfenc.c      (working copy)
> > @@ -203,7 +203,7 @@
> >      put_buffer(s, *g, sizeof(*g));
> >  }
> >
> > -static int put_str16_nolen(ByteIOContext *s, const char *tag)
> > +int ff_put_str16_nolen(ByteIOContext *s, const char *tag)
> >  {
> >      const uint8_t *q = tag;
> >      int ret = 0;
> > @@ -228,7 +228,7 @@
> >      if (url_open_dyn_buf(&dyn_buf) < 0)
> >          return;
> >
> > -    put_str16_nolen(dyn_buf, tag);
> > +    ff_put_str16_nolen(dyn_buf, tag);
> >      len = url_close_dyn_buf(dyn_buf, &pb);
> >      put_le16(s, len);
> >      put_buffer(s, pb, len);
> > @@ -361,7 +361,7 @@
> >          hpos = put_header(pb, &ff_asf_comment_header);
> >
> >          for (n = 0; n < FF_ARRAY_ELEMS(tags); n++) {
> > -            len = tags[n] ? put_str16_nolen(dyn_buf, tags[n]->value) :
> 0;
> > +            len = tags[n] ? ff_put_str16_nolen(dyn_buf, tags[n]->value)
> : 0;
> >              put_le16(pb, len);
> >          }
> >          len = url_close_dyn_buf(dyn_buf, &buf);
> > @@ -489,7 +489,7 @@
> >          if ( url_open_dyn_buf(&dyn_buf) < 0)
> >              return AVERROR(ENOMEM);
> >
> > -        put_str16_nolen(dyn_buf, desc);
> > +        ff_put_str16_nolen(dyn_buf, desc);
> >          len = url_close_dyn_buf(dyn_buf, &buf);
> >          put_le16(pb, len / 2); // "number of characters" = length in
> bytes / 2
> >
> > Index: libavformat/asf.h
> > ===================================================================
> > --- libavformat/asf.h (revision 22644)
> > +++ libavformat/asf.h (working copy)
> > @@ -230,4 +230,5 @@
> >
> >  extern AVInputFormat asf_demuxer;
> >
> > +extern int ff_put_str16_nolen(ByteIOContext *s, const char *tag);
> >  #endif /* AVFORMAT_ASF_H */
>
> An alternative here is to move this function to asf.h as an inline
> function, so there's no odd interdependencies.
>
> I modified it as inline function.
see attached patch.

zhentan
-- 
Best wishes~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_fun.patch
Type: application/octet-stream
Size: 2203 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100324/ae617e16/attachment.obj>



More information about the ffmpeg-devel mailing list