nginx-mod-rtmp/ngx_rtmp_live_module.h
2012-10-28 15:10:12 +04:00

74 lines
2.1 KiB
C

/*
* Copyright (c) 2012 Roman Arutyunyan
*/
#ifndef _NGX_RTMP_LIVE_H_INCLUDED_
#define _NGX_RTMP_LIVE_H_INCLUDED_
#include "ngx_rtmp.h"
#include "ngx_rtmp_cmd_module.h"
#include "ngx_rtmp_bandwidth.h"
#include "ngx_rtmp_streams.h"
/* session flags */
#define NGX_RTMP_LIVE_PUBLISHING 0x01
typedef struct ngx_rtmp_live_ctx_s ngx_rtmp_live_ctx_t;
typedef struct ngx_rtmp_live_stream_s ngx_rtmp_live_stream_t;
typedef struct {
unsigned active:1;
uint32_t timestamp;
uint32_t csid;
uint32_t dropped;
} ngx_rtmp_live_chunk_stream_t;
struct ngx_rtmp_live_ctx_s {
ngx_rtmp_session_t *session;
ngx_rtmp_live_stream_t *stream;
ngx_rtmp_live_ctx_t *next;
ngx_uint_t flags;
ngx_uint_t ndropped;
ngx_rtmp_live_chunk_stream_t cs[2];
ngx_uint_t header_versions[2];
ngx_uint_t meta_version;
};
struct ngx_rtmp_live_stream_s {
u_char name[NGX_RTMP_MAX_NAME];
ngx_rtmp_live_stream_t *next;
ngx_rtmp_live_ctx_t *ctx;
ngx_uint_t flags;
ngx_rtmp_bandwidth_t bw_in;
ngx_rtmp_bandwidth_t bw_out;
ngx_msec_t epoch;
};
typedef struct {
ngx_int_t nbuckets;
ngx_rtmp_live_stream_t **streams;
ngx_flag_t live;
ngx_flag_t meta;
ngx_msec_t sync;
ngx_flag_t atc;
ngx_flag_t interleave;
ngx_flag_t wait_key;
ngx_msec_t buflen;
ngx_pool_t *pool;
ngx_rtmp_live_stream_t *free_streams;
} ngx_rtmp_live_app_conf_t;
extern ngx_module_t ngx_rtmp_live_module;
#endif /* _NGX_RTMP_LIVE_H_INCLUDED_ */