srs_client/callback_api/event.rs
1//! [HTTP Callback API][1] of [SRS] exposed by application.
2//!
3//! [SRS]: https://ossrs.io/
4//! [1]: https://ossrs.io/lts/en-us/docs/v5/doc/http-callback
5
6use derive_more::Display;
7use serde::{Deserialize, Serialize};
8
9/// Possible [SRS] events in [HTTP Callback API][1] that this application reacts
10/// onto.
11///
12/// [SRS]: https://ossrs.io/
13/// [1]: https://ossrs.io/lts/en-us/docs/v5/doc/http-callback
14#[allow(clippy::enum_variant_names, clippy::module_name_repetitions)]
15#[derive(Clone, Copy, Debug, Deserialize, Serialize, Display)]
16#[serde(rename_all = "snake_case")]
17pub enum SrsCallbackEvent {
18 /// [SRS] client connects to [SRS] `app`.
19 ///
20 /// [SRS]: https://ossrs.io/
21 OnConnect,
22
23 /// [SRS] client publishes a new stream.
24 ///
25 /// [SRS]: https://ossrs.io/
26 OnPublish,
27
28 /// [SRS] client stops publishing its stream.
29 ///
30 /// [SRS]: https://ossrs.io/
31 OnUnpublish,
32
33 /// [SRS] client plays an existing stream.
34 ///
35 /// [SRS]: https://ossrs.io/
36 OnPlay,
37
38 /// [SRS] client stops playing an existing stream.
39 ///
40 /// [SRS]: https://ossrs.io/
41 OnStop,
42
43 /// [SRS] records an existing stream.
44 ///
45 /// [SRS]: https://ossrs.io/
46 OnDvr,
47
48 /// [SRS] client plays an existing stream via [HLS].
49 ///
50 /// [HLS]: https://en.wikipedia.org/wiki/HTTP_Live_Streaming
51 /// [SRS]: https://ossrs.io/
52 OnHls,
53}