yading@11: /* yading@11: * MMS protocol common definitions. yading@11: * Copyright (c) 2010 Zhentan Feng yading@11: * yading@11: * This file is part of FFmpeg. yading@11: * yading@11: * FFmpeg is free software; you can redistribute it and/or yading@11: * modify it under the terms of the GNU Lesser General Public yading@11: * License as published by the Free Software Foundation; either yading@11: * version 2.1 of the License, or (at your option) any later version. yading@11: * yading@11: * FFmpeg is distributed in the hope that it will be useful, yading@11: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@11: * Lesser General Public License for more details. yading@11: * yading@11: * You should have received a copy of the GNU Lesser General Public yading@11: * License along with FFmpeg; if not, write to the Free Software yading@11: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@11: */ yading@11: #ifndef AVFORMAT_MMS_H yading@11: #define AVFORMAT_MMS_H yading@11: yading@11: #include "url.h" yading@11: yading@11: typedef struct MMSStream { yading@11: int id; yading@11: }MMSStream; yading@11: yading@11: typedef struct MMSContext { yading@11: URLContext *mms_hd; ///< TCP connection handle yading@11: MMSStream *streams; yading@11: yading@11: /** Buffer for outgoing packets. */ yading@11: /*@{*/ yading@11: uint8_t *write_out_ptr; ///< Pointer for writing the buffer. yading@11: uint8_t out_buffer[512]; ///< Buffer for outgoing packet. yading@11: /*@}*/ yading@11: yading@11: /** Buffer for incoming packets. */ yading@11: /*@{*/ yading@11: uint8_t in_buffer[65536]; ///< Buffer for incoming packets. yading@11: uint8_t *read_in_ptr; ///< Pointer for reading from incoming buffer. yading@11: int remaining_in_len; ///< Reading length from incoming buffer. yading@11: /*@}*/ yading@11: yading@11: /** Internal handling of the ASF header */ yading@11: /*@{*/ yading@11: uint8_t *asf_header; ///< Stored ASF header. yading@11: int asf_header_size; ///< Size of stored ASF header. yading@11: int header_parsed; ///< The header has been received and parsed. yading@11: int asf_packet_len; yading@11: int asf_header_read_size; yading@11: /*@}*/ yading@11: yading@11: int stream_num; ///< stream numbers. yading@11: unsigned int nb_streams_allocated; ///< allocated size of streams yading@11: } MMSContext; yading@11: yading@11: int ff_mms_asf_header_parser(MMSContext * mms); yading@11: int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size); yading@11: int ff_mms_read_header(MMSContext * mms, uint8_t * buf, const int size); yading@11: yading@11: #endif /* AVFORMAT_MMS_H */