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