sidemash/publish_rtmp.rs
1/*
2 Copyright © 2020 Sidemash Cloud Services
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing,
11 software distributed under the License is distributed on an
12 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 either express or implied. See the License for the specific
14 language governing permissions and limitations under the License.
15*/
16
17
18use crate::secure_and_non_secure::SecureAndNonSecure;
19use serde::{Serialize, Deserialize};
20
21#[derive(Serialize, Deserialize, Hash, Eq, PartialEq, Debug)]
22#[serde(rename_all = "camelCase")]
23pub struct PublishRtmp {
24 pub stream_key_prefix : String,
25 pub ip : SecureAndNonSecure,
26 pub domain : SecureAndNonSecure
27}
28
29impl PublishRtmp {
30 pub fn to_json(&self) -> String {
31 let json = serde_json::to_string(&self).unwrap();
32 json
33 }
34}