[FFmpeg-devel] [patch]MMS protocol over TCP
zhentan feng
spyfeng
Tue Apr 20 15:24:58 CEST 2010
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.
--
Best wishes~
More information about the ffmpeg-devel
mailing list