Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
identity.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_rtp/identity.h
10
//! @brief RTP participant identity.
11
12
#ifndef ROC_RTP_IDENTITY_H_
13
#define ROC_RTP_IDENTITY_H_
14
15
#include "
roc_core/noncopyable.h
"
16
#include "
roc_core/uuid.h
"
17
#include "
roc_packet/units.h
"
18
19
namespace
roc
{
20
namespace
rtp
{
21
22
//! RTP participant identity.
23
class
Identity
:
public
core::NonCopyable
<> {
24
public
:
25
//! Initialize.
26
Identity
();
27
28
//! Check if was constructed successfully.
29
bool
is_valid
()
const
;
30
31
//! Get generated CNAME.
32
//! Uniquely identifies participant across all RTP sessions.
33
//! It is expected that collisions are not practi cally possible.
34
const
char
*
cname
()
const
;
35
36
//! Get generated SSRC.
37
//! Uniquely identifies participant within RTP session.
38
//! It is expected that collisions are possible and should be resolved.
39
packet::stream_source_t
ssrc
()
const
;
40
41
//! Regenerate SSRC.
42
//! Used in case of SSRC collision.
43
bool
change_ssrc
();
44
45
private
:
46
char
cname_[
core::UuidLen
+ 1];
47
packet::stream_source_t
ssrc_;
48
bool
valid_;
49
};
50
51
}
// namespace rtp
52
}
// namespace roc
53
54
#endif
// ROC_RTP_IDENTITY_H_
roc::core::NonCopyable
Base class for non-copyable objects.
Definition
noncopyable.h:23
roc::rtp::Identity::ssrc
packet::stream_source_t ssrc() const
Get generated SSRC. Uniquely identifies participant within RTP session. It is expected that collision...
roc::rtp::Identity::change_ssrc
bool change_ssrc()
Regenerate SSRC. Used in case of SSRC collision.
roc::rtp::Identity::Identity
Identity()
Initialize.
roc::rtp::Identity::is_valid
bool is_valid() const
Check if was constructed successfully.
roc::rtp::Identity::cname
const char * cname() const
Get generated CNAME. Uniquely identifies participant across all RTP sessions. It is expected that col...
roc::core::UuidLen
@ UuidLen
Number of characters in UUID string.
Definition
uuid.h:22
roc::packet::stream_source_t
uint32_t stream_source_t
Packet stream identifier.
Definition
units.h:27
roc::rtp
RTP protocol support.
roc
Root namespace.
noncopyable.h
Non-copyable object.
units.h
Various units used in packets.
uuid.h
UUID generation.
roc_rtp
identity.h
Generated by
1.17.0