added AMF shortcuts & project-wide stream numbers; updated mp4 streamer

This commit is contained in:
Roman Arutyunyan
2012-08-24 20:46:40 +04:00
parent f22e72ab21
commit a92d23d530
7 changed files with 173 additions and 98 deletions

View File

@ -375,6 +375,27 @@ void * ngx_rtmp_rmemcpy(void *dst, const void* src, size_t n);
(((u_char*)ngx_rtmp_rmemcpy(dst, src, n)) + (n))
static inline uint16_t
ngx_rtmp_r16(uint16_t n)
{
return (n << 8) | (n >> 8);
}
static inline uint32_t
ngx_rtmp_r32(uint32_t n)
{
return (n << 24) | ((n << 8) & 0xff0000) | ((n >> 8) & 0xff00) | (n >> 24);
}
static inline uint64_t
ngx_rtmp_r64(uint64_t n)
{
return (uint64_t) ngx_rtmp_r32(n) << 32 | ngx_rtmp_r32(n >> 32);
}
/* Receiving messages */
ngx_int_t ngx_rtmp_protocol_message_handler(ngx_rtmp_session_t *s,
ngx_rtmp_header_t *h, ngx_chain_t *in);
@ -469,6 +490,10 @@ ngx_int_t ngx_rtmp_send_amf(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_int_t ngx_rtmp_receive_amf(ngx_rtmp_session_t *s, ngx_chain_t *in,
ngx_rtmp_amf_elt_t *elts, size_t nelts);
/* AMF status sender */
ngx_int_t ngx_rtmp_send_status(ngx_rtmp_session_t *s, char *code,
char* level, char *desc);
/* Frame types */
#define NGX_RTMP_VIDEO_KEY_FRAME 1