CoreSDK  v1.0.0.b1304
r5stream_manager.h
1 /*
2  * Copyright (c) 2022 Infrared5, Inc.
3  * License information: https://account.red5.net/assets/LICENSE.txt
4  *
5  */
6 
7 #pragma once
8 
9 #include <vector>
10 #include "r5common.h"
11 
12 namespace r5::core {
13 
18 enum class StreamDirection {
19  Undefined = -1,
20  Publish = 0,
21  Subscribe
22 };
23 
28 typedef struct NodeRequest
29 {
30  std::string contextName;
31  std::string streamName;
32  std::string region;
33 } NodeRequest;
34 
39 typedef struct ProvisionRequest
40 {
41  std::string contextName;
42  std::string streamName;
43  std::string username;
44  std::string password;
45  std::vector<r5::common::ProvisionDesc> provisions;
46  std::vector<std::string> regions;
52 typedef struct StreamManagerResponse
53 {
54  std::string contextName;
55  std::string streamName;
56  std::string region;
57  std::string serverAddress;
58  int returnCode;
59  std::string message;
60  std::string timestamp;
62 
63 typedef struct StreamId
64 {
65  std::string contextName;
66  std::string streamName;
67 } StreamId;
68 
69 typedef struct TranscodingVariant
70 {
71  std::string name;
72  int level;
74 
79 typedef struct ProvisionResponse
80 {
81  std::string contextName;
82  std::string streamName;
83  std::string username;
84  std::string password;
85  std::vector<TranscodingVariant> variants;
86 
87  std::vector<std::string> regions;
88  int returnCode;
89  std::string message;
90  std::string timestamp;
92 
97 class R5_SDK_CORE_EXPORT Red5ProStreamManager
98 {
99 public:
110  static int SendNodeRequest(std::string streamManagerUrl, StreamDirection direction, const NodeRequest &request, StreamManagerResponse &response,
111  std::string customParams = "");
122  static int SendProvisionRequest(std::string streamManagerUrl, std::string accessToken, const ProvisionRequest &request,
123  StreamManagerResponse &response, std::string customParams = "");
132  static int GetTranscodeStreamsList(std::string streamManagerUrl, std::string accessToken, std::vector<StreamId> &streams);
143  static int GetProvision(std::string streamManagerUrl, std::string accessToken, StreamId streamId, ProvisionResponse &response,
144  std::string customParams = "");
155  static int DeleteProvision(std::string streamManagerUrl, std::string accessToken, StreamId streamId, ProvisionResponse &response,
156  std::string customParams = "");
157 };
158 }
std::string timestamp
server timestamp
Definition: r5stream_manager.h:90
Structure for Red5Pro Stream Manager response that describes transcoding provisions.
Definition: r5stream_manager.h:79
std::string message
description of the response
Definition: r5stream_manager.h:89
std::string streamName
name of the stream
Definition: r5stream_manager.h:42
std::string contextName
name of context of the stream (e.g. "live")
Definition: r5stream_manager.h:65
std::string timestamp
server timestamp
Definition: r5stream_manager.h:60
std::string region
name of node region
Definition: r5stream_manager.h:56
std::string password
password for authentication on Stream Manager
Definition: r5stream_manager.h:84
std::string username
user name for authentication on Stream Manager
Definition: r5stream_manager.h:83
std::string contextName
name of context of the stream (e.g. "live")
Definition: r5stream_manager.h:41
std::vector< r5::common::ProvisionDesc > provisions
set of transcoding provisions
Definition: r5stream_manager.h:45
int returnCode
status code for server response
Definition: r5stream_manager.h:58
std::string message
description of the response
Definition: r5stream_manager.h:59
std::string contextName
name of context of the stream (e.g. "live")
Definition: r5stream_manager.h:54
std::string contextName
name of context of the stream (e.g. "live")
Definition: r5stream_manager.h:30
Common structure that describes Red5Pro Stream Manager response.
Definition: r5stream_manager.h:52
std::string region
name of node region
Definition: r5stream_manager.h:32
std::vector< std::string > regions
set of regions
Definition: r5stream_manager.h:46
std::string streamName
name of the stream
Definition: r5stream_manager.h:31
int level
level index of provision
Definition: r5stream_manager.h:72
int returnCode
status code for server response
Definition: r5stream_manager.h:88
std::string streamName
name of the stream
Definition: r5stream_manager.h:66
Definition: r5stream_manager.h:12
Object for interacting with Rd5Pro Stream Manager instance.
Definition: r5stream_manager.h:97
Definition: r5stream_manager.h:63
Definition: r5stream_manager.h:69
std::string serverAddress
address of node
Definition: r5stream_manager.h:57
std::string username
user name for authentication on Stream Manager
Definition: r5stream_manager.h:43
std::string contextName
name of context of the stream (e.g. "live")
Definition: r5stream_manager.h:81
Description of request to Red5Pro Stream Manager to get node to connect.
Definition: r5stream_manager.h:28
std::vector< std::string > regions
set of regions
Definition: r5stream_manager.h:87
std::string streamName
name of the stream
Definition: r5stream_manager.h:82
std::string name
name of provision level stream
Definition: r5stream_manager.h:71
Description of request to Red5Pro Stream Manager provide set of transcoding provisions.
Definition: r5stream_manager.h:39
std::string streamName
name of the stream
Definition: r5stream_manager.h:55
std::vector< TranscodingVariant > variants
set of transcoding variants
Definition: r5stream_manager.h:85
std::string password
password for authentication on Stream Manager
Definition: r5stream_manager.h:44