2013-11-03 20:11:37 +01:00
|
|
|
|
2012-03-23 18:29:22 +01:00
|
|
|
/*
|
2013-11-03 20:11:37 +01:00
|
|
|
* Copyright (C) Roman Arutyunyan
|
2012-03-23 18:29:22 +01:00
|
|
|
*/
|
|
|
|
|
2012-03-27 18:26:43 +02:00
|
|
|
|
2012-03-23 18:29:22 +01:00
|
|
|
#ifndef _NGX_RTMP_CMD_H_INCLUDED_
|
|
|
|
#define _NGX_RTMP_CMD_H_INCLUDED_
|
|
|
|
|
2012-03-27 18:26:43 +02:00
|
|
|
|
2012-03-23 18:29:22 +01:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
#include <ngx_event.h>
|
|
|
|
#include "ngx_rtmp.h"
|
|
|
|
|
|
|
|
|
2016-04-21 10:58:46 +02:00
|
|
|
#define NGX_RTMP_MAX_NAME 2048
|
|
|
|
#define NGX_RTMP_MAX_URL 4096
|
2012-06-20 19:11:03 +02:00
|
|
|
#define NGX_RTMP_MAX_ARGS NGX_RTMP_MAX_NAME
|
2012-06-08 20:57:54 +02:00
|
|
|
|
2012-03-27 18:26:43 +02:00
|
|
|
|
2012-06-08 20:57:54 +02:00
|
|
|
/* Basic RTMP call support */
|
2012-03-27 18:26:43 +02:00
|
|
|
|
|
|
|
typedef struct {
|
2012-04-15 20:47:50 +02:00
|
|
|
double trans;
|
2013-01-28 19:17:19 +01:00
|
|
|
u_char app[NGX_RTMP_MAX_NAME];
|
|
|
|
u_char args[NGX_RTMP_MAX_ARGS];
|
2012-03-30 17:10:01 +02:00
|
|
|
u_char flashver[32];
|
2012-06-08 20:57:54 +02:00
|
|
|
u_char swf_url[NGX_RTMP_MAX_URL];
|
|
|
|
u_char tc_url[NGX_RTMP_MAX_URL];
|
2012-03-27 18:26:43 +02:00
|
|
|
double acodecs;
|
|
|
|
double vcodecs;
|
2012-06-08 20:57:54 +02:00
|
|
|
u_char page_url[NGX_RTMP_MAX_URL];
|
2012-06-10 23:02:53 +02:00
|
|
|
double object_encoding;
|
2012-03-27 18:26:43 +02:00
|
|
|
} ngx_rtmp_connect_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
double trans;
|
|
|
|
double stream;
|
|
|
|
} ngx_rtmp_create_stream_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
double stream;
|
|
|
|
} ngx_rtmp_delete_stream_t;
|
2012-03-23 18:29:22 +01:00
|
|
|
|
|
|
|
|
2012-06-25 14:22:42 +02:00
|
|
|
typedef struct {
|
|
|
|
double stream;
|
|
|
|
} ngx_rtmp_close_stream_t;
|
|
|
|
|
|
|
|
|
2012-03-27 18:26:43 +02:00
|
|
|
typedef struct {
|
2012-06-08 20:57:54 +02:00
|
|
|
u_char name[NGX_RTMP_MAX_NAME];
|
2012-06-20 19:11:03 +02:00
|
|
|
u_char args[NGX_RTMP_MAX_ARGS];
|
2012-03-30 17:07:14 +02:00
|
|
|
u_char type[16];
|
2012-05-22 20:53:35 +02:00
|
|
|
int silent;
|
2012-03-27 18:26:43 +02:00
|
|
|
} ngx_rtmp_publish_t;
|
2012-03-23 18:29:22 +01:00
|
|
|
|
|
|
|
|
2015-12-17 01:36:58 +01:00
|
|
|
typedef struct {
|
|
|
|
ngx_str_t playlist;
|
|
|
|
ngx_str_t module;
|
|
|
|
} ngx_rtmp_playlist_t;
|
|
|
|
|
|
|
|
|
2012-03-27 18:26:43 +02:00
|
|
|
typedef struct {
|
2012-06-08 20:57:54 +02:00
|
|
|
u_char name[NGX_RTMP_MAX_NAME];
|
2012-06-20 19:11:03 +02:00
|
|
|
u_char args[NGX_RTMP_MAX_ARGS];
|
2012-03-27 18:26:43 +02:00
|
|
|
double start;
|
|
|
|
double duration;
|
|
|
|
int reset;
|
2012-05-22 20:53:35 +02:00
|
|
|
int silent;
|
2012-03-27 18:26:43 +02:00
|
|
|
} ngx_rtmp_play_t;
|
|
|
|
|
|
|
|
|
2012-07-04 22:18:17 +02:00
|
|
|
typedef struct {
|
|
|
|
double offset;
|
|
|
|
} ngx_rtmp_seek_t;
|
|
|
|
|
|
|
|
|
2012-06-25 16:24:07 +02:00
|
|
|
typedef struct {
|
|
|
|
uint8_t pause;
|
|
|
|
double position;
|
|
|
|
} ngx_rtmp_pause_t;
|
|
|
|
|
|
|
|
|
2012-11-13 18:29:05 +01:00
|
|
|
typedef struct {
|
|
|
|
uint32_t msid;
|
|
|
|
} ngx_rtmp_msid_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef ngx_rtmp_msid_t ngx_rtmp_stream_begin_t;
|
|
|
|
typedef ngx_rtmp_msid_t ngx_rtmp_stream_eof_t;
|
|
|
|
typedef ngx_rtmp_msid_t ngx_rtmp_stream_dry_t;
|
|
|
|
typedef ngx_rtmp_msid_t ngx_rtmp_recorded_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t msid;
|
|
|
|
uint32_t buflen;
|
|
|
|
} ngx_rtmp_set_buflen_t;
|
|
|
|
|
|
|
|
|
2014-01-02 15:22:53 +01:00
|
|
|
void ngx_rtmp_cmd_fill_args(u_char name[NGX_RTMP_MAX_NAME],
|
|
|
|
u_char args[NGX_RTMP_MAX_ARGS]);
|
|
|
|
|
|
|
|
|
2013-11-30 08:21:53 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_connect_pt)(ngx_rtmp_session_t *s,
|
2012-03-27 18:26:43 +02:00
|
|
|
ngx_rtmp_connect_t *v);
|
2013-01-28 19:17:19 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_disconnect_pt)(ngx_rtmp_session_t *s);
|
2012-03-27 18:26:43 +02:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_create_stream_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_create_stream_t *v);
|
2012-06-25 14:22:42 +02:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_close_stream_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_close_stream_t *v);
|
2012-03-27 18:26:43 +02:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_delete_stream_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_delete_stream_t *v);
|
2013-11-30 08:21:53 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_publish_pt)(ngx_rtmp_session_t *s,
|
2012-03-27 18:26:43 +02:00
|
|
|
ngx_rtmp_publish_t *v);
|
2013-11-30 08:21:53 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_play_pt)(ngx_rtmp_session_t *s,
|
2012-03-27 18:26:43 +02:00
|
|
|
ngx_rtmp_play_t *v);
|
2013-11-30 08:21:53 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_seek_pt)(ngx_rtmp_session_t *s,
|
2012-07-04 22:18:17 +02:00
|
|
|
ngx_rtmp_seek_t *v);
|
2013-11-30 08:21:53 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_pause_pt)(ngx_rtmp_session_t *s,
|
2012-06-25 16:24:07 +02:00
|
|
|
ngx_rtmp_pause_t *v);
|
2012-07-04 22:18:17 +02:00
|
|
|
|
2012-11-13 18:29:05 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_stream_begin_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_stream_begin_t *v);
|
|
|
|
typedef ngx_int_t (*ngx_rtmp_stream_eof_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_stream_eof_t *v);
|
|
|
|
typedef ngx_int_t (*ngx_rtmp_stream_dry_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_stream_dry_t *v);
|
|
|
|
typedef ngx_int_t (*ngx_rtmp_recorded_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_recorded_t *v);
|
|
|
|
typedef ngx_int_t (*ngx_rtmp_set_buflen_pt)(ngx_rtmp_session_t *s,
|
|
|
|
ngx_rtmp_set_buflen_t *v);
|
|
|
|
|
2015-12-17 01:36:58 +01:00
|
|
|
typedef ngx_int_t (*ngx_rtmp_playlist_pt)(ngx_rtmp_session_t *s, ngx_rtmp_playlist_t *v);
|
2012-03-27 18:26:43 +02:00
|
|
|
|
|
|
|
extern ngx_rtmp_connect_pt ngx_rtmp_connect;
|
2013-01-28 19:17:19 +01:00
|
|
|
extern ngx_rtmp_disconnect_pt ngx_rtmp_disconnect;
|
2012-03-27 18:26:43 +02:00
|
|
|
extern ngx_rtmp_create_stream_pt ngx_rtmp_create_stream;
|
2012-06-25 14:22:42 +02:00
|
|
|
extern ngx_rtmp_close_stream_pt ngx_rtmp_close_stream;
|
2012-03-27 18:26:43 +02:00
|
|
|
extern ngx_rtmp_delete_stream_pt ngx_rtmp_delete_stream;
|
|
|
|
extern ngx_rtmp_publish_pt ngx_rtmp_publish;
|
|
|
|
extern ngx_rtmp_play_pt ngx_rtmp_play;
|
2012-07-04 22:18:17 +02:00
|
|
|
extern ngx_rtmp_seek_pt ngx_rtmp_seek;
|
2012-06-25 16:24:07 +02:00
|
|
|
extern ngx_rtmp_pause_pt ngx_rtmp_pause;
|
2012-07-04 22:18:17 +02:00
|
|
|
|
2012-11-13 18:29:05 +01:00
|
|
|
extern ngx_rtmp_stream_begin_pt ngx_rtmp_stream_begin;
|
|
|
|
extern ngx_rtmp_stream_eof_pt ngx_rtmp_stream_eof;
|
|
|
|
extern ngx_rtmp_stream_dry_pt ngx_rtmp_stream_dry;
|
|
|
|
extern ngx_rtmp_set_buflen_pt ngx_rtmp_set_buflen;
|
|
|
|
extern ngx_rtmp_recorded_pt ngx_rtmp_recorded;
|
|
|
|
|
2015-12-17 01:36:58 +01:00
|
|
|
extern ngx_rtmp_playlist_pt ngx_rtmp_playlist;
|
2012-03-23 18:29:22 +01:00
|
|
|
|
|
|
|
#endif /*_NGX_RTMP_CMD_H_INCLUDED_ */
|