2012-05-07 13:41:03 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2012 Roman Arutyunyan
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _NGX_RTMP_LIVE_H_INCLUDED_
|
|
|
|
#define _NGX_RTMP_LIVE_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include "ngx_rtmp.h"
|
2012-06-09 17:22:18 +02:00
|
|
|
#include "ngx_rtmp_cmd_module.h"
|
2012-05-07 13:41:03 +02:00
|
|
|
#include "ngx_rtmp_bandwidth.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* session flags */
|
|
|
|
#define NGX_RTMP_LIVE_PUBLISHING 0x01
|
|
|
|
|
|
|
|
|
2012-06-09 17:22:18 +02:00
|
|
|
/* Chunk stream ids for output */
|
2012-07-04 22:18:00 +02:00
|
|
|
#define NGX_RTMP_LIVE_CSID_META 5
|
2012-06-09 17:22:18 +02:00
|
|
|
#define NGX_RTMP_LIVE_CSID_AUDIO 6
|
|
|
|
#define NGX_RTMP_LIVE_CSID_VIDEO 7
|
|
|
|
#define NGX_RTMP_LIVE_MSID 1
|
|
|
|
|
|
|
|
|
2012-05-07 13:41:03 +02:00
|
|
|
typedef struct ngx_rtmp_live_ctx_s ngx_rtmp_live_ctx_t;
|
|
|
|
typedef struct ngx_rtmp_live_stream_s ngx_rtmp_live_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 msg_mask;
|
|
|
|
ngx_uint_t dropped;
|
|
|
|
uint32_t csid;
|
|
|
|
uint32_t next_push;
|
|
|
|
uint32_t last_audio;
|
|
|
|
uint32_t last_video;
|
2012-06-13 15:35:48 +02:00
|
|
|
ngx_uint_t aac_version;
|
|
|
|
ngx_uint_t avc_version;
|
2012-07-02 11:42:56 +02:00
|
|
|
ngx_uint_t meta_version;
|
2012-05-07 13:41:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct ngx_rtmp_live_stream_s {
|
2012-06-09 17:22:18 +02:00
|
|
|
u_char name[NGX_RTMP_MAX_NAME];
|
2012-05-07 13:41:03 +02:00
|
|
|
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;
|
2012-05-25 14:34:42 +02:00
|
|
|
ngx_msec_t epoch;
|
2012-05-07 13:41:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ngx_int_t nbuckets;
|
|
|
|
ngx_rtmp_live_stream_t **streams;
|
|
|
|
ngx_flag_t live;
|
2012-07-03 15:53:41 +02:00
|
|
|
ngx_flag_t meta;
|
2012-05-07 13:41:03 +02:00
|
|
|
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_ */
|