2013-11-03 20:11:37 +01:00
|
|
|
|
2012-05-07 13:41:03 +02:00
|
|
|
/*
|
2013-11-03 20:11:37 +01:00
|
|
|
* Copyright (C) Roman Arutyunyan
|
2012-05-07 13:41:03 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _NGX_RTMP_LIVE_H_INCLUDED_
|
|
|
|
#define _NGX_RTMP_LIVE_H_INCLUDED_
|
|
|
|
|
|
|
|
|
2013-06-11 19:00:39 +02:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
2012-05-07 13:41:03 +02:00
|
|
|
#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"
|
2012-08-24 18:46:40 +02:00
|
|
|
#include "ngx_rtmp_streams.h"
|
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;
|
|
|
|
|
|
|
|
|
2012-10-27 15:39:04 +02:00
|
|
|
typedef struct {
|
|
|
|
unsigned active:1;
|
|
|
|
uint32_t timestamp;
|
|
|
|
uint32_t csid;
|
2012-10-28 12:10:12 +01:00
|
|
|
uint32_t dropped;
|
2012-10-27 15:39:04 +02:00
|
|
|
} ngx_rtmp_live_chunk_stream_t;
|
|
|
|
|
|
|
|
|
2012-05-07 13:41:03 +02:00
|
|
|
struct ngx_rtmp_live_ctx_s {
|
|
|
|
ngx_rtmp_session_t *session;
|
|
|
|
ngx_rtmp_live_stream_t *stream;
|
|
|
|
ngx_rtmp_live_ctx_t *next;
|
2012-10-28 12:10:12 +01:00
|
|
|
ngx_uint_t ndropped;
|
2012-10-27 15:39:04 +02:00
|
|
|
ngx_rtmp_live_chunk_stream_t cs[2];
|
2012-07-02 11:42:56 +02:00
|
|
|
ngx_uint_t meta_version;
|
2012-11-16 12:20:00 +01:00
|
|
|
ngx_event_t idle_evt;
|
2012-11-12 21:22:57 +01:00
|
|
|
unsigned active:1;
|
|
|
|
unsigned publishing:1;
|
|
|
|
unsigned silent:1;
|
2012-11-14 13:35:59 +01:00
|
|
|
unsigned paused:1;
|
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_rtmp_bandwidth_t bw_in;
|
2013-12-23 17:24:40 +01:00
|
|
|
ngx_rtmp_bandwidth_t bw_in_audio;
|
|
|
|
ngx_rtmp_bandwidth_t bw_in_video;
|
2012-05-07 13:41:03 +02:00
|
|
|
ngx_rtmp_bandwidth_t bw_out;
|
2012-05-25 14:34:42 +02:00
|
|
|
ngx_msec_t epoch;
|
2012-11-12 21:22:57 +01:00
|
|
|
unsigned active:1;
|
|
|
|
unsigned publishing:1;
|
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-08-30 16:40:12 +02:00
|
|
|
ngx_msec_t sync;
|
2012-11-16 12:20:00 +01:00
|
|
|
ngx_msec_t idle_timeout;
|
2012-09-30 14:12:46 +02:00
|
|
|
ngx_flag_t atc;
|
2012-10-09 22:27:44 +02:00
|
|
|
ngx_flag_t interleave;
|
2012-10-27 18:47:35 +02:00
|
|
|
ngx_flag_t wait_key;
|
2012-12-07 14:15:24 +01:00
|
|
|
ngx_flag_t wait_video;
|
2012-11-13 06:33:20 +01:00
|
|
|
ngx_flag_t publish_notify;
|
|
|
|
ngx_flag_t play_restart;
|
2013-11-07 16:14:01 +01:00
|
|
|
ngx_flag_t idle_streams;
|
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_ */
|