multimedia/device/rtp.h

42 lines
1.2 KiB
C
Raw Normal View History

2019-09-13 18:31:51 +00:00
#ifndef __RTP_PACK__
#define __RTP_PACK__
#pragma pack(1)//设定为1字节对齐
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
#include "thirdparty/librtsp_c/librtsp.h"
#include "rtsp.h"
typedef struct {
unsigned char cc:4; /* CSRC count */
unsigned char x:1; /* header extension flag */
unsigned char p:1; /* padding flag */
unsigned char version:2; /* protocol version */
unsigned char pt:7; /* payload type */
unsigned char m:1; /* marker bit */
unsigned short seq; /* sequence number */
unsigned int ts; /* timestamp */
unsigned int ssrc; /* synchronization source */
} CRtpHeader;
typedef struct {
unsigned char FUType:5;
unsigned char NRI:2;
unsigned char F:1;
}FuIdentifier;
typedef struct {
unsigned char NALUnitType:5;
unsigned char Forbid:1;
unsigned char End:1;
unsigned char Start:1;
}FuHeader;
typedef struct {
FuIdentifier Identifier;
FuHeader Header;
} CH264NalUnit;
#pragma pack(4)//设定为4字节对齐
#define MAX_RTP_LEN 1001
int Pack264(unsigned char *frame,int size, unsigned char *outbuf[]);
#endif