2013-11-07 16:28:19 +01:00
|
|
|
|
2013-03-04 18:13:17 +01:00
|
|
|
/*
|
2013-11-07 16:28:19 +01:00
|
|
|
* Copyright (C) Roman Arutyunyan
|
2013-03-04 18:13:17 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _NGX_RTMP_MPEGTS_H_INCLUDED_
|
|
|
|
#define _NGX_RTMP_MPEGTS_H_INCLUDED_
|
|
|
|
|
|
|
|
|
2013-06-11 19:00:39 +02:00
|
|
|
#include <ngx_config.h>
|
2013-03-04 18:13:17 +01:00
|
|
|
#include <ngx_core.h>
|
2014-08-04 22:35:27 +02:00
|
|
|
#include <openssl/aes.h>
|
|
|
|
|
2016-04-13 07:17:21 +02:00
|
|
|
#include <ngx_rtmp_codec_module.h>
|
|
|
|
|
2014-08-04 22:35:27 +02:00
|
|
|
|
|
|
|
typedef struct {
|
2014-09-01 11:25:48 +02:00
|
|
|
ngx_fd_t fd;
|
|
|
|
ngx_log_t *log;
|
2014-08-04 22:35:27 +02:00
|
|
|
unsigned encrypt:1;
|
|
|
|
unsigned size:4;
|
|
|
|
u_char buf[16];
|
|
|
|
u_char iv[16];
|
|
|
|
AES_KEY key;
|
|
|
|
} ngx_rtmp_mpegts_file_t;
|
2013-03-04 18:13:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint64_t pts;
|
|
|
|
uint64_t dts;
|
|
|
|
ngx_uint_t pid;
|
|
|
|
ngx_uint_t sid;
|
|
|
|
ngx_uint_t cc;
|
|
|
|
unsigned key:1;
|
|
|
|
} ngx_rtmp_mpegts_frame_t;
|
|
|
|
|
|
|
|
|
2014-08-04 22:35:27 +02:00
|
|
|
ngx_int_t ngx_rtmp_mpegts_init_encryption(ngx_rtmp_mpegts_file_t *file,
|
|
|
|
u_char *key, size_t key_len, uint64_t iv);
|
|
|
|
ngx_int_t ngx_rtmp_mpegts_open_file(ngx_rtmp_mpegts_file_t *file, u_char *path,
|
2016-04-13 07:17:21 +02:00
|
|
|
ngx_log_t *log, ngx_rtmp_codec_ctx_t *codec_ctx, ngx_uint_t mpegts_cc);
|
2014-08-04 22:35:27 +02:00
|
|
|
ngx_int_t ngx_rtmp_mpegts_close_file(ngx_rtmp_mpegts_file_t *file);
|
|
|
|
ngx_int_t ngx_rtmp_mpegts_write_frame(ngx_rtmp_mpegts_file_t *file,
|
2014-08-31 16:58:43 +02:00
|
|
|
ngx_rtmp_mpegts_frame_t *f, ngx_buf_t *b);
|
2013-03-04 18:13:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _NGX_RTMP_MPEGTS_H_INCLUDED_ */
|