Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/
(This is a re-land of https://codereview.webrtc.org/1921233002, which got reverted for breaking Chromium.) BUG=webrtc:5520 Review URL: https://codereview.webrtc.org/1923133002 Cr-Commit-Position: refs/heads/master@{#12522}
This commit is contained in:
parent
90c335a100
commit
84be511ac0
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_INCLUDE_AUDIO_CODING_MODULE_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_INCLUDE_AUDIO_CODING_MODULE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/neteq/include/neteq.h"
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
|
||||
#include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/neteq/include/neteq.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/neteq/tick_timer.h"
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
|
||||
#define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/include/module.h"
|
||||
@ -69,9 +71,9 @@ class CongestionController : public CallStatsObserver, public Module {
|
||||
|
||||
private:
|
||||
Clock* const clock_;
|
||||
const rtc::scoped_ptr<PacedSender> pacer_;
|
||||
const rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
const rtc::scoped_ptr<BitrateController> bitrate_controller_;
|
||||
const std::unique_ptr<PacedSender> pacer_;
|
||||
const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
const std::unique_ptr<BitrateController> bitrate_controller_;
|
||||
PacketRouter packet_router_;
|
||||
RemoteEstimatorProxy remote_estimator_proxy_;
|
||||
TransportFeedbackAdapter transport_feedback_adapter_;
|
||||
|
||||
@ -32,7 +32,7 @@ void CroppingWindowCapturer::Start(DesktopCapturer::Callback* callback) {
|
||||
}
|
||||
|
||||
void CroppingWindowCapturer::SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
window_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory));
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class CroppingWindowCapturer : public WindowCapturer,
|
||||
// DesktopCapturer implementation.
|
||||
void Start(DesktopCapturer::Callback* callback) override;
|
||||
void SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
void Capture(const DesktopRegion& region) override;
|
||||
void SetExcludedWindow(WindowId window) override;
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ void DesktopAndCursorComposer::Start(DesktopCapturer::Callback* callback) {
|
||||
}
|
||||
|
||||
void DesktopAndCursorComposer::SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
desktop_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory));
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ class DesktopAndCursorComposer : public DesktopCapturer,
|
||||
// DesktopCapturer interface.
|
||||
void Start(DesktopCapturer::Callback* callback) override;
|
||||
void SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
void Capture(const DesktopRegion& region) override;
|
||||
void SetExcludedWindow(WindowId window) override;
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/desktop_capture/desktop_capture_types.h"
|
||||
#include "webrtc/modules/desktop_capture/shared_memory.h"
|
||||
@ -48,7 +50,7 @@ class DesktopCapturer {
|
||||
// where Capture() is called. It will be destroyed on the same thread. Shared
|
||||
// memory is currently supported only by some DesktopCapturer implementations.
|
||||
virtual void SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {}
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {}
|
||||
|
||||
// Captures next frame. |region| specifies region of the capture target that
|
||||
// should be fresh in the resulting frame. The frame may also include fresh
|
||||
|
||||
@ -60,8 +60,8 @@ class FakeSharedMemoryFactory : public SharedMemoryFactory {
|
||||
FakeSharedMemoryFactory() {}
|
||||
~FakeSharedMemoryFactory() override {}
|
||||
|
||||
rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) override {
|
||||
return rtc::scoped_ptr<SharedMemory>(
|
||||
std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) override {
|
||||
return std::unique_ptr<SharedMemory>(
|
||||
new FakeSharedMemory(new char[size], size));
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ TEST_F(ScreenCapturerTest, UseSharedBuffers) {
|
||||
|
||||
capturer_->Start(&callback_);
|
||||
capturer_->SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory>(new FakeSharedMemoryFactory()));
|
||||
std::unique_ptr<SharedMemoryFactory>(new FakeSharedMemoryFactory()));
|
||||
capturer_->Capture(DesktopRegion());
|
||||
|
||||
ASSERT_TRUE(frame);
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
@ -69,7 +71,7 @@ class SharedMemoryFactory {
|
||||
SharedMemoryFactory() {}
|
||||
virtual ~SharedMemoryFactory() {}
|
||||
|
||||
virtual rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) = 0;
|
||||
virtual std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) = 0;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactory);
|
||||
|
||||
@ -74,7 +74,7 @@ ScreenCapturerWinGdi::~ScreenCapturerWinGdi() {
|
||||
}
|
||||
|
||||
void ScreenCapturerWinGdi::SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
shared_memory_factory_ = std::move(shared_memory_factory);
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ class ScreenCapturerWinGdi : public ScreenCapturer {
|
||||
// Overridden from ScreenCapturer:
|
||||
void Start(Callback* callback) override;
|
||||
void SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
void Capture(const DesktopRegion& region) override;
|
||||
bool GetScreenList(ScreenList* screens) override;
|
||||
bool SelectScreen(ScreenId id) override;
|
||||
|
||||
@ -82,7 +82,7 @@ void ScreenCapturerWinMagnifier::Start(Callback* callback) {
|
||||
}
|
||||
|
||||
void ScreenCapturerWinMagnifier::SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
|
||||
shared_memory_factory_ = std::move(shared_memory_factory);
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ class ScreenCapturerWinMagnifier : public ScreenCapturer {
|
||||
// Overridden from ScreenCapturer:
|
||||
void Start(Callback* callback) override;
|
||||
void SetSharedMemoryFactory(
|
||||
rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
|
||||
void Capture(const DesktopRegion& region) override;
|
||||
bool GetScreenList(ScreenList* screens) override;
|
||||
bool SelectScreen(ScreenId id) override;
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_
|
||||
#define WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/include/rtp_to_ntp.h"
|
||||
@ -41,7 +43,7 @@ class RemoteNtpTimeEstimator {
|
||||
|
||||
private:
|
||||
Clock* clock_;
|
||||
rtc::scoped_ptr<TimestampExtrapolator> ts_extrapolator_;
|
||||
std::unique_ptr<TimestampExtrapolator> ts_extrapolator_;
|
||||
RtcpList rtcp_list_;
|
||||
int64_t last_timing_log_ms_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RemoteNtpTimeEstimator);
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
@ -181,7 +182,7 @@ class RTPPayloadRegistry {
|
||||
|
||||
rtc::CriticalSection crit_sect_;
|
||||
RtpUtility::PayloadTypeMap payload_type_map_;
|
||||
rtc::scoped_ptr<RTPPayloadStrategy> rtp_payload_strategy_;
|
||||
std::unique_ptr<RTPPayloadStrategy> rtp_payload_strategy_;
|
||||
int8_t red_payload_type_;
|
||||
int8_t ulpfec_payload_type_;
|
||||
int8_t incoming_payload_type_;
|
||||
|
||||
@ -12,8 +12,9 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h"
|
||||
|
||||
@ -87,7 +88,7 @@ int32_t FecReceiverImpl::AddReceivedRedPacket(
|
||||
// Add to list without RED header, aka a virtual RTP packet
|
||||
// we remove the RED header
|
||||
|
||||
rtc::scoped_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet(
|
||||
std::unique_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet(
|
||||
new ForwardErrorCorrection::ReceivedPacket);
|
||||
received_packet->pkt = new ForwardErrorCorrection::Packet;
|
||||
|
||||
@ -135,7 +136,7 @@ int32_t FecReceiverImpl::AddReceivedRedPacket(
|
||||
}
|
||||
++packet_counter_.num_packets;
|
||||
|
||||
rtc::scoped_ptr<ForwardErrorCorrection::ReceivedPacket>
|
||||
std::unique_ptr<ForwardErrorCorrection::ReceivedPacket>
|
||||
second_received_packet;
|
||||
if (blockLength > 0) {
|
||||
// handle block length, split into 2 packets
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/fec_receiver.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
||||
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
|
||||
@ -92,9 +92,9 @@ class ReceiverFecTest : public ::testing::Test {
|
||||
uint8_t ulpfec_payload_type);
|
||||
|
||||
MockRtpData rtp_data_callback_;
|
||||
rtc::scoped_ptr<ForwardErrorCorrection> fec_;
|
||||
rtc::scoped_ptr<FecReceiver> receiver_fec_;
|
||||
rtc::scoped_ptr<FrameGenerator> generator_;
|
||||
std::unique_ptr<ForwardErrorCorrection> fec_;
|
||||
std::unique_ptr<FecReceiver> receiver_fec_;
|
||||
std::unique_ptr<FrameGenerator> generator_;
|
||||
};
|
||||
|
||||
void DeletePackets(std::list<Packet*>* packets) {
|
||||
@ -415,12 +415,12 @@ void ReceiverFecTest::SurvivesMaliciousPacket(const uint8_t* data,
|
||||
size_t length,
|
||||
uint8_t ulpfec_payload_type) {
|
||||
webrtc::RTPHeader header;
|
||||
rtc::scoped_ptr<webrtc::RtpHeaderParser> parser(
|
||||
std::unique_ptr<webrtc::RtpHeaderParser> parser(
|
||||
webrtc::RtpHeaderParser::Create());
|
||||
ASSERT_TRUE(parser->Parse(data, length, &header));
|
||||
|
||||
webrtc::NullRtpData null_callback;
|
||||
rtc::scoped_ptr<webrtc::FecReceiver> receiver_fec(
|
||||
std::unique_ptr<webrtc::FecReceiver> receiver_fec(
|
||||
webrtc::FecReceiver::Create(&null_callback));
|
||||
|
||||
receiver_fec->AddReceivedRedPacket(header, data, length, ulpfec_payload_type);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
@ -163,7 +164,7 @@ int32_t ForwardErrorCorrection::GenerateFEC(const PacketList& media_packet_list,
|
||||
|
||||
// -- Generate packet masks --
|
||||
// Always allocate space for a large mask.
|
||||
rtc::scoped_ptr<uint8_t[]> packet_mask(
|
||||
std::unique_ptr<uint8_t[]> packet_mask(
|
||||
new uint8_t[num_fec_packets * kMaskSizeLBitSet]);
|
||||
memset(packet_mask.get(), 0, num_fec_packets * num_mask_bytes);
|
||||
internal::GeneratePacketMasks(num_media_packets, num_fec_packets,
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
*/
|
||||
#include "webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/bitbuffer.h"
|
||||
#include "webrtc/base/bytebuffer.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
@ -103,7 +103,7 @@ bool H264BitstreamParser::ParseSpsNalu(const uint8_t* sps, size_t length) {
|
||||
sps_parsed_ = false;
|
||||
// Parse out the SPS RBSP. It should be small, so it's ok that we create a
|
||||
// copy. We'll eventually write this back.
|
||||
rtc::scoped_ptr<rtc::ByteBufferWriter> sps_rbsp(
|
||||
std::unique_ptr<rtc::ByteBufferWriter> sps_rbsp(
|
||||
ParseRbsp(sps + kNaluHeaderAndTypeSize, length - kNaluHeaderAndTypeSize));
|
||||
rtc::BitBuffer sps_parser(reinterpret_cast<const uint8_t*>(sps_rbsp->Data()),
|
||||
sps_rbsp->Length());
|
||||
@ -209,7 +209,7 @@ bool H264BitstreamParser::ParsePpsNalu(const uint8_t* pps, size_t length) {
|
||||
// We're starting a new stream, so reset picture type rewriting values.
|
||||
pps_ = PpsState();
|
||||
pps_parsed_ = false;
|
||||
rtc::scoped_ptr<rtc::ByteBufferWriter> buffer(
|
||||
std::unique_ptr<rtc::ByteBufferWriter> buffer(
|
||||
ParseRbsp(pps + kNaluHeaderAndTypeSize, length - kNaluHeaderAndTypeSize));
|
||||
rtc::BitBuffer parser(reinterpret_cast<const uint8_t*>(buffer->Data()),
|
||||
buffer->Length());
|
||||
@ -317,7 +317,7 @@ bool H264BitstreamParser::ParseNonParameterSetNalu(const uint8_t* source,
|
||||
RTC_CHECK(sps_parsed_);
|
||||
RTC_CHECK(pps_parsed_);
|
||||
last_slice_qp_delta_parsed_ = false;
|
||||
rtc::scoped_ptr<rtc::ByteBufferWriter> slice_rbsp(ParseRbsp(
|
||||
std::unique_ptr<rtc::ByteBufferWriter> slice_rbsp(ParseRbsp(
|
||||
source + kNaluHeaderAndTypeSize, source_length - kNaluHeaderAndTypeSize));
|
||||
rtc::BitBuffer slice_reader(
|
||||
reinterpret_cast<const uint8_t*>(slice_rbsp->Data()),
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
||||
@ -105,7 +105,7 @@ class RtxLoopBackTransport : public webrtc::Transport {
|
||||
size_t packet_length = len;
|
||||
uint8_t restored_packet[1500];
|
||||
RTPHeader header;
|
||||
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
if (!parser->Parse(ptr, len, &header)) {
|
||||
return false;
|
||||
}
|
||||
@ -279,11 +279,11 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
||||
|
||||
void TearDown() override { delete rtp_rtcp_module_; }
|
||||
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
RTPPayloadRegistry rtp_payload_registry_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver_;
|
||||
RtpRtcp* rtp_rtcp_module_;
|
||||
rtc::scoped_ptr<TestRtpFeedback> rtp_feedback_;
|
||||
std::unique_ptr<TestRtpFeedback> rtp_feedback_;
|
||||
RtxLoopBackTransport transport_;
|
||||
VerifyingRtxReceiver receiver_;
|
||||
uint8_t payload_data[65000];
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -188,7 +189,7 @@ TEST_F(ProducerFecTest, TwoFrameFec) {
|
||||
TEST_F(ProducerFecTest, BuildRedPacket) {
|
||||
generator_->NewFrame(1);
|
||||
test::RawRtpPacket* packet = generator_->NextPacket(0, 10);
|
||||
rtc::scoped_ptr<RedPacket> red_packet(producer_->BuildRedPacket(
|
||||
std::unique_ptr<RedPacket> red_packet(producer_->BuildRedPacket(
|
||||
packet->data, packet->length - kRtpHeaderSize, kRtpHeaderSize,
|
||||
kRedPayloadType));
|
||||
EXPECT_EQ(packet->length + 1, red_packet->length());
|
||||
|
||||
@ -8,9 +8,10 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
|
||||
@ -36,7 +37,7 @@ class ReceiveStatisticsTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
SimulatedClock clock_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
RTPHeader header1_;
|
||||
RTPHeader header2_;
|
||||
};
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
@ -74,13 +76,13 @@ class RtcpFormatRembTest : public ::testing::Test {
|
||||
OverUseDetectorOptions over_use_detector_options_;
|
||||
Clock* system_clock_;
|
||||
ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
RTCPSender* rtcp_sender_;
|
||||
RTCPReceiver* rtcp_receiver_;
|
||||
TestTransport* test_transport_;
|
||||
test::NullTransport null_transport_;
|
||||
MockRemoteBitrateObserver remote_bitrate_observer_;
|
||||
rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
};
|
||||
|
||||
void RtcpFormatRembTest::SetUp() {
|
||||
|
||||
@ -651,10 +651,10 @@ bool TransportFeedback::Create(uint8_t* packet,
|
||||
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
// De-serialize packet.
|
||||
rtc::scoped_ptr<TransportFeedback> TransportFeedback::ParseFrom(
|
||||
std::unique_ptr<TransportFeedback> TransportFeedback::ParseFrom(
|
||||
const uint8_t* buffer,
|
||||
size_t length) {
|
||||
rtc::scoped_ptr<TransportFeedback> packet(new TransportFeedback());
|
||||
std::unique_ptr<TransportFeedback> packet(new TransportFeedback());
|
||||
|
||||
if (length < kMinSizeBytes) {
|
||||
LOG(LS_WARNING) << "Buffer too small (" << length
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TRANSPORT_FEEDBACK_H_
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
@ -58,7 +59,7 @@ class TransportFeedback : public RtcpPacket {
|
||||
static const uint8_t kFeedbackMessageType = 15; // TODO(sprang): IANA reg?
|
||||
static const uint8_t kPayloadType = 205; // RTPFB, see RFC4585.
|
||||
|
||||
static rtc::scoped_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer,
|
||||
static std::unique_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer,
|
||||
size_t length);
|
||||
|
||||
protected:
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -43,7 +44,7 @@ class FeedbackTester {
|
||||
void WithInput(const uint16_t received_seq[],
|
||||
const int64_t received_ts[],
|
||||
uint16_t length) {
|
||||
rtc::scoped_ptr<int64_t[]> temp_deltas;
|
||||
std::unique_ptr<int64_t[]> temp_deltas;
|
||||
if (received_ts == nullptr) {
|
||||
temp_deltas.reset(new int64_t[length]);
|
||||
GenerateDeltas(received_seq, length, temp_deltas.get());
|
||||
@ -136,7 +137,7 @@ class FeedbackTester {
|
||||
std::vector<int64_t> expected_deltas_;
|
||||
size_t expected_size_;
|
||||
int64_t default_delta_;
|
||||
rtc::scoped_ptr<TransportFeedback> feedback_;
|
||||
std::unique_ptr<TransportFeedback> feedback_;
|
||||
rtc::Buffer serialized_;
|
||||
};
|
||||
|
||||
@ -356,7 +357,7 @@ TEST(RtcpPacketTest, TransportFeedback_Aliasing) {
|
||||
|
||||
TEST(RtcpPacketTest, TransportFeedback_Limits) {
|
||||
// Sequence number wrap above 0x8000.
|
||||
rtc::scoped_ptr<TransportFeedback> packet(new TransportFeedback());
|
||||
std::unique_ptr<TransportFeedback> packet(new TransportFeedback());
|
||||
packet->WithBase(0, 0);
|
||||
EXPECT_TRUE(packet->WithReceivedPacket(0x8000, 1000));
|
||||
|
||||
@ -446,7 +447,7 @@ TEST(RtcpPacketTest, TransportFeedback_Padding) {
|
||||
&mod_buffer[2], ByteReader<uint16_t>::ReadBigEndian(&mod_buffer[2]) +
|
||||
((kPaddingBytes + 3) / 4));
|
||||
|
||||
rtc::scoped_ptr<TransportFeedback> parsed_packet(
|
||||
std::unique_ptr<TransportFeedback> parsed_packet(
|
||||
TransportFeedback::ParseFrom(mod_buffer, kExpectedSizeWithPadding));
|
||||
ASSERT_TRUE(parsed_packet.get() != nullptr);
|
||||
EXPECT_EQ(kExpectedSizeWords * 4, packet.size()); // Padding not included.
|
||||
@ -468,7 +469,7 @@ TEST(RtcpPacketTest, TransportFeedback_CorrectlySplitsVectorChunks) {
|
||||
feedback.WithReceivedPacket(deltas, deltas * 1000 + kLargeTimeDelta);
|
||||
|
||||
rtc::Buffer serialized_packet = feedback.Build();
|
||||
rtc::scoped_ptr<TransportFeedback> deserialized_packet =
|
||||
std::unique_ptr<TransportFeedback> deserialized_packet =
|
||||
TransportFeedback::ParseFrom(serialized_packet.data(),
|
||||
serialized_packet.size());
|
||||
EXPECT_TRUE(deserialized_packet.get() != nullptr);
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
bool xr_dlrr_item;
|
||||
std::unique_ptr<RTCPVoIPMetric> VoIPMetric;
|
||||
|
||||
rtc::scoped_ptr<rtcp::TransportFeedback> transport_feedback_;
|
||||
std::unique_ptr<rtcp::TransportFeedback> transport_feedback_;
|
||||
|
||||
private:
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RTCPPacketInformation);
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -145,7 +147,7 @@ class RtcpReceiverTest : public ::testing::Test {
|
||||
TestTransport* test_transport_;
|
||||
RTCPHelp::RTCPPacketInformation rtcp_packet_info_;
|
||||
MockRemoteBitrateObserver remote_bitrate_observer_;
|
||||
rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -256,9 +258,9 @@ class RtcpSenderTest : public ::testing::Test {
|
||||
|
||||
SimulatedClock clock_;
|
||||
TestTransport test_transport_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
rtc::scoped_ptr<ModuleRtpRtcpImpl> rtp_rtcp_impl_;
|
||||
rtc::scoped_ptr<RTCPSender> rtcp_sender_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl> rtp_rtcp_impl_;
|
||||
std::unique_ptr<RTCPSender> rtcp_sender_;
|
||||
};
|
||||
|
||||
TEST_F(RtcpSenderTest, SetRtcpStatus) {
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
|
||||
#include <stddef.h> // size_t, ptrdiff_t
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
@ -468,7 +470,7 @@ class RTCPParserV2 {
|
||||
|
||||
RTCPPacketTypes _packetType;
|
||||
RTCPPacket _packet;
|
||||
rtc::scoped_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_;
|
||||
std::unique_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_;
|
||||
};
|
||||
|
||||
class RTCPPacketIterator {
|
||||
|
||||
@ -8,11 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/include/module_common_types.h"
|
||||
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
|
||||
@ -72,7 +72,7 @@ void VerifyFua(size_t fua_index,
|
||||
void TestFua(size_t frame_size,
|
||||
size_t max_payload_size,
|
||||
const std::vector<size_t>& expected_sizes) {
|
||||
rtc::scoped_ptr<uint8_t[]> frame;
|
||||
std::unique_ptr<uint8_t[]> frame;
|
||||
frame.reset(new uint8_t[frame_size]);
|
||||
frame[0] = 0x05; // F=0, NRI=0, Type=5.
|
||||
for (size_t i = 0; i < frame_size - kNalHeaderSize; ++i) {
|
||||
@ -82,11 +82,11 @@ void TestFua(size_t frame_size,
|
||||
fragmentation.VerifyAndAllocateFragmentationHeader(1);
|
||||
fragmentation.fragmentationOffset[0] = 0;
|
||||
fragmentation.fragmentationLength[0] = frame_size;
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
|
||||
kRtpVideoH264, max_payload_size, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame.get(), frame_size, &fragmentation);
|
||||
|
||||
rtc::scoped_ptr<uint8_t[]> packet(new uint8_t[max_payload_size]);
|
||||
std::unique_ptr<uint8_t[]> packet(new uint8_t[max_payload_size]);
|
||||
size_t length = 0;
|
||||
bool last = false;
|
||||
size_t offset = kNalHeaderSize;
|
||||
@ -156,7 +156,7 @@ TEST(RtpPacketizerH264Test, TestSingleNalu) {
|
||||
fragmentation.VerifyAndAllocateFragmentationHeader(1);
|
||||
fragmentation.fragmentationOffset[0] = 0;
|
||||
fragmentation.fragmentationLength[0] = sizeof(frame);
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(
|
||||
RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame, sizeof(frame), &fragmentation);
|
||||
uint8_t packet[kMaxPayloadSize] = {0};
|
||||
@ -185,7 +185,7 @@ TEST(RtpPacketizerH264Test, TestSingleNaluTwoPackets) {
|
||||
frame[fragmentation.fragmentationOffset[0]] = 0x01;
|
||||
frame[fragmentation.fragmentationOffset[1]] = 0x01;
|
||||
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(
|
||||
RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
|
||||
|
||||
@ -222,7 +222,7 @@ TEST(RtpPacketizerH264Test, TestStapA) {
|
||||
fragmentation.fragmentationOffset[2] = 4;
|
||||
fragmentation.fragmentationLength[2] =
|
||||
kNalHeaderSize + kFrameSize - kPayloadOffset;
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(
|
||||
RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
|
||||
|
||||
@ -257,7 +257,7 @@ TEST(RtpPacketizerH264Test, TestTooSmallForStapAHeaders) {
|
||||
fragmentation.fragmentationOffset[2] = 4;
|
||||
fragmentation.fragmentationLength[2] =
|
||||
kNalHeaderSize + kFrameSize - kPayloadOffset;
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(
|
||||
RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
|
||||
|
||||
@ -305,7 +305,7 @@ TEST(RtpPacketizerH264Test, TestMixedStapA_FUA) {
|
||||
frame[nalu_offset + j] = i + j;
|
||||
}
|
||||
}
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(
|
||||
RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
|
||||
packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
|
||||
|
||||
@ -394,7 +394,7 @@ class RtpDepacketizerH264Test : public ::testing::Test {
|
||||
::testing::ElementsAreArray(data, length));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer_;
|
||||
};
|
||||
|
||||
TEST_F(RtpDepacketizerH264Test, TestSingleNalu) {
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h"
|
||||
@ -417,7 +419,7 @@ class RtpDepacketizerVp8Test : public ::testing::Test {
|
||||
::testing::ElementsAreArray(data, length));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer_;
|
||||
};
|
||||
|
||||
TEST_F(RtpDepacketizerVp8Test, BasicHeader) {
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
@ -76,7 +77,7 @@ void ParseAndCheckPacket(const uint8_t* packet,
|
||||
const RTPVideoHeaderVP9& expected,
|
||||
size_t expected_hdr_length,
|
||||
size_t expected_length) {
|
||||
rtc::scoped_ptr<RtpDepacketizer> depacketizer(new RtpDepacketizerVp9());
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer(new RtpDepacketizerVp9());
|
||||
RtpDepacketizer::ParsedPayload parsed;
|
||||
ASSERT_TRUE(depacketizer->Parse(&parsed, packet, expected_length));
|
||||
EXPECT_EQ(kRtpVideoVp9, parsed.type.Video.codec);
|
||||
@ -127,12 +128,12 @@ class RtpPacketizerVp9Test : public ::testing::Test {
|
||||
expected_.InitRTPVideoHeaderVP9();
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<uint8_t[]> packet_;
|
||||
rtc::scoped_ptr<uint8_t[]> payload_;
|
||||
std::unique_ptr<uint8_t[]> packet_;
|
||||
std::unique_ptr<uint8_t[]> payload_;
|
||||
size_t payload_size_;
|
||||
size_t payload_pos_;
|
||||
RTPVideoHeaderVP9 expected_;
|
||||
rtc::scoped_ptr<RtpPacketizerVp9> packetizer_;
|
||||
std::unique_ptr<RtpPacketizerVp9> packetizer_;
|
||||
|
||||
void Init(size_t payload_size, size_t packet_size) {
|
||||
payload_.reset(new uint8_t[payload_size]);
|
||||
@ -469,7 +470,7 @@ class RtpDepacketizerVp9Test : public ::testing::Test {
|
||||
}
|
||||
|
||||
RTPVideoHeaderVP9 expected_;
|
||||
rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer_;
|
||||
};
|
||||
|
||||
TEST_F(RtpDepacketizerVp9Test, ParseBasicHeader) {
|
||||
|
||||
@ -8,11 +8,12 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/mock/mock_rtp_payload_strategy.h"
|
||||
@ -58,7 +59,7 @@ class RtpPayloadRegistryTest : public ::testing::Test {
|
||||
return returned_payload_on_heap;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
|
||||
testing::NiceMock<MockRTPPayloadStrategy>* mock_payload_strategy_;
|
||||
};
|
||||
|
||||
@ -296,9 +297,9 @@ void TestRtxPacket(RTPPayloadRegistry* rtp_payload_registry,
|
||||
uint16_t original_sequence_number = 1234;
|
||||
uint32_t original_ssrc = 500;
|
||||
|
||||
rtc::scoped_ptr<const uint8_t[]> packet(GenerateRtxPacket(
|
||||
std::unique_ptr<const uint8_t[]> packet(GenerateRtxPacket(
|
||||
header_length, payload_length, original_sequence_number));
|
||||
rtc::scoped_ptr<uint8_t[]> restored_packet(
|
||||
std::unique_ptr<uint8_t[]> restored_packet(
|
||||
new uint8_t[header_length + payload_length]);
|
||||
size_t length = original_length;
|
||||
bool success = rtp_payload_registry->RestoreOriginalPacket(
|
||||
@ -312,7 +313,7 @@ void TestRtxPacket(RTPPayloadRegistry* rtp_payload_registry,
|
||||
EXPECT_EQ(original_length - kRtxHeaderSize, length)
|
||||
<< "The restored packet should be exactly kRtxHeaderSize smaller.";
|
||||
|
||||
rtc::scoped_ptr<RtpHeaderParser> header_parser(RtpHeaderParser::Create());
|
||||
std::unique_ptr<RtpHeaderParser> header_parser(RtpHeaderParser::Create());
|
||||
RTPHeader restored_header;
|
||||
ASSERT_TRUE(
|
||||
header_parser->Parse(restored_packet.get(), length, &restored_header));
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
|
||||
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
|
||||
@ -75,7 +77,7 @@ class RtpReceiverImpl : public RtpReceiver {
|
||||
|
||||
Clock* clock_;
|
||||
RTPPayloadRegistry* rtp_payload_registry_;
|
||||
rtc::scoped_ptr<RTPReceiverStrategy> rtp_media_receiver_;
|
||||
std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_;
|
||||
|
||||
RtpFeedback* cb_rtp_feedback_;
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/trace_event.h"
|
||||
@ -74,7 +76,7 @@ int32_t RTPReceiverVideo::ParseRtpPacket(WebRtcRTPHeader* rtp_header,
|
||||
}
|
||||
|
||||
// We are not allowed to hold a critical section when calling below functions.
|
||||
rtc::scoped_ptr<RtpDepacketizer> depacketizer(
|
||||
std::unique_ptr<RtpDepacketizer> depacketizer(
|
||||
RtpDepacketizer::Create(rtp_header->type.Video.codec));
|
||||
if (depacketizer.get() == NULL) {
|
||||
LOG(LS_ERROR) << "Failed to create depacketizer.";
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
@ -68,7 +69,7 @@ class SendTransport : public Transport,
|
||||
size_t len,
|
||||
const PacketOptions& options) override {
|
||||
RTPHeader header;
|
||||
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header));
|
||||
++rtp_packets_sent_;
|
||||
last_rtp_header_ = header;
|
||||
@ -115,10 +116,10 @@ class RtpRtcpModule : public RtcpPacketTypeCounterObserver {
|
||||
|
||||
RtcpPacketTypeCounter packets_sent_;
|
||||
RtcpPacketTypeCounter packets_received_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
SendTransport transport_;
|
||||
RtcpRttStatsTestImpl rtt_stats_;
|
||||
rtc::scoped_ptr<ModuleRtpRtcpImpl> impl_;
|
||||
std::unique_ptr<ModuleRtpRtcpImpl> impl_;
|
||||
uint32_t remote_ssrc_;
|
||||
|
||||
void SetRemoteSsrc(uint32_t ssrc) {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -423,8 +424,8 @@ class RTPSender : public RTPSenderInterface {
|
||||
Bitrate total_bitrate_sent_;
|
||||
|
||||
const bool audio_configured_;
|
||||
const rtc::scoped_ptr<RTPSenderAudio> audio_;
|
||||
const rtc::scoped_ptr<RTPSenderVideo> video_;
|
||||
const std::unique_ptr<RTPSenderAudio> audio_;
|
||||
const std::unique_ptr<RTPSenderVideo> video_;
|
||||
|
||||
RtpPacketSender* const paced_sender_;
|
||||
TransportSequenceNumberAllocator* const transport_sequence_number_allocator_;
|
||||
|
||||
@ -9,12 +9,12 @@
|
||||
*/
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/call/mock/mock_rtc_event_log.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
||||
@ -148,7 +148,7 @@ class RtpSenderTest : public ::testing::Test {
|
||||
MockRtcEventLog mock_rtc_event_log_;
|
||||
MockRtpPacketSender mock_paced_sender_;
|
||||
MockTransportSequenceNumberAllocator seq_num_allocator_;
|
||||
rtc::scoped_ptr<RTPSender> rtp_sender_;
|
||||
std::unique_ptr<RTPSender> rtp_sender_;
|
||||
int payload_;
|
||||
LoopbackTransportTest transport_;
|
||||
const bool kMarkerBit;
|
||||
@ -202,7 +202,7 @@ class RtpSenderVideoTest : public RtpSenderTest {
|
||||
rtp_sender_video_.reset(
|
||||
new RTPSenderVideo(&fake_clock_, rtp_sender_.get()));
|
||||
}
|
||||
rtc::scoped_ptr<RTPSenderVideo> rtp_sender_video_;
|
||||
std::unique_ptr<RTPSenderVideo> rtp_sender_video_;
|
||||
|
||||
void VerifyCVOPacket(uint8_t* data,
|
||||
size_t len,
|
||||
@ -849,7 +849,7 @@ TEST_F(RtpSenderTest, SendPadding) {
|
||||
rtp_header_len += 4; // 4 extra bytes common to all extension headers.
|
||||
|
||||
// Create and set up parser.
|
||||
rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
webrtc::RtpHeaderParser::Create());
|
||||
ASSERT_TRUE(rtp_parser.get() != nullptr);
|
||||
rtp_parser->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
|
||||
@ -968,7 +968,7 @@ TEST_F(RtpSenderTest, SendRedundantPayloads) {
|
||||
rtp_sender_->SetRtxSsrc(1234);
|
||||
|
||||
// Create and set up parser.
|
||||
rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
webrtc::RtpHeaderParser::Create());
|
||||
ASSERT_TRUE(rtp_parser.get() != nullptr);
|
||||
rtp_parser->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
|
||||
@ -1402,7 +1402,7 @@ TEST_F(RtpSenderAudioTest, CheckMarkerBitForTelephoneEvents) {
|
||||
ASSERT_EQ(0, rtp_sender_->SendOutgoingData(kEmptyFrame, payload_type,
|
||||
capture_time_ms + 2000, 0, nullptr,
|
||||
0, nullptr));
|
||||
rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
|
||||
webrtc::RtpHeaderParser::Create());
|
||||
ASSERT_TRUE(rtp_parser.get() != nullptr);
|
||||
webrtc::RTPHeader rtp_header;
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
@ -111,7 +112,7 @@ void RTPSenderVideo::SendVideoPacketAsRed(uint8_t* data_buffer,
|
||||
int64_t capture_time_ms,
|
||||
StorageType media_packet_storage,
|
||||
bool protect) {
|
||||
rtc::scoped_ptr<RedPacket> red_packet;
|
||||
std::unique_ptr<RedPacket> red_packet;
|
||||
std::vector<RedPacket*> fec_packets;
|
||||
StorageType fec_storage = kDontRetransmit;
|
||||
uint16_t next_fec_sequence_number = 0;
|
||||
@ -224,7 +225,7 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType,
|
||||
return -1;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
|
||||
std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
|
||||
videoType, _rtpSender.MaxDataPayloadLength(),
|
||||
video_header ? &(video_header->codecHeader) : nullptr, frameType));
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/test/null_transport.h"
|
||||
@ -41,7 +42,7 @@ bool LoopBackTransport::SendRtp(const uint8_t* data,
|
||||
}
|
||||
}
|
||||
RTPHeader header;
|
||||
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) {
|
||||
return false;
|
||||
}
|
||||
@ -100,9 +101,9 @@ class RtpRtcpAPITest : public ::testing::Test {
|
||||
&fake_clock_, NULL, NULL, rtp_payload_registry_.get()));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
|
||||
rtc::scoped_ptr<RtpRtcp> module_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver_;
|
||||
std::unique_ptr<RtpRtcp> module_;
|
||||
uint32_t test_ssrc_;
|
||||
uint32_t test_timestamp_;
|
||||
uint16_t test_sequence_number_;
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -135,12 +136,12 @@ class RtpRtcpAudioTest : public ::testing::Test {
|
||||
|
||||
RtpRtcp* module1;
|
||||
RtpRtcp* module2;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics1_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics2_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver1_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver2_;
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics1_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics2_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver1_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver2_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
|
||||
VerifyingAudioReceiver* data_receiver1;
|
||||
VerifyingAudioReceiver* data_receiver2;
|
||||
LoopBackTransport* transport1;
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
@ -175,14 +176,14 @@ class RtpRtcpRtcpTest : public ::testing::Test {
|
||||
delete receiver;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<TestRtpFeedback> rtp_feedback1_;
|
||||
rtc::scoped_ptr<TestRtpFeedback> rtp_feedback2_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics1_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics2_;
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
|
||||
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver1_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver2_;
|
||||
std::unique_ptr<TestRtpFeedback> rtp_feedback1_;
|
||||
std::unique_ptr<TestRtpFeedback> rtp_feedback2_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics1_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics2_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
|
||||
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver1_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver2_;
|
||||
RtpRtcp* module1;
|
||||
RtpRtcp* module2;
|
||||
TestRtpReceiver* receiver;
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
@ -127,9 +128,9 @@ class RtpRtcpVideoTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
int test_id_;
|
||||
rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
|
||||
std::unique_ptr<ReceiveStatistics> receive_statistics_;
|
||||
RTPPayloadRegistry rtp_payload_registry_;
|
||||
rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver_;
|
||||
RtpRtcp* video_module_;
|
||||
LoopBackTransport* transport_;
|
||||
TestRtpReceiver* receiver_;
|
||||
@ -170,7 +171,7 @@ TEST_F(RtpRtcpVideoTest, PaddingOnlyFrames) {
|
||||
kPadSize);
|
||||
++seq_num;
|
||||
RTPHeader header;
|
||||
rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
|
||||
EXPECT_TRUE(parser->Parse(padding_packet, packet_size, &header));
|
||||
PayloadUnion payload_specific;
|
||||
EXPECT_TRUE(rtp_payload_registry_.GetPayloadSpecifics(header.payloadType,
|
||||
|
||||
@ -45,8 +45,9 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h"
|
||||
#include "webrtc/modules/rtp_rtcp/test/testFec/average_residual_loss_xor_codes.h"
|
||||
#include "webrtc/test/testsupport/fileutils.h"
|
||||
@ -191,7 +192,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
int RecoveredMediaPackets(int num_media_packets,
|
||||
int num_fec_packets,
|
||||
uint8_t* state) {
|
||||
rtc::scoped_ptr<uint8_t[]> state_tmp(
|
||||
std::unique_ptr<uint8_t[]> state_tmp(
|
||||
new uint8_t[num_media_packets + num_fec_packets]);
|
||||
memcpy(state_tmp.get(), state, num_media_packets + num_fec_packets);
|
||||
int num_recovered_packets = 0;
|
||||
@ -385,7 +386,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
// (which containes the code size parameters/protection length).
|
||||
void ComputeMetricsForCode(CodeType code_type,
|
||||
int code_index) {
|
||||
rtc::scoped_ptr<double[]> prob_weight(new double[kNumLossModels]);
|
||||
std::unique_ptr<double[]> prob_weight(new double[kNumLossModels]);
|
||||
memset(prob_weight.get() , 0, sizeof(double) * kNumLossModels);
|
||||
MetricsFecCode metrics_code;
|
||||
SetMetricsZero(&metrics_code);
|
||||
@ -393,7 +394,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
int num_media_packets = code_params_[code_index].num_media_packets;
|
||||
int num_fec_packets = code_params_[code_index].num_fec_packets;
|
||||
int tot_num_packets = num_media_packets + num_fec_packets;
|
||||
rtc::scoped_ptr<uint8_t[]> state(new uint8_t[tot_num_packets]);
|
||||
std::unique_ptr<uint8_t[]> state(new uint8_t[tot_num_packets]);
|
||||
memset(state.get() , 0, tot_num_packets);
|
||||
|
||||
int num_loss_configurations = static_cast<int>(pow(2.0f, tot_num_packets));
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
#define WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
@ -76,7 +78,7 @@ class NativeRegistration : public JavaClass {
|
||||
NativeRegistration(JNIEnv* jni, jclass clazz);
|
||||
~NativeRegistration();
|
||||
|
||||
rtc::scoped_ptr<GlobalRef> NewObject(
|
||||
std::unique_ptr<GlobalRef> NewObject(
|
||||
const char* name, const char* signature, ...);
|
||||
|
||||
private:
|
||||
@ -96,7 +98,7 @@ class JNIEnvironment {
|
||||
// Note that the class name must be one of the names in the static
|
||||
// |loaded_classes| array defined in jvm_android.cc.
|
||||
// This method must be called on the construction thread.
|
||||
rtc::scoped_ptr<NativeRegistration> RegisterNatives(
|
||||
std::unique_ptr<NativeRegistration> RegisterNatives(
|
||||
const char* name, const JNINativeMethod *methods, int num_methods);
|
||||
|
||||
// Converts from Java string to std::string.
|
||||
@ -120,9 +122,9 @@ class JNIEnvironment {
|
||||
// webrtc::JVM::Initialize(jvm, context);
|
||||
//
|
||||
// // Header (.h) file of example class called User.
|
||||
// rtc::scoped_ptr<JNIEnvironment> env;
|
||||
// rtc::scoped_ptr<NativeRegistration> reg;
|
||||
// rtc::scoped_ptr<GlobalRef> obj;
|
||||
// std::unique_ptr<JNIEnvironment> env;
|
||||
// std::unique_ptr<NativeRegistration> reg;
|
||||
// std::unique_ptr<GlobalRef> obj;
|
||||
//
|
||||
// // Construction (in .cc file) of User class.
|
||||
// User::User() {
|
||||
@ -156,7 +158,7 @@ class JVM {
|
||||
// Creates a JNIEnvironment object.
|
||||
// This method returns a NULL pointer if AttachCurrentThread() has not been
|
||||
// called successfully. Use the AttachCurrentThreadIfNeeded class if needed.
|
||||
rtc::scoped_ptr<JNIEnvironment> environment();
|
||||
std::unique_ptr<JNIEnvironment> environment();
|
||||
|
||||
// Returns a JavaClass object given class |name|.
|
||||
// Note that the class name must be one of the names in the static
|
||||
|
||||
@ -31,7 +31,7 @@ class MockProcessThread : public ProcessThread {
|
||||
// MOCK_METHOD1 gets confused with mocking this method, so we work around it
|
||||
// by overriding the method from the interface and forwarding the call to a
|
||||
// mocked, simpler method.
|
||||
void PostTask(rtc::scoped_ptr<ProcessTask> task) override {
|
||||
void PostTask(std::unique_ptr<ProcessTask> task) override {
|
||||
PostTask(task.get());
|
||||
}
|
||||
};
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
|
||||
#define WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
|
||||
@ -29,7 +31,7 @@ class ProcessThread {
|
||||
public:
|
||||
virtual ~ProcessThread();
|
||||
|
||||
static rtc::scoped_ptr<ProcessThread> Create(const char* thread_name);
|
||||
static std::unique_ptr<ProcessThread> Create(const char* thread_name);
|
||||
|
||||
// Starts the worker thread. Must be called from the construction thread.
|
||||
virtual void Start() = 0;
|
||||
@ -50,7 +52,7 @@ class ProcessThread {
|
||||
// construction thread of the ProcessThread instance, if the task did not
|
||||
// get a chance to run (e.g. posting the task while shutting down or when
|
||||
// the thread never runs).
|
||||
virtual void PostTask(rtc::scoped_ptr<ProcessTask> task) = 0;
|
||||
virtual void PostTask(std::unique_ptr<ProcessTask> task) = 0;
|
||||
|
||||
// Adds a module that will start to receive callbacks on the worker thread.
|
||||
// Can be called from any thread.
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/utility/include/jvm_android.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
@ -139,7 +141,7 @@ NativeRegistration::~NativeRegistration() {
|
||||
CHECK_EXCEPTION(jni_) << "Error during UnregisterNatives";
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<GlobalRef> NativeRegistration::NewObject(
|
||||
std::unique_ptr<GlobalRef> NativeRegistration::NewObject(
|
||||
const char* name, const char* signature, ...) {
|
||||
ALOGD("NativeRegistration::NewObject%s", GetThreadInfo().c_str());
|
||||
va_list args;
|
||||
@ -149,7 +151,7 @@ rtc::scoped_ptr<GlobalRef> NativeRegistration::NewObject(
|
||||
args);
|
||||
CHECK_EXCEPTION(jni_) << "Error during NewObjectV";
|
||||
va_end(args);
|
||||
return rtc::scoped_ptr<GlobalRef>(new GlobalRef(jni_, obj));
|
||||
return std::unique_ptr<GlobalRef>(new GlobalRef(jni_, obj));
|
||||
}
|
||||
|
||||
// JavaClass implementation.
|
||||
@ -181,14 +183,14 @@ JNIEnvironment::~JNIEnvironment() {
|
||||
RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<NativeRegistration> JNIEnvironment::RegisterNatives(
|
||||
std::unique_ptr<NativeRegistration> JNIEnvironment::RegisterNatives(
|
||||
const char* name, const JNINativeMethod *methods, int num_methods) {
|
||||
ALOGD("JNIEnvironment::RegisterNatives(%s)", name);
|
||||
RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
||||
jclass clazz = LookUpClass(name);
|
||||
jni_->RegisterNatives(clazz, methods, num_methods);
|
||||
CHECK_EXCEPTION(jni_) << "Error during RegisterNatives";
|
||||
return rtc::scoped_ptr<NativeRegistration>(
|
||||
return std::unique_ptr<NativeRegistration>(
|
||||
new NativeRegistration(jni_, clazz));
|
||||
}
|
||||
|
||||
@ -240,7 +242,7 @@ JVM::~JVM() {
|
||||
DeleteGlobalRef(jni(), context_);
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<JNIEnvironment> JVM::environment() {
|
||||
std::unique_ptr<JNIEnvironment> JVM::environment() {
|
||||
ALOGD("JVM::environment%s", GetThreadInfo().c_str());
|
||||
// The JNIEnv is used for thread-local storage. For this reason, we cannot
|
||||
// share a JNIEnv between threads. If a piece of code has no other way to get
|
||||
@ -250,9 +252,9 @@ rtc::scoped_ptr<JNIEnvironment> JVM::environment() {
|
||||
JNIEnv* jni = GetEnv(jvm_);
|
||||
if (!jni) {
|
||||
ALOGE("AttachCurrentThread() has not been called on this thread.");
|
||||
return rtc::scoped_ptr<JNIEnvironment>();
|
||||
return std::unique_ptr<JNIEnvironment>();
|
||||
}
|
||||
return rtc::scoped_ptr<JNIEnvironment>(new JNIEnvironment(jni));
|
||||
return std::unique_ptr<JNIEnvironment>(new JNIEnvironment(jni));
|
||||
}
|
||||
|
||||
JavaClass JVM::GetClass(const char* name) {
|
||||
|
||||
@ -36,9 +36,9 @@ int64_t GetNextCallbackTime(Module* module, int64_t time_now) {
|
||||
ProcessThread::~ProcessThread() {}
|
||||
|
||||
// static
|
||||
rtc::scoped_ptr<ProcessThread> ProcessThread::Create(
|
||||
std::unique_ptr<ProcessThread> ProcessThread::Create(
|
||||
const char* thread_name) {
|
||||
return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl(thread_name));
|
||||
return std::unique_ptr<ProcessThread>(new ProcessThreadImpl(thread_name));
|
||||
}
|
||||
|
||||
ProcessThreadImpl::ProcessThreadImpl(const char* thread_name)
|
||||
@ -119,7 +119,7 @@ void ProcessThreadImpl::WakeUp(Module* module) {
|
||||
wake_up_->Set();
|
||||
}
|
||||
|
||||
void ProcessThreadImpl::PostTask(rtc::scoped_ptr<ProcessTask> task) {
|
||||
void ProcessThreadImpl::PostTask(std::unique_ptr<ProcessTask> task) {
|
||||
// Allowed to be called on any thread.
|
||||
{
|
||||
rtc::CritScope lock(&lock_);
|
||||
|
||||
@ -33,7 +33,7 @@ class ProcessThreadImpl : public ProcessThread {
|
||||
void Stop() override;
|
||||
|
||||
void WakeUp(Module* module) override;
|
||||
void PostTask(rtc::scoped_ptr<ProcessTask> task) override;
|
||||
void PostTask(std::unique_ptr<ProcessTask> task) override;
|
||||
|
||||
void RegisterModule(Module* module) override;
|
||||
void DeRegisterModule(Module* module) override;
|
||||
|
||||
@ -195,7 +195,7 @@ class ProcessThreadMock : public ProcessThread {
|
||||
MOCK_METHOD1(WakeUp, void(Module* module));
|
||||
MOCK_METHOD1(RegisterModule, void(Module* module));
|
||||
MOCK_METHOD1(DeRegisterModule, void(Module* module));
|
||||
void PostTask(rtc::scoped_ptr<ProcessTask> task) {}
|
||||
void PostTask(std::unique_ptr<ProcessTask> task) {}
|
||||
};
|
||||
|
||||
class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>,
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <queue>
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/video_coding/frame_object.h"
|
||||
#include "webrtc/modules/video_coding/packet_buffer.h"
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_NOISE_ESTIMATION_H_
|
||||
#define WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_NOISE_ESTIMATION_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/include/module_common_types.h"
|
||||
#include "webrtc/modules/video_processing/include/video_processing_defines.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user