inline -> ngx_inline

This commit is contained in:
Roman Arutyunyan
2013-06-11 21:03:45 +04:00
parent f94fcee9fb
commit 8553cf204b
3 changed files with 9 additions and 8 deletions

View File

@ -391,21 +391,21 @@ void * ngx_rtmp_rmemcpy(void *dst, const void* src, size_t n);
(((u_char*)ngx_rtmp_rmemcpy(dst, src, n)) + (n)) (((u_char*)ngx_rtmp_rmemcpy(dst, src, n)) + (n))
static inline uint16_t static ngx_inline uint16_t
ngx_rtmp_r16(uint16_t n) ngx_rtmp_r16(uint16_t n)
{ {
return (n << 8) | (n >> 8); return (n << 8) | (n >> 8);
} }
static inline uint32_t static ngx_inline uint32_t
ngx_rtmp_r32(uint32_t n) ngx_rtmp_r32(uint32_t n)
{ {
return (n << 24) | ((n << 8) & 0xff0000) | ((n >> 8) & 0xff00) | (n >> 24); return (n << 24) | ((n << 8) & 0xff0000) | ((n >> 8) & 0xff00) | (n >> 24);
} }
static inline uint64_t static ngx_inline uint64_t
ngx_rtmp_r64(uint64_t n) ngx_rtmp_r64(uint64_t n)
{ {
return (uint64_t) ngx_rtmp_r32(n) << 32 | ngx_rtmp_r32(n >> 32); return (uint64_t) ngx_rtmp_r32(n) << 32 | ngx_rtmp_r32(n >> 32);
@ -557,14 +557,14 @@ ngx_int_t ngx_rtmp_send_sample_access(ngx_rtmp_session_t *s);
#define NGX_RTMP_VIDEO_DISPOSABLE_FRAME 3 #define NGX_RTMP_VIDEO_DISPOSABLE_FRAME 3
static inline ngx_int_t static ngx_inline ngx_int_t
ngx_rtmp_get_video_frame_type(ngx_chain_t *in) ngx_rtmp_get_video_frame_type(ngx_chain_t *in)
{ {
return (in->buf->pos[0] & 0xf0) >> 4; return (in->buf->pos[0] & 0xf0) >> 4;
} }
static inline ngx_int_t static ngx_inline ngx_int_t
ngx_rtmp_is_codec_header(ngx_chain_t *in) ngx_rtmp_is_codec_header(ngx_chain_t *in)
{ {
return in->buf->pos + 1 < in->buf->last && in->buf->pos[1] == 0; return in->buf->pos + 1 < in->buf->last && in->buf->pos[1] == 0;

View File

@ -9,7 +9,8 @@
#include "ngx_rtmp.h" #include "ngx_rtmp.h"
#include <string.h> #include <string.h>
static inline void*
static ngx_inline void*
ngx_rtmp_amf_reverse_copy(void *dst, void* src, size_t len) ngx_rtmp_amf_reverse_copy(void *dst, void* src, size_t len)
{ {
size_t k; size_t k;

View File

@ -187,14 +187,14 @@ typedef struct {
((uint32_t)d << 24 | (uint32_t)c << 16 | (uint32_t)b << 8 | (uint32_t)a) ((uint32_t)d << 24 | (uint32_t)c << 16 | (uint32_t)b << 8 | (uint32_t)a)
static inline uint32_t static ngx_inline uint32_t
ngx_rtmp_mp4_to_rtmp_timestamp(ngx_rtmp_mp4_track_t *t, uint32_t ts) ngx_rtmp_mp4_to_rtmp_timestamp(ngx_rtmp_mp4_track_t *t, uint32_t ts)
{ {
return (uint64_t) ts * 1000 / t->time_scale; return (uint64_t) ts * 1000 / t->time_scale;
} }
static inline uint32_t static ngx_inline uint32_t
ngx_rtmp_mp4_from_rtmp_timestamp(ngx_rtmp_mp4_track_t *t, uint32_t ts) ngx_rtmp_mp4_from_rtmp_timestamp(ngx_rtmp_mp4_track_t *t, uint32_t ts)
{ {
return (uint64_t) ts * t->time_scale / 1000; return (uint64_t) ts * t->time_scale / 1000;