68 #define KJpegCh1ScanDataLen 32
69 #define KJpegCh2ScanDataLen 56
73 0xf8, 0xbe, 0x8a, 0x28, 0xaf, 0xe5, 0x33, 0xfd,
74 0xfc, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
75 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
76 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
77 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
78 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
79 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x3f, 0xff, 0xd9
82 0xf5, 0x8a, 0x28, 0xa2, 0xbf, 0xca, 0xf3, 0xfc,
83 0x53, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
84 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
85 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
86 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
87 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2,
88 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x3f, 0xff, 0xd9
106 rtp_packet_send(udp,
JpegScanDataCh2A,
KJpegCh2ScanDataLen, framecounter, timecounter, 0, 1, 64, 48, format_code,
109 rtp_packet_send(udp,
JpegScanDataCh2B,
KJpegCh2ScanDataLen, framecounter, timecounter, 0, 1, 64, 48, format_code,
134 *rtp_time_counter += ((
uint32_t) (90000.0f / average_frame_rate));
136 #define MAX_PACKET_SIZE 1400
139 for (; jpeg_size > 0;) {
143 if (jpeg_size <= len) {
148 rtp_packet_send(udp, jpeg_ptr, len, *packet_number, *rtp_time_counter, offset, lastpacket, img->
w, img->
h, format_code,
149 quality_code, has_dri_header);
187 #define KRtpHeaderSize 12 // size of the RTP header
188 #define KJpegHeaderSize 8 // size of the special JPEG payload header
193 memset(RtpBuf, 0x00,
sizeof(RtpBuf));
214 RtpBuf[1] = 0x1a + (marker_bit << 7);
215 RtpBuf[2] = m_SequenceNumber >> 8;
216 RtpBuf[3] = m_SequenceNumber & 0x0FF;
217 RtpBuf[4] = (m_Timestamp & 0xFF000000) >> 24;
218 RtpBuf[5] = (m_Timestamp & 0x00FF0000) >> 16;
219 RtpBuf[6] = (m_Timestamp & 0x0000FF00) >> 8;
220 RtpBuf[7] = (m_Timestamp & 0x000000FF);
241 RtpBuf[13] = (m_offset & 0x00FF0000) >> 16;
242 RtpBuf[14] = (m_offset & 0x0000FF00) >> 8;
243 RtpBuf[15] = (m_offset & 0x000000FF);
246 RtpBuf[16] = format_code;
247 if (has_dri_header) {
250 RtpBuf[17] = quality_code;
254 memcpy(&RtpBuf[20], Jpeg, JpegLen);
int udp_socket_send_dontwait(struct UdpSocket *sock, uint8_t *buffer, uint32_t len)
Send a packet from buffer, non-blocking.
uint32_t buf_size
The buffer size.
static void rtp_packet_send(struct UdpSocket *udp, uint8_t *Jpeg, int JpegLen, uint16_t m_SequenceNumber, uint32_t m_Timestamp, uint32_t m_offset, uint8_t marker_bit, int w, int h, uint8_t format_code, uint8_t quality_code, uint8_t has_dri_header)
#define KJpegCh2ScanDataLen
void rtp_frame_send(struct UdpSocket *udp, struct image_t *img, uint8_t format_code, uint8_t quality_code, uint8_t has_dri_header, float average_frame_rate, uint16_t *packet_number, uint32_t *rtp_time_counter)
Send an RTP frame.
static const float offset[]
void * buf
Image buffer (depending on the image_type)
uint8_t JpegScanDataCh2A[KJpegCh2ScanDataLen]
static void h(const real32_T x[7], const real32_T q[4], real32_T y[6])
uint8_t JpegScanDataCh2B[KJpegCh2ScanDataLen]
Encodes a video stream with RTP Format 26 (Motion JPEG)
void rtp_frame_test(struct UdpSocket *udp)
Send a test RTP frame.