mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 12:15:34 +08:00
[fix] fix compile error on MacOSX
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "rtcp_receiver_report.h"
|
||||
#include "rtp_packet_av1.h"
|
||||
#include "rtp_packet_h264.h"
|
||||
#include "rtp_rtcp_defines.h "
|
||||
#include "rtp_rtcp_defines.h"
|
||||
#include "rtp_statistics.h"
|
||||
#include "thread_base.h"
|
||||
#include "video_frame.h"
|
||||
|
||||
@@ -38,7 +38,7 @@ class CopyOnWriteBuffer {
|
||||
|
||||
private:
|
||||
void EnsureUnique() {
|
||||
if (!buffer_.unique()) {
|
||||
if (buffer_.use_count() != 1) {
|
||||
buffer_ = std::make_shared<std::vector<uint8_t>>(*buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "ref_count.h"
|
||||
#include "api/ref_count.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace webrtc_impl {
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
#if defined(__POSIX__)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
// clang-format off
|
||||
|
||||
@@ -15,13 +15,12 @@
|
||||
#endif
|
||||
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/system_time.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
#include "system_time.h"
|
||||
#if defined(_WIN32)
|
||||
#include "rtc_base/win32.h"
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
#include <minwinbase.h>
|
||||
|
||||
#include "rtc_base/win32.h"
|
||||
#endif
|
||||
|
||||
namespace rtc {
|
||||
@@ -228,6 +227,7 @@ int64_t TimeUTCMicros() {
|
||||
return (li.QuadPart - kFileTimeToUnixTimeEpochOffset) /
|
||||
kFileTimeToMicroSeconds;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t TimeUTCMillis() { return TimeUTCMicros() / kNumMicrosecsPerMillisec; }
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "system_time.h"
|
||||
#include "rtc_base/system_time.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ void TransportFeedbackAdapter::AddPacket(const RtpPacketToSend& packet_to_send,
|
||||
feedback.sent.sequence_number = seq_num_unwrapper_.Unwrap(
|
||||
packet_to_send.transport_sequence_number().value_or(0));
|
||||
feedback.sent.size = DataSize::Bytes(packet_to_send.size() + overhead_bytes);
|
||||
LOG_WARN("!!! packet_to_send.size: {}", packet_to_send.size());
|
||||
feedback.sent.audio =
|
||||
packet_to_send.packet_type() == RtpPacketMediaType::kAudio;
|
||||
feedback.network_route = network_route_;
|
||||
|
||||
@@ -24,9 +24,9 @@ std::vector<RtpPacket> RtpPacketizerGeneric::Build(uint8_t* payload,
|
||||
payload_size / MAX_NALU_LEN + (last_packet_size ? 1 : 0);
|
||||
|
||||
// TODO: use frame timestamp
|
||||
timestamp_ = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
uint64_t timestamp = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
|
||||
std::vector<RtpPacket> rtp_packets;
|
||||
for (uint32_t index = 0; index < packet_num; index++) {
|
||||
@@ -37,11 +37,10 @@ std::vector<RtpPacket> RtpPacketizerGeneric::Build(uint8_t* payload,
|
||||
marker_ = index == packet_num - 1 ? 1 : 0;
|
||||
payload_type_ = rtp::PAYLOAD_TYPE(payload_type_);
|
||||
sequence_number_++;
|
||||
timestamp_ = timestamp_;
|
||||
timestamp_ = timestamp;
|
||||
ssrc_ = ssrc_;
|
||||
|
||||
if (!csrc_count_) {
|
||||
csrcs_ = csrcs_;
|
||||
}
|
||||
|
||||
rtp_packet_frame_.clear();
|
||||
|
||||
@@ -81,10 +81,8 @@ std::vector<RtpPacket> RtpPacketizerH264::BuildNalu(uint8_t* payload,
|
||||
timestamp_ = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
ssrc_ = ssrc_;
|
||||
|
||||
if (!csrc_count_) {
|
||||
csrcs_ = csrcs_;
|
||||
}
|
||||
|
||||
rtp::FU_INDICATOR fu_indicator;
|
||||
@@ -141,9 +139,9 @@ std::vector<RtpPacket> RtpPacketizerH264::BuildFua(uint8_t* payload,
|
||||
payload_size / MAX_NALU_LEN + (last_packet_size ? 1 : 0);
|
||||
|
||||
// TODO: use frame timestamp
|
||||
timestamp_ = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
uint64_t timestamp = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
|
||||
for (uint32_t index = 0; index < packet_num; index++) {
|
||||
version_ = kRtpVersion;
|
||||
@@ -153,7 +151,7 @@ std::vector<RtpPacket> RtpPacketizerH264::BuildFua(uint8_t* payload,
|
||||
marker_ = (index == (packet_num - 1)) ? 1 : 0;
|
||||
payload_type_ = rtp::PAYLOAD_TYPE(payload_type_);
|
||||
sequence_number_++;
|
||||
timestamp_ = timestamp_;
|
||||
timestamp_ = timestamp;
|
||||
ssrc_ = ssrc_;
|
||||
|
||||
if (!csrc_count_) {
|
||||
|
||||
@@ -18,11 +18,9 @@ class RtpPacketizerH264 : public RtpPacketizer {
|
||||
std::vector<RtpPacket> Build(uint8_t* payload,
|
||||
uint32_t payload_size) override;
|
||||
|
||||
std::vector<RtpPacket> RtpPacketizerH264::BuildNalu(uint8_t* payload,
|
||||
uint32_t payload_size);
|
||||
std::vector<RtpPacket> BuildNalu(uint8_t* payload, uint32_t payload_size);
|
||||
|
||||
std::vector<RtpPacket> RtpPacketizerH264::BuildFua(uint8_t* payload,
|
||||
uint32_t payload_size);
|
||||
std::vector<RtpPacket> BuildFua(uint8_t* payload, uint32_t payload_size);
|
||||
|
||||
private:
|
||||
bool EncodeH264Fua(RtpPacket& rtp_packet, uint8_t* payload,
|
||||
|
||||
Reference in New Issue
Block a user