1 Star 2 Fork 2

cM / mjpeg2rtp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mjpegencode.h 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
daixj 提交于 2015-01-08 09:27 . 传输视频ok
#ifndef __JPEGENCODE_H__
#define __JPEGENCODE_H__
#if 0
typedef struct {
unsigned int version:2; /* protocol version */
unsigned int p:1; /* padding flag */
unsigned int x:1; /* header extension flag */
unsigned int cc:4; /* CSRC count */
unsigned int m:1; /* marker bit */
unsigned int pt:7; /* payload type */
unsigned short seq; /* sequence number */
unsigned long ts; /* timestamp */
unsigned long ssrc; /* synchronization source */
unsigned long csrc[1]; /* optional CSRC list */
} rtp_hdr_t;
#endif
typedef struct {
unsigned char cc:4;
unsigned char x:1;
unsigned char p:1;
unsigned char version:2;
unsigned char pt:7;
unsigned char m:1;
unsigned short seq;
unsigned int ts;
unsigned int ssrc;
}rtp_hdr_t;
#define RTP_HDR_SZ 12
/* The following definition is from RFC1890 */
#define RTP_PT_JPEG 26
struct jpeghdr {
unsigned int tspec:8; /* type-specific field */
unsigned int off:24; /* fragment byte offset */
unsigned char type; /* id of jpeg decoder params */
unsigned char q; /* quantization factor (or table id) */
unsigned char width; /* frame width in 8 pixel blocks */
unsigned char height; /* frame height in 8 pixel blocks */
};
struct jpeghdr_rst{
unsigned short dri;
unsigned int f:1;
unsigned int l:1;
unsigned int count:14;
};
struct jpeghdr_qtable {
unsigned char mbz;
unsigned char precision;
unsigned short length;
};
#define RTP_JPEG_RESTART 0x40
void encode_jpeg_420(unsigned char *start,int w,int h);
void encode_jpeg();
void closefile();
#endif
C
1
https://gitee.com/OpenWrt-X/mjpeg2rtp.git
git@gitee.com:OpenWrt-X/mjpeg2rtp.git
OpenWrt-X
mjpeg2rtp
mjpeg2rtp
master

搜索帮助