mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 18:12:22 +00:00
6ac4f22567
Patch by flo/yepyep <flodt8@yahoo.de>. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10282 b3059339-0415-0410-9bf9-f77b7e298cf2
37 lines
1.3 KiB
C
37 lines
1.3 KiB
C
#ifndef _RTP_H
|
|
#define _RTP_H
|
|
|
|
#include "config.h"
|
|
#ifndef HAVE_WINSOCK2
|
|
#include <sys/socket.h>
|
|
#else
|
|
#include <winsock2.h>
|
|
#endif
|
|
|
|
struct rtpbits {
|
|
unsigned int v:2; /* version: 2 */
|
|
unsigned int p:1; /* is there padding appended: 0 */
|
|
unsigned int x:1; /* number of extension headers: 0 */
|
|
unsigned int cc:4; /* number of CSRC identifiers: 0 */
|
|
unsigned int m:1; /* marker: 0 */
|
|
unsigned int pt:7; /* payload type: 33 for MPEG2 TS - RFC 1890 */
|
|
unsigned int sequence:16; /* sequence number: random */
|
|
};
|
|
|
|
struct rtpheader { /* in network byte order */
|
|
struct rtpbits b;
|
|
int timestamp; /* start: random */
|
|
int ssrc; /* random */
|
|
};
|
|
|
|
|
|
void initrtp(struct rtpheader *foo); /* fill in the MPEG-2 TS deefaults */
|
|
int sendrtp(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
|
|
int getrtp2(int fd, struct rtpheader *rh, char** data, int* lengthData);
|
|
int sendrtp2(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
|
|
int getrtp(int fd, struct rtpheader *rh, char** data, int* lengthData);
|
|
int makesocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
|
|
int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
|
|
|
|
#endif
|