Go to the documentation of this file.
38 #define CHUNK_HEADER_LENGTH 4 // 2bytes chunk type and 2bytes chunk length.
39 #define EXT_HEADER_LENGTH 8 // 4bytes sequence, 2bytes useless and 2bytes chunk length.
42 #define USERAGENT "User-Agent: NSPlayer/4.1.0.3856\r\n"
45 #define CLIENTGUID "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}\r\n"
81 int chunk_len, res, ext_header_len;
88 chunk_type =
AV_RL16(chunk_header);
89 chunk_len =
AV_RL16(chunk_header + 2);
106 if (res != ext_header_len) {
110 *
len = chunk_len - ext_header_len;
122 "Data packet length %d exceeds the in_buffer size %"SIZE_SPECIFIER"\n",
174 "Asf header packet len = %d exceed the asf header buf size %d\n",
181 "Recv asf header data len %d != expected len %d\n", res,
len);
197 "Other packet len = %d exceed the in_buffer size %"SIZE_SPECIFIER"\n",
217 char httpname[256], path[256], host[128];
218 char *stream_selection =
NULL;
228 host,
sizeof(host), &port, path,
sizeof(path), mmsh->
location);
231 ff_url_join(httpname,
sizeof(httpname),
"http",
NULL, host, port,
"%s", path);
234 &
h->interrupt_callback) < 0) {
242 "Pragma: no-cache,rate=1.000000,stream-time=0,"
243 "stream-offset=0:0,request-context=%u,max-duration=0\r\n"
245 "Connection: Close\r\n",
271 &
h->interrupt_callback)) < 0) {
275 if (!stream_selection)
289 "Pragma: no-cache,rate=1.000000,request-context=%u\r\n"
290 "Pragma: xPlayStrm=1\r\n"
292 "Pragma: stream-switch-count=%d\r\n"
293 "Pragma: stream-switch-entry=%s\r\n"
294 "Pragma: no-cache,rate=1.000000,stream-time=%u"
295 "Connection: Close\r\n",
337 switch (chunk_type) {
377 int64_t timestamp,
int flags)
389 h->priv_data = mmsh_old;
395 h->priv_data = mmsh_old;
407 if(pos == 0 && whence == SEEK_CUR)
421 .default_whitelist =
"http,tcp",
static int handle_chunk_type(MMSHContext *mmsh)
static ChunkType get_chunk_header(MMSHContext *mmsh, int *len)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define CHUNK_HEADER_LENGTH
#define URL_PROTOCOL_FLAG_NETWORK
@ CHUNK_TYPE_STREAM_CHANGE
int header_parsed
The header has been received and parsed.
uint8_t * asf_header
Internal handling of the ASF header.
int ffurl_close(URLContext *h)
static int mmsh_open(URLContext *h, const char *uri, int flags)
int stream_num
stream numbers.
int ffurl_connect(URLContext *uc, AVDictionary **options)
Connect an URLContext that has been allocated by ffurl_alloc.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int ff_mms_asf_header_parser(MMSContext *mms)
int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
uint8_t in_buffer[65536]
Buffer for incoming packets.
static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int timestamp, int64_t pos)
const char * protocol_whitelist
const URLProtocol ff_mmsh_protocol
int request_seq
request packet sequence
static int read_data_packet(MMSHContext *mmsh, const int len)
static int64_t mmsh_seek(URLContext *h, int64_t pos, int whence)
int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size)
int remaining_in_len
Reading length from incoming buffer.
static int64_t mmsh_read_seek(URLContext *h, int stream_index, int64_t timestamp, int flags)
static int mmsh_close(URLContext *h)
int ffurl_alloc(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb)
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connectio...
#define i(width, name, range_min, range_max)
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
FFmpeg currently uses a custom build this text attempts to document some of its obscure features and options Makefile the full command issued by make and its output will be shown on the screen DBG Preprocess x86 external assembler files to a dbg asm file in the object which then gets compiled Helps in developing those assembler files DESTDIR Destination directory for the install useful to prepare packages or install FFmpeg in cross environments GEN Set to ‘1’ to generate the missing or mismatched references Makefile builds all the libraries and the executables fate Run the fate test note that you must have installed it fate list List all fate regression test targets install Install headers
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes,...
static int mmsh_read(URLContext *h, uint8_t *buf, int size)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
#define EXT_HEADER_LENGTH
static int get_http_header_data(MMSHContext *mmsh)
int asf_header_size
Size of stored ASF header.
#define AVIO_FLAG_READ
read-only
int chunk_seq
data packet sequence
char * av_strdup(const char *s)
Duplicate a string.
int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
Read as many bytes as possible (up to size), calling the read function multiple times if necessary.
#define flags(name, subs,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
URLContext * mms_hd
TCP connection handle.
uint8_t * read_in_ptr
Pointer for reading from incoming buffer.