-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option janus_playout_delay_support
- Loading branch information
Showing
9 changed files
with
109 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
option('systemd_watchdog_support', type : 'feature', value : 'auto') # http://0pointer.de/blog/projects/watchdog.html | ||
option('janus_playout_delay_support', type : 'boolean', value: false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @file JanusRtpPacketBuilder.cpp | ||
* @author Daniel Stiner ([email protected]) | ||
* @date 2021-12-06 | ||
* @copyright Copyright (c) 2021 Daniel Stiner | ||
*/ | ||
|
||
#include "JanusRtpPacketBuilder.h" | ||
|
||
#include "RtpPacket.h" | ||
|
||
#include <assert.h> | ||
|
||
janus_plugin_rtp JanusRtpPacketBuilder::Build(rtp_payload_type_t videoPayloadType) | ||
{ | ||
bool isVideoPacket = RtpPacket::GetRtpHeader(this->buffer)->Type == videoPayloadType; | ||
|
||
janus_plugin_rtp janusRtp = | ||
{ | ||
.video = isVideoPacket, | ||
.buffer = reinterpret_cast<char *>(this->buffer.data()), | ||
.length = static_cast<uint16_t>(this->buffer.size()), | ||
.extensions = this->extensions, | ||
}; | ||
|
||
return janusRtp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @file JanusRtpPacketBuilder.h | ||
* @author Daniel Stiner ([email protected]) | ||
* @date 2021-12-06 | ||
* @copyright Copyright (c) 2021 Daniel Stiner | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "Types.h" | ||
|
||
#include <assert.h> | ||
#include <span> | ||
|
||
extern "C" | ||
{ | ||
#include <plugins/plugin.h> | ||
} | ||
|
||
class JanusRtpPacketBuilder | ||
{ | ||
private: | ||
/* Private fields */ | ||
std::vector<std::byte> buffer; | ||
janus_plugin_rtp_extensions extensions; | ||
|
||
public: | ||
/* Constructor/Destructor */ | ||
JanusRtpPacketBuilder(std::span<const std::byte> packet) : buffer(packet.begin(), packet.end()) | ||
{ | ||
janus_plugin_rtp_extensions_reset(&this->extensions); | ||
} | ||
|
||
/* Public methods */ | ||
janus_plugin_rtp Build(rtp_payload_type_t videoPayloadType); | ||
|
||
#if defined(JANUS_PLAYOUT_DELAY_SUPPORT) | ||
JanusRtpPacketBuilder &PlayoutDelay(int16_t min, int16_t max) | ||
{ | ||
assert(min > 0); | ||
assert(max > 0); | ||
assert(max >= min); | ||
assert(min <= 0x0FFF); | ||
assert(max <= 0x0FFF); | ||
this->extensions.playout_delay_min = min; | ||
this->extensions.playout_delay_max = max; | ||
return *this; | ||
} | ||
#endif | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters