Replace scoped_ptr with unique_ptr in webrtc/media/
BUG=webrtc:5520 Review URL: https://codereview.webrtc.org/1728503002 Cr-Commit-Position: refs/heads/master@{#11779}
This commit is contained in:
parent
029e220593
commit
686a8efad9
@ -13,6 +13,7 @@
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -332,7 +333,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
||||
|
||||
virtual void SetRawAudioSink(
|
||||
uint32_t ssrc,
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
sink_ = std::move(sink);
|
||||
}
|
||||
|
||||
@ -408,7 +409,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
||||
int time_since_last_typing_;
|
||||
AudioOptions options_;
|
||||
std::map<uint32_t, VoiceChannelAudioSink*> local_renderers_;
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_;
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink_;
|
||||
};
|
||||
|
||||
// A helper function to compare the FakeVoiceMediaChannel::DtmfInfo.
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/timeutils.h"
|
||||
@ -99,7 +100,7 @@ class FakeVideoCapturer : public cricket::VideoCapturer {
|
||||
frame.time_stamp = initial_unix_timestamp_ + next_timestamp_;
|
||||
next_timestamp_ += timestamp_interval;
|
||||
|
||||
rtc::scoped_ptr<char[]> data(new char[size]);
|
||||
std::unique_ptr<char[]> data(new char[size]);
|
||||
frame.data = data.get();
|
||||
// Copy something non-zero into the buffer so Validate wont complain that
|
||||
// the frame is all duplicate.
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#ifndef WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
|
||||
#define WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/media/base/codec.h"
|
||||
#include "webrtc/media/base/mediachannel.h"
|
||||
#include "webrtc/media/base/mediaengine.h"
|
||||
@ -49,8 +49,8 @@ class HybridDataEngine : public DataEngineInterface {
|
||||
virtual const std::vector<DataCodec>& data_codecs() { return codecs_; }
|
||||
|
||||
private:
|
||||
rtc::scoped_ptr<DataEngineInterface> first_;
|
||||
rtc::scoped_ptr<DataEngineInterface> second_;
|
||||
std::unique_ptr<DataEngineInterface> first_;
|
||||
std::unique_ptr<DataEngineInterface> second_;
|
||||
std::vector<DataCodec> codecs_;
|
||||
};
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
|
||||
#define WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -924,7 +925,7 @@ class VoiceMediaChannel : public MediaChannel {
|
||||
|
||||
virtual void SetRawAudioSink(
|
||||
uint32_t ssrc,
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0;
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink) = 0;
|
||||
};
|
||||
|
||||
struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
|
||||
#define WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -40,7 +41,7 @@ class RtpDataEngine : public DataEngineInterface {
|
||||
|
||||
private:
|
||||
std::vector<DataCodec> data_codecs_;
|
||||
rtc::scoped_ptr<rtc::Timing> timing_;
|
||||
std::unique_ptr<rtc::Timing> timing_;
|
||||
};
|
||||
|
||||
// Keep track of sequence number and timestamp of an RTP stream. The
|
||||
@ -116,7 +117,7 @@ class RtpDataMediaChannel : public DataMediaChannel {
|
||||
std::vector<StreamParams> send_streams_;
|
||||
std::vector<StreamParams> recv_streams_;
|
||||
std::map<uint32_t, RtpClock*> rtp_clock_by_send_ssrc_;
|
||||
rtc::scoped_ptr<rtc::RateLimiter> send_limiter_;
|
||||
std::unique_ptr<rtc::RateLimiter> send_limiter_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/gunit.h"
|
||||
#include "webrtc/base/helpers.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/ssladapter.h"
|
||||
#include "webrtc/base/timing.h"
|
||||
#include "webrtc/media/base/constants.h"
|
||||
@ -124,7 +124,7 @@ class RtpDataMediaChannelTest : public testing::Test {
|
||||
|
||||
std::string GetSentData(int index) {
|
||||
// Assume RTP header of length 12
|
||||
rtc::scoped_ptr<const rtc::Buffer> packet(
|
||||
std::unique_ptr<const rtc::Buffer> packet(
|
||||
iface_->GetRtpPacket(index));
|
||||
if (packet->size() > 12) {
|
||||
return std::string(packet->data<char>() + 12, packet->size() - 12);
|
||||
@ -134,7 +134,7 @@ class RtpDataMediaChannelTest : public testing::Test {
|
||||
}
|
||||
|
||||
cricket::RtpHeader GetSentDataHeader(int index) {
|
||||
rtc::scoped_ptr<const rtc::Buffer> packet(
|
||||
std::unique_ptr<const rtc::Buffer> packet(
|
||||
iface_->GetRtpPacket(index));
|
||||
cricket::RtpHeader header;
|
||||
GetRtpHeader(packet->data(), packet->size(), &header);
|
||||
@ -142,15 +142,15 @@ class RtpDataMediaChannelTest : public testing::Test {
|
||||
}
|
||||
|
||||
private:
|
||||
rtc::scoped_ptr<cricket::RtpDataEngine> dme_;
|
||||
std::unique_ptr<cricket::RtpDataEngine> dme_;
|
||||
// Timing passed into dme_. Owned by dme_;
|
||||
FakeTiming* timing_;
|
||||
rtc::scoped_ptr<cricket::FakeNetworkInterface> iface_;
|
||||
rtc::scoped_ptr<FakeDataReceiver> receiver_;
|
||||
std::unique_ptr<cricket::FakeNetworkInterface> iface_;
|
||||
std::unique_ptr<FakeDataReceiver> receiver_;
|
||||
};
|
||||
|
||||
TEST_F(RtpDataMediaChannelTest, SetUnknownCodecs) {
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
cricket::DataCodec known_codec;
|
||||
known_codec.id = 103;
|
||||
@ -185,7 +185,7 @@ TEST_F(RtpDataMediaChannelTest, SetUnknownCodecs) {
|
||||
}
|
||||
|
||||
TEST_F(RtpDataMediaChannelTest, AddRemoveSendStream) {
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
cricket::StreamParams stream1;
|
||||
stream1.add_ssrc(41);
|
||||
@ -200,7 +200,7 @@ TEST_F(RtpDataMediaChannelTest, AddRemoveSendStream) {
|
||||
}
|
||||
|
||||
TEST_F(RtpDataMediaChannelTest, AddRemoveRecvStream) {
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
cricket::StreamParams stream1;
|
||||
stream1.add_ssrc(41);
|
||||
@ -215,7 +215,7 @@ TEST_F(RtpDataMediaChannelTest, AddRemoveRecvStream) {
|
||||
}
|
||||
|
||||
TEST_F(RtpDataMediaChannelTest, SendData) {
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
cricket::SendDataParams params;
|
||||
params.ssrc = 42;
|
||||
@ -293,12 +293,12 @@ TEST_F(RtpDataMediaChannelTest, SendData) {
|
||||
TEST_F(RtpDataMediaChannelTest, SendDataMultipleClocks) {
|
||||
// Timings owned by RtpDataEngines.
|
||||
FakeTiming* timing1 = new FakeTiming();
|
||||
rtc::scoped_ptr<cricket::RtpDataEngine> dme1(CreateEngine(timing1));
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc1(
|
||||
std::unique_ptr<cricket::RtpDataEngine> dme1(CreateEngine(timing1));
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc1(
|
||||
CreateChannel(dme1.get()));
|
||||
FakeTiming* timing2 = new FakeTiming();
|
||||
rtc::scoped_ptr<cricket::RtpDataEngine> dme2(CreateEngine(timing2));
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc2(
|
||||
std::unique_ptr<cricket::RtpDataEngine> dme2(CreateEngine(timing2));
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc2(
|
||||
CreateChannel(dme2.get()));
|
||||
|
||||
ASSERT_TRUE(dmc1->SetSend(true));
|
||||
@ -354,7 +354,7 @@ TEST_F(RtpDataMediaChannelTest, SendDataMultipleClocks) {
|
||||
}
|
||||
|
||||
TEST_F(RtpDataMediaChannelTest, SendDataRate) {
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
ASSERT_TRUE(dmc->SetSend(true));
|
||||
|
||||
@ -412,7 +412,7 @@ TEST_F(RtpDataMediaChannelTest, ReceiveData) {
|
||||
};
|
||||
rtc::Buffer packet(data, sizeof(data));
|
||||
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
// SetReceived not called.
|
||||
dmc->OnPacketReceived(&packet, rtc::PacketTime());
|
||||
@ -452,7 +452,7 @@ TEST_F(RtpDataMediaChannelTest, InvalidRtpPackets) {
|
||||
};
|
||||
rtc::Buffer packet(data, sizeof(data));
|
||||
|
||||
rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
|
||||
|
||||
// Too short
|
||||
dmc->OnPacketReceived(&packet, rtc::PacketTime());
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/bytebuffer.h"
|
||||
@ -61,7 +62,7 @@ TEST(RtpDumpTest, ReadRtpDumpFile) {
|
||||
RtpDumpPacket packet;
|
||||
rtc::MemoryStream stream;
|
||||
RtpDumpWriter writer(&stream);
|
||||
rtc::scoped_ptr<RtpDumpReader> reader;
|
||||
std::unique_ptr<RtpDumpReader> reader;
|
||||
|
||||
// Write a RTP packet to the stream, which is a valid RTP dump. Next, we will
|
||||
// change the first line to make the RTP dump valid or invalid.
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/bytebuffer.h"
|
||||
#include "webrtc/base/fileutils.h"
|
||||
@ -265,7 +266,7 @@ bool LoadPlanarYuvTestImage(const std::string& prefix,
|
||||
std::stringstream ss;
|
||||
ss << prefix << "." << width << "x" << height << "_P420.yuv";
|
||||
|
||||
rtc::scoped_ptr<rtc::FileStream> stream(
|
||||
std::unique_ptr<rtc::FileStream> stream(
|
||||
rtc::Filesystem::OpenFile(rtc::Pathname(
|
||||
GetTestFilePath(ss.str())), "rb"));
|
||||
if (!stream) {
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
|
||||
#include "webrtc/base/common.h" // For ASSERT
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/sigslot.h"
|
||||
#include "webrtc/media/base/videocommon.h"
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
// If we don't have a WebRtcVideoFrame, just skip all of these tests.
|
||||
#if defined(HAVE_WEBRTC_VIDEO)
|
||||
#include <limits.h> // For INT_MAX
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -132,9 +134,9 @@ class VideoAdapterTest : public testing::Test {
|
||||
EXPECT_EQ(height, stats.adapted_height);
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<FakeVideoCapturer> capturer_;
|
||||
rtc::scoped_ptr<VideoAdapter> adapter_;
|
||||
rtc::scoped_ptr<VideoCapturerListener> listener_;
|
||||
std::unique_ptr<FakeVideoCapturer> capturer_;
|
||||
std::unique_ptr<VideoAdapter> adapter_;
|
||||
std::unique_ptr<VideoCapturerListener> listener_;
|
||||
VideoFormat capture_format_;
|
||||
};
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@ bool VideoCapturer::Pause(bool pause) {
|
||||
return false;
|
||||
}
|
||||
LOG(LS_INFO) << "Pausing a camera.";
|
||||
rtc::scoped_ptr<VideoFormat> capture_format_when_paused(
|
||||
std::unique_ptr<VideoFormat> capture_format_when_paused(
|
||||
capture_format_ ? new VideoFormat(*capture_format_) : NULL);
|
||||
Stop();
|
||||
SetCaptureState(CS_PAUSED);
|
||||
@ -351,7 +351,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*,
|
||||
}
|
||||
|
||||
// Use a temporary buffer to scale
|
||||
rtc::scoped_ptr<uint8_t[]> scale_buffer;
|
||||
std::unique_ptr<uint8_t[]> scale_buffer;
|
||||
|
||||
if (IsScreencast()) {
|
||||
int scaled_width, scaled_height;
|
||||
@ -400,7 +400,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*,
|
||||
// TODO(fbarchard): Avoid scale and convert if muted.
|
||||
// Temporary buffer is scoped here so it will persist until i420_frame.Init()
|
||||
// makes a copy of the frame, converting to I420.
|
||||
rtc::scoped_ptr<uint8_t[]> temp_buffer;
|
||||
std::unique_ptr<uint8_t[]> temp_buffer;
|
||||
// YUY2 can be scaled vertically using an ARGB scaler. Aspect ratio is only
|
||||
// a problem on OSX. OSX always converts webcams to YUY2 or UYVY.
|
||||
bool can_scale =
|
||||
@ -512,7 +512,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*,
|
||||
return;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<VideoFrame> adapted_frame(
|
||||
std::unique_ptr<VideoFrame> adapted_frame(
|
||||
frame_factory_->CreateAliasedFrame(captured_frame,
|
||||
cropped_width, cropped_height,
|
||||
adapted_width, adapted_height));
|
||||
@ -550,7 +550,7 @@ void VideoCapturer::SetCaptureState(CaptureState state) {
|
||||
void VideoCapturer::OnMessage(rtc::Message* message) {
|
||||
switch (message->message_id) {
|
||||
case MSG_STATE_CHANGE: {
|
||||
rtc::scoped_ptr<StateChangeParams> p(
|
||||
std::unique_ptr<StateChangeParams> p(
|
||||
static_cast<StateChangeParams*>(message->pdata));
|
||||
SignalStateChange(this, p->data());
|
||||
break;
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#define WEBRTC_MEDIA_BASE_VIDEOCAPTURER_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -22,7 +23,6 @@
|
||||
#include "webrtc/media/base/videosourceinterface.h"
|
||||
#include "webrtc/base/messagehandler.h"
|
||||
#include "webrtc/base/rollingaccumulator.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/sigslot.h"
|
||||
#include "webrtc/base/thread.h"
|
||||
#include "webrtc/base/timing.h"
|
||||
@ -342,10 +342,10 @@ class VideoCapturer : public sigslot::has_slots<>,
|
||||
rtc::Thread* thread_;
|
||||
std::string id_;
|
||||
CaptureState capture_state_;
|
||||
rtc::scoped_ptr<VideoFrameFactory> frame_factory_;
|
||||
rtc::scoped_ptr<VideoFormat> capture_format_;
|
||||
std::unique_ptr<VideoFrameFactory> frame_factory_;
|
||||
std::unique_ptr<VideoFormat> capture_format_;
|
||||
std::vector<VideoFormat> supported_formats_;
|
||||
rtc::scoped_ptr<VideoFormat> max_format_;
|
||||
std::unique_ptr<VideoFormat> max_format_;
|
||||
std::vector<VideoFormat> filtered_supported_formats_;
|
||||
|
||||
int ratio_w_; // View resolution. e.g. 1280 x 720.
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ // NOLINT
|
||||
#define WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -338,7 +339,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
bool CountRtcpFir(int start_index, int stop_index, int* fir_count) {
|
||||
int count = 0;
|
||||
for (int i = start_index; i < stop_index; ++i) {
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtcpPacket(i));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtcpPacket(i));
|
||||
rtc::ByteBuffer buf(*p);
|
||||
size_t total_len = 0;
|
||||
// The packet may be a compound RTCP packet.
|
||||
@ -403,7 +404,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(SetSend(true));
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
||||
}
|
||||
// Tests that we can send and receive frames.
|
||||
@ -414,7 +415,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout);
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
||||
}
|
||||
void SendReceiveManyAndGetStats(const cricket::VideoCodec& codec,
|
||||
@ -429,7 +430,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_FRAME_WAIT(frame + i * fps, codec.width, codec.height, kTimeout);
|
||||
}
|
||||
}
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
||||
}
|
||||
|
||||
@ -557,7 +558,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
|
||||
// Add an additional capturer, and hook up a renderer to receive it.
|
||||
cricket::FakeVideoRenderer renderer2;
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
CreateFakeVideoCapturer());
|
||||
capturer->SetScreencast(true);
|
||||
const int kTestWidth = 160;
|
||||
@ -623,7 +624,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
||||
uint32_t ssrc = 0;
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
||||
EXPECT_EQ(kSsrc, ssrc);
|
||||
// Packets are being paced out, so these can mismatch between the first and
|
||||
@ -646,7 +647,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(WaitAndSendFrame(0));
|
||||
EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout);
|
||||
uint32_t ssrc = 0;
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
||||
EXPECT_EQ(999u, ssrc);
|
||||
// Packets are being paced out, so these can mismatch between the first and
|
||||
@ -696,7 +697,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_GT(NumRtpPackets(), 0);
|
||||
uint32_t ssrc = 0;
|
||||
size_t last_packet = NumRtpPackets() - 1;
|
||||
rtc::scoped_ptr<const rtc::Buffer>
|
||||
std::unique_ptr<const rtc::Buffer>
|
||||
p(GetRtpPacket(static_cast<int>(last_packet)));
|
||||
ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL);
|
||||
EXPECT_EQ(kSsrc, ssrc);
|
||||
@ -746,7 +747,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_FRAME_ON_RENDERER_WAIT(
|
||||
renderer2, 1, DefaultCodec().width, DefaultCodec().height, kTimeout);
|
||||
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
EXPECT_EQ(DefaultCodec().id, GetPayloadType(p.get()));
|
||||
EXPECT_EQ(DefaultCodec().width, renderer1.width());
|
||||
EXPECT_EQ(DefaultCodec().height, renderer1.height());
|
||||
@ -768,7 +769,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_EQ(0, renderer_.num_rendered_frames());
|
||||
EXPECT_TRUE(SendFrame());
|
||||
EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout);
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
CreateFakeVideoCapturer());
|
||||
capturer->SetScreencast(true);
|
||||
cricket::VideoFormat format(480, 360,
|
||||
@ -865,7 +866,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetSink(1, &renderer1));
|
||||
EXPECT_TRUE(channel_->AddSendStream(
|
||||
cricket::StreamParams::CreateLegacy(1)));
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer1(
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> capturer1(
|
||||
CreateFakeVideoCapturer());
|
||||
capturer1->SetScreencast(true);
|
||||
EXPECT_EQ(cricket::CS_RUNNING, capturer1->Start(capture_format));
|
||||
@ -877,7 +878,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(channel_->SetSink(2, &renderer2));
|
||||
EXPECT_TRUE(channel_->AddSendStream(
|
||||
cricket::StreamParams::CreateLegacy(2)));
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer2(
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> capturer2(
|
||||
CreateFakeVideoCapturer());
|
||||
capturer2->SetScreencast(true);
|
||||
EXPECT_EQ(cricket::CS_RUNNING, capturer2->Start(capture_format));
|
||||
@ -933,7 +934,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
|
||||
// Registering an external capturer is currently the same as screen casting
|
||||
// (update the test when this changes).
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> capturer(
|
||||
CreateFakeVideoCapturer());
|
||||
capturer->SetScreencast(true);
|
||||
const std::vector<cricket::VideoFormat>* formats =
|
||||
@ -1007,7 +1008,7 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered.
|
||||
frame_count += 2;
|
||||
EXPECT_FRAME_WAIT(frame_count, codec.width, codec.height, kTimeout);
|
||||
rtc::scoped_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
std::unique_ptr<const rtc::Buffer> p(GetRtpPacket(0));
|
||||
EXPECT_EQ(codec.id, GetPayloadType(p.get()));
|
||||
|
||||
// The channel requires 15 fps.
|
||||
@ -1175,11 +1176,11 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
EXPECT_EQ(0u, channel_->GetDefaultSendChannelSsrc());
|
||||
}
|
||||
|
||||
const rtc::scoped_ptr<webrtc::Call> call_;
|
||||
const std::unique_ptr<webrtc::Call> call_;
|
||||
VideoEngineOverride<E> engine_;
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> video_capturer_;
|
||||
rtc::scoped_ptr<cricket::FakeVideoCapturer> video_capturer_2_;
|
||||
rtc::scoped_ptr<C> channel_;
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_;
|
||||
std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_2_;
|
||||
std::unique_ptr<C> channel_;
|
||||
cricket::FakeNetworkInterface network_interface_;
|
||||
cricket::FakeVideoRenderer renderer_;
|
||||
cricket::VideoMediaChannel::Error media_error_;
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#define WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "libyuv/convert.h"
|
||||
@ -81,7 +82,7 @@ class VideoFrameTest : public testing::Test {
|
||||
int dh,
|
||||
webrtc::VideoRotation rotation,
|
||||
T* frame) {
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(LoadSample(filename));
|
||||
std::unique_ptr<rtc::MemoryStream> ms(LoadSample(filename));
|
||||
return LoadFrame(ms.get(), format, width, height, dw, dh, rotation, frame);
|
||||
}
|
||||
// Load a video frame from a memory stream.
|
||||
@ -142,7 +143,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
rtc::MemoryStream* LoadSample(const std::string& filename) {
|
||||
rtc::Pathname path(cricket::GetTestFilePath(filename));
|
||||
rtc::scoped_ptr<rtc::FileStream> fs(
|
||||
std::unique_ptr<rtc::FileStream> fs(
|
||||
rtc::Filesystem::OpenFile(path, "rb"));
|
||||
if (!fs.get()) {
|
||||
LOG(LS_ERROR) << "Could not open test file path: " << path.pathname()
|
||||
@ -152,7 +153,7 @@ class VideoFrameTest : public testing::Test {
|
||||
}
|
||||
|
||||
char buf[4096];
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
new rtc::MemoryStream());
|
||||
rtc::StreamResult res = Flow(fs.get(), buf, sizeof(buf), ms.get());
|
||||
if (res != rtc::SR_SUCCESS) {
|
||||
@ -165,7 +166,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
bool DumpSample(const std::string& filename, const void* buffer, int size) {
|
||||
rtc::Pathname path(filename);
|
||||
rtc::scoped_ptr<rtc::FileStream> fs(
|
||||
std::unique_ptr<rtc::FileStream> fs(
|
||||
rtc::Filesystem::OpenFile(path, "wb"));
|
||||
if (!fs.get()) {
|
||||
return false;
|
||||
@ -188,7 +189,7 @@ class VideoFrameTest : public testing::Test {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
new rtc::MemoryStream);
|
||||
int awidth = (width + 1) & ~1;
|
||||
int size = awidth * 2 * height;
|
||||
@ -212,7 +213,7 @@ class VideoFrameTest : public testing::Test {
|
||||
rtc::MemoryStream* CreateYuvSample(uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t bpp) {
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
new rtc::MemoryStream);
|
||||
if (!ms->ReserveSize(width * height * bpp / 8)) {
|
||||
return NULL;
|
||||
@ -233,7 +234,7 @@ class VideoFrameTest : public testing::Test {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
new rtc::MemoryStream);
|
||||
if (!ms->ReserveSize(width * height * bytes)) {
|
||||
return NULL;
|
||||
@ -505,7 +506,7 @@ class VideoFrameTest : public testing::Test {
|
||||
void ConstructI420() {
|
||||
T frame;
|
||||
EXPECT_TRUE(IsNull(frame));
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuvSample(kWidth, kHeight, 12));
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420,
|
||||
kWidth, kHeight, &frame));
|
||||
@ -520,7 +521,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YV12 buffer.
|
||||
void ConstructYV12() {
|
||||
T frame;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuvSample(kWidth, kHeight, 12));
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YV12,
|
||||
kWidth, kHeight, &frame));
|
||||
@ -537,7 +538,7 @@ class VideoFrameTest : public testing::Test {
|
||||
T frame1, frame2;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
size_t buf_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment]);
|
||||
uint8_t* y = ALIGNP(buf.get(), kAlignment);
|
||||
uint8_t* u = y + kWidth * kHeight;
|
||||
uint8_t* v = u + (kWidth / 2) * kHeight;
|
||||
@ -558,7 +559,7 @@ class VideoFrameTest : public testing::Test {
|
||||
T frame1, frame2;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
size_t buf_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment]);
|
||||
uint8_t* yuy2 = ALIGNP(buf.get(), kAlignment);
|
||||
EXPECT_EQ(0, libyuv::I420ToYUY2(frame1.GetYPlane(), frame1.GetYPitch(),
|
||||
frame1.GetUPlane(), frame1.GetUPitch(),
|
||||
@ -575,7 +576,7 @@ class VideoFrameTest : public testing::Test {
|
||||
T frame1, frame2;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
size_t buf_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment + 1]);
|
||||
std::unique_ptr<uint8_t[]> buf(new uint8_t[buf_size + kAlignment + 1]);
|
||||
uint8_t* yuy2 = ALIGNP(buf.get(), kAlignment) + 1;
|
||||
EXPECT_EQ(0, libyuv::I420ToYUY2(frame1.GetYPlane(), frame1.GetYPitch(),
|
||||
frame1.GetUPlane(), frame1.GetUPitch(),
|
||||
@ -591,7 +592,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Normal is 1280x720. Wide is 12800x72
|
||||
void ConstructYuy2Wide() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth * 10, kHeight / 10));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2,
|
||||
@ -605,7 +606,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a UYVY buffer.
|
||||
void ConstructUyvy() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight,
|
||||
@ -619,7 +620,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// We are merely verifying that the code succeeds and is free of crashes.
|
||||
void ConstructM420() {
|
||||
T frame;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuvSample(kWidth, kHeight, 12));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_M420,
|
||||
@ -628,7 +629,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
void ConstructNV21() {
|
||||
T frame;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuvSample(kWidth, kHeight, 12));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_NV21,
|
||||
@ -637,7 +638,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
void ConstructNV12() {
|
||||
T frame;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuvSample(kWidth, kHeight, 12));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_NV12,
|
||||
@ -648,7 +649,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Due to rounding, some pixels may differ slightly from the VideoFrame impl.
|
||||
void ConstructABGR() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ABGR, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ABGR, kWidth, kHeight,
|
||||
@ -662,7 +663,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Due to rounding, some pixels may differ slightly from the VideoFrame impl.
|
||||
void ConstructARGB() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight,
|
||||
@ -676,7 +677,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Normal is 1280x720. Wide is 12800x72
|
||||
void ConstructARGBWide() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ARGB, kWidth * 10, kHeight / 10));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB,
|
||||
@ -690,7 +691,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Due to rounding, some pixels may differ slightly from the VideoFrame impl.
|
||||
void ConstructBGRA() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_BGRA, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_BGRA, kWidth, kHeight,
|
||||
@ -704,7 +705,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Due to rounding, some pixels may differ slightly from the VideoFrame impl.
|
||||
void Construct24BG() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_24BG, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_24BG, kWidth, kHeight,
|
||||
@ -718,7 +719,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Due to rounding, some pixels may differ slightly from the VideoFrame impl.
|
||||
void ConstructRaw() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_RAW, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_RAW, kWidth, kHeight,
|
||||
@ -732,7 +733,7 @@ class VideoFrameTest : public testing::Test {
|
||||
void ConstructRGB565() {
|
||||
T frame1, frame2;
|
||||
size_t out_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* out = ALIGNP(outbuf.get(), kAlignment);
|
||||
T frame;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
@ -748,7 +749,7 @@ class VideoFrameTest : public testing::Test {
|
||||
void ConstructARGB1555() {
|
||||
T frame1, frame2;
|
||||
size_t out_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* out = ALIGNP(outbuf.get(), kAlignment);
|
||||
T frame;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
@ -764,7 +765,7 @@ class VideoFrameTest : public testing::Test {
|
||||
void ConstructARGB4444() {
|
||||
T frame1, frame2;
|
||||
size_t out_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* out = ALIGNP(outbuf.get(), kAlignment);
|
||||
T frame;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(&frame1));
|
||||
@ -780,7 +781,7 @@ class VideoFrameTest : public testing::Test {
|
||||
#define TEST_MIRROR(FOURCC, BPP) \
|
||||
void Construct##FOURCC##Mirror() { \
|
||||
T frame1, frame2, frame3; \
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms( \
|
||||
std::unique_ptr<rtc::MemoryStream> ms( \
|
||||
CreateYuvSample(kWidth, kHeight, BPP)); \
|
||||
ASSERT_TRUE(ms.get() != NULL); \
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_##FOURCC, kWidth, \
|
||||
@ -811,7 +812,7 @@ class VideoFrameTest : public testing::Test {
|
||||
#define TEST_ROTATE(FOURCC, BPP, ROTATE) \
|
||||
void Construct##FOURCC##Rotate##ROTATE() { \
|
||||
T frame1, frame2, frame3; \
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms( \
|
||||
std::unique_ptr<rtc::MemoryStream> ms( \
|
||||
CreateYuvSample(kWidth, kHeight, BPP)); \
|
||||
ASSERT_TRUE(ms.get() != NULL); \
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_##FOURCC, kWidth, kHeight, \
|
||||
@ -865,7 +866,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a UYVY buffer rotated 90 degrees.
|
||||
void ConstructUyvyRotate90() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight,
|
||||
@ -875,7 +876,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a UYVY buffer rotated 180 degrees.
|
||||
void ConstructUyvyRotate180() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight,
|
||||
@ -886,7 +887,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a UYVY buffer rotated 270 degrees.
|
||||
void ConstructUyvyRotate270() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight,
|
||||
@ -897,7 +898,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YUY2 buffer rotated 90 degrees.
|
||||
void ConstructYuy2Rotate90() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight,
|
||||
@ -907,7 +908,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YUY2 buffer rotated 180 degrees.
|
||||
void ConstructYuy2Rotate180() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight,
|
||||
@ -918,7 +919,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YUY2 buffer rotated 270 degrees.
|
||||
void ConstructYuy2Rotate270() {
|
||||
T frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight,
|
||||
@ -968,7 +969,7 @@ class VideoFrameTest : public testing::Test {
|
||||
}
|
||||
// Convert back to ARGB.
|
||||
size_t out_size = 4;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* out = ALIGNP(outbuf.get(), kAlignment);
|
||||
|
||||
EXPECT_EQ(out_size, frame.ConvertToRgbBuffer(cricket::FOURCC_ARGB,
|
||||
@ -1005,7 +1006,7 @@ class VideoFrameTest : public testing::Test {
|
||||
}
|
||||
// Convert back to ARGB
|
||||
size_t out_size = 10 * 4;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* out = ALIGNP(outbuf.get(), kAlignment);
|
||||
|
||||
EXPECT_EQ(out_size, frame.ConvertToRgbBuffer(cricket::FOURCC_ARGB,
|
||||
@ -1030,7 +1031,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YUY2 buffer with horizontal cropping.
|
||||
void ConstructYuy2CropHorizontal() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight,
|
||||
@ -1044,7 +1045,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from an ARGB buffer with horizontal cropping.
|
||||
void ConstructARGBCropHorizontal() {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight,
|
||||
@ -1134,7 +1135,7 @@ class VideoFrameTest : public testing::Test {
|
||||
int size_adjust,
|
||||
bool expected_result) {
|
||||
T frame;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(LoadSample(name));
|
||||
std::unique_ptr<rtc::MemoryStream> ms(LoadSample(name));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
const uint8_t* sample =
|
||||
reinterpret_cast<const uint8_t*>(ms.get()->GetBuffer());
|
||||
@ -1145,7 +1146,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
// Allocate a buffer with end page aligned.
|
||||
const int kPadToHeapSized = 16 * 1024 * 1024;
|
||||
rtc::scoped_ptr<uint8_t[]> page_buffer(
|
||||
std::unique_ptr<uint8_t[]> page_buffer(
|
||||
new uint8_t[((data_size + kPadToHeapSized + 4095) & ~4095)]);
|
||||
uint8_t* data_ptr = page_buffer.get();
|
||||
if (!data_ptr) {
|
||||
@ -1251,7 +1252,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a YUY2 buffer (and synonymous formats).
|
||||
void ConstructYuy2Aliases() {
|
||||
T frame1, frame2, frame3, frame4;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight,
|
||||
@ -1270,7 +1271,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Test constructing an image from a UYVY buffer (and synonymous formats).
|
||||
void ConstructUyvyAliases() {
|
||||
T frame1, frame2, frame3, frame4;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight,
|
||||
@ -1325,7 +1326,7 @@ class VideoFrameTest : public testing::Test {
|
||||
T frame1, frame2;
|
||||
for (int height = kMinHeightAll; height <= kMaxHeightAll; ++height) {
|
||||
for (int width = kMinWidthAll; width <= kMaxWidthAll; ++width) {
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateYuv422Sample(cricket::FOURCC_YUY2, width, height));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, width, height,
|
||||
@ -1343,7 +1344,7 @@ class VideoFrameTest : public testing::Test {
|
||||
T frame1, frame2;
|
||||
for (int height = kMinHeightAll; height <= kMaxHeightAll; ++height) {
|
||||
for (int width = kMinWidthAll; width <= kMaxWidthAll; ++width) {
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ARGB, width, height));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, width, height,
|
||||
@ -1358,7 +1359,7 @@ class VideoFrameTest : public testing::Test {
|
||||
const int kOddHeight = 260;
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
CreateRgbSample(cricket::FOURCC_ARGB, kOddWidth + i, kOddHeight + j));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB,
|
||||
@ -1374,7 +1375,7 @@ class VideoFrameTest : public testing::Test {
|
||||
// Tests re-initing an existing image.
|
||||
void Reset(webrtc::VideoRotation rotation, bool apply_rotation) {
|
||||
T frame1, frame2;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
LoadSample(kImageFilename));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
size_t data_size;
|
||||
@ -1442,7 +1443,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
int astride = kWidth * bpp + rowpad;
|
||||
size_t out_size = astride * kHeight;
|
||||
rtc::scoped_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment + 1]);
|
||||
std::unique_ptr<uint8_t[]> outbuf(new uint8_t[out_size + kAlignment + 1]);
|
||||
memset(outbuf.get(), 0, out_size + kAlignment + 1);
|
||||
uint8_t* outtop = ALIGNP(outbuf.get(), kAlignment);
|
||||
uint8_t* out = outtop;
|
||||
@ -1760,7 +1761,7 @@ class VideoFrameTest : public testing::Test {
|
||||
void ConvertToI422Buffer() {
|
||||
T frame1, frame2;
|
||||
size_t out_size = kWidth * kHeight * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> buf(new uint8_t[out_size + kAlignment]);
|
||||
std::unique_ptr<uint8_t[]> buf(new uint8_t[out_size + kAlignment]);
|
||||
uint8_t* y = ALIGNP(buf.get(), kAlignment);
|
||||
uint8_t* u = y + kWidth * kHeight;
|
||||
uint8_t* v = u + (kWidth / 2) * kHeight;
|
||||
@ -1785,8 +1786,8 @@ class VideoFrameTest : public testing::Test {
|
||||
///////////////////
|
||||
|
||||
void Copy() {
|
||||
rtc::scoped_ptr<T> source(new T);
|
||||
rtc::scoped_ptr<cricket::VideoFrame> target;
|
||||
std::unique_ptr<T> source(new T);
|
||||
std::unique_ptr<cricket::VideoFrame> target;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(source.get()));
|
||||
target.reset(source->Copy());
|
||||
EXPECT_TRUE(IsEqual(*source, *target, 0));
|
||||
@ -1795,8 +1796,8 @@ class VideoFrameTest : public testing::Test {
|
||||
}
|
||||
|
||||
void CopyIsRef() {
|
||||
rtc::scoped_ptr<T> source(new T);
|
||||
rtc::scoped_ptr<const cricket::VideoFrame> target;
|
||||
std::unique_ptr<T> source(new T);
|
||||
std::unique_ptr<const cricket::VideoFrame> target;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(source.get()));
|
||||
target.reset(source->Copy());
|
||||
EXPECT_TRUE(IsEqual(*source, *target, 0));
|
||||
@ -1807,8 +1808,8 @@ class VideoFrameTest : public testing::Test {
|
||||
}
|
||||
|
||||
void MakeExclusive() {
|
||||
rtc::scoped_ptr<T> source(new T);
|
||||
rtc::scoped_ptr<cricket::VideoFrame> target;
|
||||
std::unique_ptr<T> source(new T);
|
||||
std::unique_ptr<cricket::VideoFrame> target;
|
||||
ASSERT_TRUE(LoadFrameNoRepeat(source.get()));
|
||||
target.reset(source->Copy());
|
||||
EXPECT_TRUE(target->MakeExclusive());
|
||||
@ -1820,7 +1821,7 @@ class VideoFrameTest : public testing::Test {
|
||||
|
||||
void CopyToFrame() {
|
||||
T source;
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(
|
||||
std::unique_ptr<rtc::MemoryStream> ms(
|
||||
LoadSample(kImageFilename));
|
||||
ASSERT_TRUE(ms.get() != NULL);
|
||||
ASSERT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight,
|
||||
|
||||
@ -21,7 +21,7 @@ VideoFrame* VideoFrameFactory::CreateAliasedFrame(
|
||||
int cropped_input_height,
|
||||
int output_width,
|
||||
int output_height) const {
|
||||
rtc::scoped_ptr<VideoFrame> cropped_input_frame(CreateAliasedFrame(
|
||||
std::unique_ptr<VideoFrame> cropped_input_frame(CreateAliasedFrame(
|
||||
input_frame, cropped_input_width, cropped_input_height));
|
||||
if (!cropped_input_frame)
|
||||
return nullptr;
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
#ifndef WEBRTC_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
|
||||
#define WEBRTC_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/base/videoframe.h"
|
||||
|
||||
namespace cricket {
|
||||
@ -53,7 +54,7 @@ class VideoFrameFactory {
|
||||
private:
|
||||
// An internal frame buffer to avoid reallocations. It is mutable because it
|
||||
// does not affect behaviour, only performance.
|
||||
mutable rtc::scoped_ptr<VideoFrame> output_frame_;
|
||||
mutable std::unique_ptr<VideoFrame> output_frame_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
#ifndef WEBRTC_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
|
||||
#define WEBRTC_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/media/base/videorenderer.h"
|
||||
|
||||
namespace cricket {
|
||||
@ -42,7 +43,7 @@ class CarbonVideoRenderer : public VideoRenderer {
|
||||
static OSStatus DrawEventHandler(EventHandlerCallRef handler,
|
||||
EventRef event,
|
||||
void* data);
|
||||
rtc::scoped_ptr<uint8_t[]> image_;
|
||||
std::unique_ptr<uint8_t[]> image_;
|
||||
rtc::CriticalSection image_crit_;
|
||||
int image_width_;
|
||||
int image_height_;
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
#define WEBRTC_MEDIA_DEVICES_DEVICEMANAGER_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/sigslot.h"
|
||||
#include "webrtc/base/stringencode.h"
|
||||
#include "webrtc/base/window.h"
|
||||
@ -178,13 +178,13 @@ class DeviceManager : public DeviceManagerInterface {
|
||||
const char* const exclusion_list[]);
|
||||
|
||||
bool initialized_;
|
||||
rtc::scoped_ptr<
|
||||
std::unique_ptr<
|
||||
VideoDeviceCapturerFactory> video_device_capturer_factory_;
|
||||
rtc::scoped_ptr<
|
||||
std::unique_ptr<
|
||||
ScreenCapturerFactory> screen_capturer_factory_;
|
||||
std::map<std::string, VideoFormat> max_formats_;
|
||||
rtc::scoped_ptr<DeviceWatcher> watcher_;
|
||||
rtc::scoped_ptr<rtc::WindowPicker> window_picker_;
|
||||
std::unique_ptr<DeviceWatcher> watcher_;
|
||||
std::unique_ptr<rtc::WindowPicker> window_picker_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
#include <objbase.h>
|
||||
#include "webrtc/base/win32.h"
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/arraysize.h"
|
||||
@ -21,7 +23,6 @@
|
||||
#include "webrtc/base/gunit.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/pathutils.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/stream.h"
|
||||
#include "webrtc/base/windowpickerfactory.h"
|
||||
#include "webrtc/media/base/fakevideocapturer.h"
|
||||
@ -37,7 +38,6 @@
|
||||
|
||||
using rtc::Pathname;
|
||||
using rtc::FileTimeType;
|
||||
using rtc::scoped_ptr;
|
||||
using cricket::Device;
|
||||
using cricket::DeviceManager;
|
||||
using cricket::DeviceManagerFactory;
|
||||
@ -89,13 +89,13 @@ class DeviceManagerTestFake : public testing::Test {
|
||||
}
|
||||
|
||||
protected:
|
||||
scoped_ptr<DeviceManagerInterface> dm_;
|
||||
std::unique_ptr<DeviceManagerInterface> dm_;
|
||||
};
|
||||
|
||||
|
||||
// Test that we startup/shutdown properly.
|
||||
TEST(DeviceManagerTest, StartupShutdown) {
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
EXPECT_TRUE(dm->Init());
|
||||
dm->Terminate();
|
||||
}
|
||||
@ -103,7 +103,7 @@ TEST(DeviceManagerTest, StartupShutdown) {
|
||||
// Test CoInitEx behavior
|
||||
#ifdef WIN32
|
||||
TEST(DeviceManagerTest, CoInitialize) {
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> devices;
|
||||
// Ensure that calls to video device work if COM is not yet initialized.
|
||||
EXPECT_TRUE(dm->Init());
|
||||
@ -133,7 +133,7 @@ TEST(DeviceManagerTest, CoInitialize) {
|
||||
|
||||
// Test enumerating devices (although we may not find any).
|
||||
TEST(DeviceManagerTest, GetDevices) {
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> audio_ins, audio_outs, video_ins;
|
||||
std::vector<cricket::Device> video_in_devs;
|
||||
cricket::Device def_video;
|
||||
@ -151,7 +151,7 @@ TEST(DeviceManagerTest, GetDevices) {
|
||||
|
||||
// Test that we return correct ids for default and bogus devices.
|
||||
TEST(DeviceManagerTest, GetAudioDeviceIds) {
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
Device device;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
EXPECT_TRUE(dm->GetAudioInputDevice(
|
||||
@ -166,7 +166,7 @@ TEST(DeviceManagerTest, GetAudioDeviceIds) {
|
||||
|
||||
// Test that we get the video capture device by name properly.
|
||||
TEST(DeviceManagerTest, GetVideoDeviceIds) {
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
Device device;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
EXPECT_FALSE(dm->GetVideoCaptureDevice("_NOT A REAL DEVICE_", &device));
|
||||
@ -186,7 +186,7 @@ TEST(DeviceManagerTest, GetVideoDeviceIds) {
|
||||
|
||||
TEST(DeviceManagerTest, VerifyDevicesListsAreCleared) {
|
||||
const std::string imaginary("_NOT A REAL DEVICE_");
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> audio_ins, audio_outs, video_ins;
|
||||
audio_ins.push_back(Device(imaginary, imaginary));
|
||||
audio_outs.push_back(Device(imaginary, imaginary));
|
||||
@ -291,7 +291,7 @@ TEST(DeviceManagerTest, GetVideoCaptureDevices_K2_6) {
|
||||
"Video Device 2"));
|
||||
rtc::FilesystemScope fs(new rtc::FakeFileSystem(files));
|
||||
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> video_ins;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
EXPECT_TRUE(dm->GetVideoCaptureDevices(&video_ins));
|
||||
@ -320,7 +320,7 @@ TEST(DeviceManagerTest, GetVideoCaptureDevices_K2_4) {
|
||||
"param1: value1\nname: Video Device 2\n param2: value2\n"));
|
||||
rtc::FilesystemScope fs(new rtc::FakeFileSystem(files));
|
||||
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> video_ins;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
EXPECT_TRUE(dm->GetVideoCaptureDevices(&video_ins));
|
||||
@ -341,7 +341,7 @@ TEST(DeviceManagerTest, GetVideoCaptureDevices_KUnknown) {
|
||||
files.push_back(rtc::FakeFileSystem::File("/dev/video5", ""));
|
||||
rtc::FilesystemScope fs(new rtc::FakeFileSystem(files));
|
||||
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::vector<Device> video_ins;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
EXPECT_TRUE(dm->GetVideoCaptureDevices(&video_ins));
|
||||
@ -359,7 +359,7 @@ TEST(DeviceManagerTest, GetWindows) {
|
||||
<< "current configuration.";
|
||||
return;
|
||||
}
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
dm->SetScreenCapturerFactory(new FakeScreenCapturerFactory());
|
||||
std::vector<rtc::WindowDescription> descriptions;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
@ -368,7 +368,7 @@ TEST(DeviceManagerTest, GetWindows) {
|
||||
<< "windows to capture.";
|
||||
return;
|
||||
}
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(dm->CreateScreenCapturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(dm->CreateScreenCapturer(
|
||||
cricket::ScreencastId(descriptions.front().id())));
|
||||
EXPECT_FALSE(capturer.get() == NULL);
|
||||
// TODO(hellner): creating a window capturer and immediately deleting it
|
||||
@ -383,7 +383,7 @@ TEST(DeviceManagerTest, GetDesktops) {
|
||||
<< "current configuration.";
|
||||
return;
|
||||
}
|
||||
scoped_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
std::unique_ptr<DeviceManagerInterface> dm(DeviceManagerFactory::Create());
|
||||
dm->SetScreenCapturerFactory(new FakeScreenCapturerFactory());
|
||||
std::vector<rtc::DesktopDescription> descriptions;
|
||||
EXPECT_TRUE(dm->Init());
|
||||
@ -392,7 +392,7 @@ TEST(DeviceManagerTest, GetDesktops) {
|
||||
<< "desktops to capture.";
|
||||
return;
|
||||
}
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(dm->CreateScreenCapturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(dm->CreateScreenCapturer(
|
||||
cricket::ScreencastId(descriptions.front().id())));
|
||||
EXPECT_FALSE(capturer.get() == NULL);
|
||||
}
|
||||
@ -401,7 +401,7 @@ TEST(DeviceManagerTest, GetDesktops) {
|
||||
TEST_F(DeviceManagerTestFake, CaptureConstraintsWhitelisted) {
|
||||
const Device device("white", "white_id");
|
||||
dm_->SetVideoCaptureDeviceMaxFormat(device.name, kHdFormat);
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(
|
||||
dm_->CreateVideoCapturer(device));
|
||||
cricket::VideoFormat best_format;
|
||||
capturer->set_enable_camera_list(true);
|
||||
@ -411,7 +411,7 @@ TEST_F(DeviceManagerTestFake, CaptureConstraintsWhitelisted) {
|
||||
|
||||
TEST_F(DeviceManagerTestFake, CaptureConstraintsNotWhitelisted) {
|
||||
const Device device("regular", "regular_id");
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(
|
||||
dm_->CreateVideoCapturer(device));
|
||||
cricket::VideoFormat best_format;
|
||||
capturer->set_enable_camera_list(true);
|
||||
@ -423,7 +423,7 @@ TEST_F(DeviceManagerTestFake, CaptureConstraintsUnWhitelisted) {
|
||||
const Device device("un_white", "un_white_id");
|
||||
dm_->SetVideoCaptureDeviceMaxFormat(device.name, kHdFormat);
|
||||
dm_->ClearVideoCaptureDeviceMaxFormat(device.name);
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(
|
||||
dm_->CreateVideoCapturer(device));
|
||||
cricket::VideoFormat best_format;
|
||||
capturer->set_enable_camera_list(true);
|
||||
@ -434,7 +434,7 @@ TEST_F(DeviceManagerTestFake, CaptureConstraintsUnWhitelisted) {
|
||||
TEST_F(DeviceManagerTestFake, CaptureConstraintsWildcard) {
|
||||
const Device device("any_device", "any_device");
|
||||
dm_->SetVideoCaptureDeviceMaxFormat("*", kHdFormat);
|
||||
scoped_ptr<cricket::VideoCapturer> capturer(
|
||||
std::unique_ptr<cricket::VideoCapturer> capturer(
|
||||
dm_->CreateVideoCapturer(device));
|
||||
cricket::VideoFormat best_format;
|
||||
capturer->set_enable_camera_list(true);
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
#ifndef WEBRTC_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
|
||||
#define WEBRTC_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/window.h"
|
||||
#include "webrtc/base/windowpicker.h"
|
||||
#include "webrtc/media/base/fakevideocapturer.h"
|
||||
@ -213,7 +213,7 @@ class FakeDeviceManager : public DeviceManagerInterface {
|
||||
std::vector<Device> output_devices_;
|
||||
std::vector<Device> vidcap_devices_;
|
||||
std::map<std::string, VideoFormat> max_formats_;
|
||||
rtc::scoped_ptr<
|
||||
std::unique_ptr<
|
||||
ScreenCapturerFactory> screen_capturer_factory_;
|
||||
};
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
|
||||
#include "webrtc/media/devices/gdivideorenderer.h"
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread.h"
|
||||
#include "webrtc/base/win32window.h"
|
||||
#include "webrtc/media/base/videocommon.h"
|
||||
@ -83,8 +82,8 @@ class GdiVideoRenderer::VideoWindow : public rtc::Win32Window {
|
||||
void OnRenderFrame(const VideoFrame* frame);
|
||||
|
||||
BITMAPINFO bmi_;
|
||||
rtc::scoped_ptr<uint8_t[]> image_;
|
||||
rtc::scoped_ptr<WindowThread> window_thread_;
|
||||
std::unique_ptr<uint8_t[]> image_;
|
||||
std::unique_ptr<WindowThread> window_thread_;
|
||||
// The initial position of the window.
|
||||
int initial_x_;
|
||||
int initial_y_;
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
|
||||
#ifndef WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_
|
||||
#define WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_
|
||||
|
||||
#ifdef WIN32
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/base/videorenderer.h"
|
||||
|
||||
namespace cricket {
|
||||
@ -34,7 +35,7 @@ class GdiVideoRenderer : public VideoRenderer {
|
||||
|
||||
private:
|
||||
class VideoWindow; // forward declaration, defined in the .cc file
|
||||
rtc::scoped_ptr<VideoWindow> window_;
|
||||
std::unique_ptr<VideoWindow> window_;
|
||||
// The initial position of the window.
|
||||
int initial_x_;
|
||||
int initial_y_;
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
#ifndef WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
|
||||
#define WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/basictypes.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/media/base/videorenderer.h"
|
||||
|
||||
typedef struct _GtkWidget GtkWidget; // forward declaration, defined in gtk.h
|
||||
@ -41,7 +42,7 @@ class GtkVideoRenderer : public VideoRenderer {
|
||||
// Check if the window has been closed.
|
||||
bool IsClosed() const;
|
||||
|
||||
rtc::scoped_ptr<uint8_t[]> image_;
|
||||
std::unique_ptr<uint8_t[]> image_;
|
||||
GtkWidget* window_;
|
||||
GtkWidget* draw_area_;
|
||||
// The initial position of the window.
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/devices/deviceinfo.h"
|
||||
|
||||
#include "webrtc/base/common.h" // for ASSERT
|
||||
@ -77,7 +79,7 @@ class ScopedUdevEnumerate {
|
||||
|
||||
bool GetUsbProperty(const Device& device, const char* property_name,
|
||||
std::string* property) {
|
||||
rtc::scoped_ptr<ScopedLibUdev> libudev_context(ScopedLibUdev::Create());
|
||||
std::unique_ptr<ScopedLibUdev> libudev_context(ScopedLibUdev::Create());
|
||||
if (!libudev_context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -11,6 +11,9 @@
|
||||
#include "webrtc/media/devices/linuxdevicemanager.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/fileutils.h"
|
||||
#include "webrtc/base/linux.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
@ -118,7 +121,7 @@ enum MetaType { M2_4, M2_6, NONE };
|
||||
|
||||
static void ScanDeviceDirectory(const std::string& devdir,
|
||||
std::vector<Device>* devices) {
|
||||
rtc::scoped_ptr<rtc::DirectoryIterator> directoryIterator(
|
||||
std::unique_ptr<rtc::DirectoryIterator> directoryIterator(
|
||||
rtc::Filesystem::IterateDirectory());
|
||||
|
||||
if (directoryIterator->Iterate(rtc::Pathname(devdir))) {
|
||||
@ -138,7 +141,7 @@ static void ScanDeviceDirectory(const std::string& devdir,
|
||||
static std::string GetVideoDeviceNameK2_6(const std::string& device_meta_path) {
|
||||
std::string device_name;
|
||||
|
||||
rtc::scoped_ptr<rtc::FileStream> device_meta_stream(
|
||||
std::unique_ptr<rtc::FileStream> device_meta_stream(
|
||||
rtc::Filesystem::OpenFile(device_meta_path, "r"));
|
||||
|
||||
if (device_meta_stream) {
|
||||
@ -227,7 +230,7 @@ static void ScanV4L2Devices(std::vector<Device>* devices) {
|
||||
MetaType meta;
|
||||
std::string metadata_dir;
|
||||
|
||||
rtc::scoped_ptr<rtc::DirectoryIterator> directoryIterator(
|
||||
std::unique_ptr<rtc::DirectoryIterator> directoryIterator(
|
||||
rtc::Filesystem::IterateDirectory());
|
||||
|
||||
// Try and guess kernel version
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include "webrtc/media/devices/macdevicemanager.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <CoreAudio/CoreAudio.h>
|
||||
#include <QuickTime/QuickTime.h>
|
||||
|
||||
@ -102,7 +104,7 @@ static bool GetAudioDeviceIDs(bool input,
|
||||
}
|
||||
|
||||
size_t num_devices = propsize / sizeof(AudioDeviceID);
|
||||
rtc::scoped_ptr<AudioDeviceID[]> device_ids(
|
||||
std::unique_ptr<AudioDeviceID[]> device_ids(
|
||||
new AudioDeviceID[num_devices]);
|
||||
|
||||
err = AudioHardwareGetProperty(kAudioHardwarePropertyDevices,
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/arraysize.h"
|
||||
#include "webrtc/media/devices/devicemanager.h"
|
||||
#include "webrtc/modules/video_capture/video_capture_factory.h"
|
||||
@ -31,7 +33,7 @@ MobileDeviceManager::~MobileDeviceManager() {}
|
||||
|
||||
bool MobileDeviceManager::GetVideoCaptureDevices(std::vector<Device>* devs) {
|
||||
devs->clear();
|
||||
rtc::scoped_ptr<webrtc::VideoCaptureModule::DeviceInfo> info(
|
||||
std::unique_ptr<webrtc::VideoCaptureModule::DeviceInfo> info(
|
||||
webrtc::VideoCaptureFactory::CreateDeviceInfo(0));
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
@ -77,7 +77,7 @@ webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const {
|
||||
|
||||
void FakeAudioReceiveStream::SetSink(
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
sink_ = rtc::UniqueToScoped(std::move(sink));
|
||||
sink_ = std::move(sink);
|
||||
}
|
||||
|
||||
FakeVideoSendStream::FakeVideoSendStream(
|
||||
|
||||
@ -96,7 +96,7 @@ class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream {
|
||||
webrtc::AudioReceiveStream::Config config_;
|
||||
webrtc::AudioReceiveStream::Stats stats_;
|
||||
int received_packets_;
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink_;
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink_;
|
||||
};
|
||||
|
||||
class FakeVideoSendStream final : public webrtc::VideoSendStream,
|
||||
|
||||
@ -11,12 +11,12 @@
|
||||
#ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_
|
||||
#define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/asyncinvoker.h"
|
||||
#include "webrtc/base/messagehandler.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "webrtc/media/base/videocapturer.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframe.h"
|
||||
@ -75,13 +75,13 @@ class WebRtcVideoCapturer : public VideoCapturer,
|
||||
// to follow the same contract.
|
||||
void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame);
|
||||
|
||||
rtc::scoped_ptr<WebRtcVcmFactoryInterface> factory_;
|
||||
std::unique_ptr<WebRtcVcmFactoryInterface> factory_;
|
||||
webrtc::VideoCaptureModule* module_;
|
||||
int captured_frames_;
|
||||
std::vector<uint8_t> capture_buffer_;
|
||||
rtc::Thread* start_thread_; // Set in Start(), unset in Stop();
|
||||
|
||||
rtc::scoped_ptr<rtc::AsyncInvoker> async_invoker_;
|
||||
std::unique_ptr<rtc::AsyncInvoker> async_invoker_;
|
||||
};
|
||||
|
||||
struct WebRtcCapturedFrame : public CapturedFrame {
|
||||
|
||||
@ -11,7 +11,10 @@
|
||||
#ifdef HAVE_WEBRTC_VIDEO
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/gunit.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/stringutils.h"
|
||||
@ -46,7 +49,7 @@ class WebRtcVideoCapturerTest : public testing::Test {
|
||||
|
||||
protected:
|
||||
FakeWebRtcVcmFactory* factory_; // owned by capturer_
|
||||
rtc::scoped_ptr<cricket::WebRtcVideoCapturer> capturer_;
|
||||
std::unique_ptr<cricket::WebRtcVideoCapturer> capturer_;
|
||||
cricket::VideoCapturerListener listener_;
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/engine/webrtcvideocapturer.h"
|
||||
#include "webrtc/media/engine/webrtcvideocapturerfactory.h"
|
||||
|
||||
@ -16,7 +17,7 @@ namespace cricket {
|
||||
|
||||
VideoCapturer* WebRtcVideoDeviceCapturerFactory::Create(const Device& device) {
|
||||
#ifdef HAVE_WEBRTC_VIDEO
|
||||
rtc::scoped_ptr<WebRtcVideoCapturer> capturer(
|
||||
std::unique_ptr<WebRtcVideoCapturer> capturer(
|
||||
new WebRtcVideoCapturer());
|
||||
if (!capturer->Init(device)) {
|
||||
return nullptr;
|
||||
|
||||
@ -12,12 +12,12 @@
|
||||
#define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
#include "webrtc/base/thread_checker.h"
|
||||
#include "webrtc/media/base/videosinkinterface.h"
|
||||
@ -126,7 +126,7 @@ class WebRtcVideoEngine2 {
|
||||
|
||||
WebRtcVideoDecoderFactory* external_decoder_factory_;
|
||||
WebRtcVideoEncoderFactory* external_encoder_factory_;
|
||||
rtc::scoped_ptr<WebRtcVideoEncoderFactory> simulcast_encoder_factory_;
|
||||
std::unique_ptr<WebRtcVideoEncoderFactory> simulcast_encoder_factory_;
|
||||
};
|
||||
|
||||
class WebRtcVideoChannel2 : public VideoMediaChannel,
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/arraysize.h"
|
||||
@ -141,7 +142,7 @@ class WebRtcVideoEngine2Test : public ::testing::Test {
|
||||
webrtc::test::ScopedFieldTrials override_field_trials_;
|
||||
// Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly
|
||||
// initialized when the constructor is called.
|
||||
rtc::scoped_ptr<webrtc::Call> call_;
|
||||
std::unique_ptr<webrtc::Call> call_;
|
||||
WebRtcVoiceEngine voice_engine_;
|
||||
WebRtcVideoEngine2 engine_;
|
||||
VideoCodec default_codec_;
|
||||
@ -230,7 +231,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) {
|
||||
cricket::VideoSendParameters parameters;
|
||||
parameters.codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs));
|
||||
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
|
||||
|
||||
@ -260,7 +261,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) {
|
||||
cricket::VideoSendParameters parameters;
|
||||
parameters.codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs));
|
||||
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
|
||||
|
||||
@ -284,7 +285,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) {
|
||||
|
||||
TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
|
||||
engine_.Init();
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
engine_.CreateChannel(call_.get(), MediaConfig(), VideoOptions()));
|
||||
|
||||
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
|
||||
@ -297,7 +298,7 @@ TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
|
||||
|
||||
TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) {
|
||||
engine_.Init();
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
engine_.CreateChannel(call_.get(), MediaConfig(), VideoOptions()));
|
||||
EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
|
||||
VideoMediaInfo info;
|
||||
@ -310,7 +311,7 @@ TEST_F(WebRtcVideoEngine2Test, UseExternalFactoryForVp8WhenSupported) {
|
||||
cricket::VideoSendParameters parameters;
|
||||
parameters.codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -347,7 +348,7 @@ void WebRtcVideoEngine2Test::TestExtendedEncoderOveruse(
|
||||
encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8");
|
||||
cricket::VideoSendParameters parameters;
|
||||
parameters.codecs.push_back(kVp8Codec);
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel;
|
||||
std::unique_ptr<VideoMediaChannel> channel;
|
||||
FakeCall* fake_call = new FakeCall(webrtc::Call::Config());
|
||||
call_.reset(fake_call);
|
||||
if (use_external_encoder) {
|
||||
@ -384,7 +385,7 @@ TEST_F(WebRtcVideoEngine2Test, CanConstructDecoderForVp9EncoderFactory) {
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kVp9Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -399,7 +400,7 @@ TEST_F(WebRtcVideoEngine2Test, PropagatesInputFrameTimestamp) {
|
||||
|
||||
FakeCall* fake_call = new FakeCall(webrtc::Call::Config());
|
||||
call_.reset(fake_call);
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -459,7 +460,7 @@ TEST_F(WebRtcVideoEngine2Test,
|
||||
|
||||
FakeCall* fake_call = new FakeCall(webrtc::Call::Config());
|
||||
call_.reset(fake_call);
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -476,7 +477,7 @@ TEST_F(WebRtcVideoEngine2Test,
|
||||
frame.fourcc = cricket::FOURCC_I420;
|
||||
frame.data_size = frame.width * frame.height +
|
||||
2 * ((frame.width + 1) / 2) * ((frame.height + 1) / 2);
|
||||
rtc::scoped_ptr<char[]> data(new char[frame.data_size]);
|
||||
std::unique_ptr<char[]> data(new char[frame.data_size]);
|
||||
frame.data = data.get();
|
||||
memset(frame.data, 1, frame.data_size);
|
||||
const int kInitialTimestamp = 123456;
|
||||
@ -543,7 +544,7 @@ TEST_F(WebRtcVideoEngine2Test, UsesSimulcastAdapterForVp8Factories) {
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
||||
@ -583,7 +584,7 @@ TEST_F(WebRtcVideoEngine2Test, ChannelWithExternalH264CanChangeToInternalVp8) {
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kH264Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -603,7 +604,7 @@ TEST_F(WebRtcVideoEngine2Test,
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -621,7 +622,7 @@ TEST_F(WebRtcVideoEngine2Test,
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
||||
@ -657,7 +658,7 @@ TEST_F(WebRtcVideoEngine2Test,
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kH264Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -677,7 +678,7 @@ TEST_F(WebRtcVideoEngine2Test, SimulcastDisabledForH264) {
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kH264Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalEncoderFactory(&encoder_factory, codecs));
|
||||
|
||||
const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
||||
@ -723,7 +724,7 @@ TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) {
|
||||
cricket::VideoRecvParameters parameters;
|
||||
parameters.codecs.push_back(kVp8Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -753,7 +754,7 @@ TEST_F(WebRtcVideoEngine2Test, RegisterExternalH264DecoderIfSupported) {
|
||||
std::vector<cricket::VideoCodec> codecs;
|
||||
codecs.push_back(kH264Codec);
|
||||
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel(
|
||||
std::unique_ptr<VideoMediaChannel> channel(
|
||||
SetUpForExternalDecoderFactory(&decoder_factory, codecs));
|
||||
|
||||
EXPECT_TRUE(
|
||||
@ -1043,8 +1044,8 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
|
||||
return AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
||||
}
|
||||
|
||||
rtc::scoped_ptr<FakeCall> fake_call_;
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel_;
|
||||
std::unique_ptr<FakeCall> fake_call_;
|
||||
std::unique_ptr<VideoMediaChannel> channel_;
|
||||
cricket::VideoSendParameters send_parameters_;
|
||||
cricket::VideoRecvParameters recv_parameters_;
|
||||
uint32_t last_ssrc_;
|
||||
@ -2270,10 +2271,10 @@ TEST_F(WebRtcVideoChannel2Test, SetSend) {
|
||||
|
||||
// This test verifies DSCP settings are properly applied on video media channel.
|
||||
TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) {
|
||||
rtc::scoped_ptr<cricket::FakeNetworkInterface> network_interface(
|
||||
std::unique_ptr<cricket::FakeNetworkInterface> network_interface(
|
||||
new cricket::FakeNetworkInterface);
|
||||
MediaConfig config;
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel;
|
||||
std::unique_ptr<VideoMediaChannel> channel;
|
||||
|
||||
channel.reset(engine_.CreateChannel(call_.get(), config, VideoOptions()));
|
||||
channel->SetInterface(network_interface.get());
|
||||
@ -3063,7 +3064,7 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
||||
|
||||
FakeCall fake_call_;
|
||||
WebRtcVideoEngine2 engine_;
|
||||
rtc::scoped_ptr<VideoMediaChannel> channel_;
|
||||
std::unique_ptr<VideoMediaChannel> channel_;
|
||||
uint32_t last_ssrc_;
|
||||
};
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
|
||||
#define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/refcount.h"
|
||||
#include "webrtc/base/scoped_ref_ptr.h"
|
||||
@ -113,7 +115,7 @@ class WebRtcVideoFrame : public VideoFrame {
|
||||
|
||||
// This is mutable as the calculation is expensive but once calculated, it
|
||||
// remains const.
|
||||
mutable rtc::scoped_ptr<VideoFrame> rotated_frame_;
|
||||
mutable std::unique_ptr<VideoFrame> rotated_frame_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/base/videoframe_unittest.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframe.h"
|
||||
#include "webrtc/test/fake_texture_frame.h"
|
||||
@ -51,7 +53,7 @@ class WebRtcVideoFrameTest : public VideoFrameTest<cricket::WebRtcVideoFrame> {
|
||||
captured_frame.height = frame_height;
|
||||
captured_frame.data_size = (frame_width * frame_height) +
|
||||
((frame_width + 1) / 2) * ((frame_height + 1) / 2) * 2;
|
||||
rtc::scoped_ptr<uint8_t[]> captured_frame_buffer(
|
||||
std::unique_ptr<uint8_t[]> captured_frame_buffer(
|
||||
new uint8_t[captured_frame.data_size]);
|
||||
// Initialize memory to satisfy DrMemory tests.
|
||||
memset(captured_frame_buffer.get(), 0, captured_frame.data_size);
|
||||
@ -300,7 +302,7 @@ TEST_F(WebRtcVideoFrameTest, CopyTextureFrame) {
|
||||
TEST_F(WebRtcVideoFrameTest, ApplyRotationToFrame) {
|
||||
WebRtcVideoTestFrame applied0;
|
||||
EXPECT_TRUE(IsNull(applied0));
|
||||
rtc::scoped_ptr<rtc::MemoryStream> ms(CreateYuvSample(kWidth, kHeight, 12));
|
||||
std::unique_ptr<rtc::MemoryStream> ms(CreateYuvSample(kWidth, kHeight, 12));
|
||||
EXPECT_TRUE(
|
||||
LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, &applied0));
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframe.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframefactory.h"
|
||||
@ -16,7 +18,7 @@ namespace cricket {
|
||||
|
||||
VideoFrame* WebRtcVideoFrameFactory::CreateAliasedFrame(
|
||||
const CapturedFrame* aliased_frame, int width, int height) const {
|
||||
rtc::scoped_ptr<WebRtcVideoFrame> frame(new WebRtcVideoFrame());
|
||||
std::unique_ptr<WebRtcVideoFrame> frame(new WebRtcVideoFrame());
|
||||
if (!frame->Init(aliased_frame, width, height, apply_rotation_)) {
|
||||
LOG(LS_ERROR) <<
|
||||
"Failed to create WebRtcVideoFrame in CreateAliasedFrame.";
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/media/base/videoframe_unittest.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframe.h"
|
||||
#include "webrtc/media/engine/webrtcvideoframefactory.h"
|
||||
@ -68,7 +70,7 @@ class WebRtcVideoFrameFactoryTest
|
||||
InitFrame(webrtc::kVideoRotation_270);
|
||||
const cricket::CapturedFrame& captured_frame = get_captured_frame();
|
||||
// Create the new frame from the CapturedFrame.
|
||||
rtc::scoped_ptr<cricket::VideoFrame> frame;
|
||||
std::unique_ptr<cricket::VideoFrame> frame;
|
||||
int new_width = captured_frame.width / 2;
|
||||
int new_height = captured_frame.height / 2;
|
||||
frame.reset(factory.CreateAliasedFrame(&captured_frame, new_width,
|
||||
@ -94,7 +96,7 @@ class WebRtcVideoFrameFactoryTest
|
||||
|
||||
private:
|
||||
cricket::CapturedFrame captured_frame_;
|
||||
rtc::scoped_ptr<uint8_t[]> captured_frame_buffer_;
|
||||
std::unique_ptr<uint8_t[]> captured_frame_buffer_;
|
||||
cricket::WebRtcVideoFrameFactory factory_;
|
||||
};
|
||||
|
||||
|
||||
@ -44,7 +44,8 @@ class scoped_voe_engine {
|
||||
webrtc::VoiceEngine* ptr;
|
||||
};
|
||||
|
||||
// scoped_ptr class to handle obtaining and releasing WebRTC interface pointers
|
||||
// unique_ptr-like class to handle obtaining and releasing WebRTC interface
|
||||
// pointers.
|
||||
template<class T>
|
||||
class scoped_voe_ptr {
|
||||
public:
|
||||
|
||||
@ -1310,9 +1310,9 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
|
||||
return config_.voe_channel_id;
|
||||
}
|
||||
|
||||
void SetRawAudioSink(rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
void SetRawAudioSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
stream_->SetSink(rtc::ScopedToUnique(std::move(sink)));
|
||||
stream_->SetSink(std::move(sink));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -2236,7 +2236,7 @@ void WebRtcVoiceMediaChannel::OnPacketReceived(
|
||||
default_recv_ssrc_ = ssrc;
|
||||
SetOutputVolume(default_recv_ssrc_, default_recv_volume_);
|
||||
if (default_sink_) {
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> proxy_sink(
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> proxy_sink(
|
||||
new ProxySink(default_sink_.get()));
|
||||
SetRawAudioSink(default_recv_ssrc_, std::move(proxy_sink));
|
||||
}
|
||||
@ -2466,13 +2466,13 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
|
||||
|
||||
void WebRtcVoiceMediaChannel::SetRawAudioSink(
|
||||
uint32_t ssrc,
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink) {
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink: ssrc:" << ssrc
|
||||
<< " " << (sink ? "(ptr)" : "NULL");
|
||||
if (ssrc == 0) {
|
||||
if (default_recv_ssrc_ != -1) {
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> proxy_sink(
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> proxy_sink(
|
||||
sink ? new ProxySink(sink.get()) : nullptr);
|
||||
SetRawAudioSink(default_recv_ssrc_, std::move(proxy_sink));
|
||||
}
|
||||
|
||||
@ -12,12 +12,12 @@
|
||||
#define WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/audio_state.h"
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/stream.h"
|
||||
#include "webrtc/base/thread_checker.h"
|
||||
#include "webrtc/call.h"
|
||||
@ -113,7 +113,7 @@ class WebRtcVoiceEngine final : public webrtc::TraceCallback {
|
||||
rtc::ThreadChecker worker_thread_checker_;
|
||||
|
||||
// The primary instance of WebRtc VoiceEngine.
|
||||
rtc::scoped_ptr<VoEWrapper> voe_wrapper_;
|
||||
std::unique_ptr<VoEWrapper> voe_wrapper_;
|
||||
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
|
||||
// The external audio device manager
|
||||
webrtc::AudioDeviceModule* adm_ = nullptr;
|
||||
@ -188,7 +188,7 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
|
||||
|
||||
void SetRawAudioSink(
|
||||
uint32_t ssrc,
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) override;
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> sink) override;
|
||||
|
||||
// implements Transport interface
|
||||
bool SendRtp(const uint8_t* data,
|
||||
@ -240,7 +240,7 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
|
||||
WebRtcVoiceEngine* const engine_ = nullptr;
|
||||
std::vector<AudioCodec> recv_codecs_;
|
||||
std::vector<AudioCodec> send_codecs_;
|
||||
rtc::scoped_ptr<webrtc::CodecInst> send_codec_;
|
||||
std::unique_ptr<webrtc::CodecInst> send_codec_;
|
||||
bool send_bitrate_setting_ = false;
|
||||
int send_bitrate_bps_ = 0;
|
||||
AudioOptions options_;
|
||||
@ -258,7 +258,7 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
|
||||
// Volume for unsignalled stream, which may be set before the stream exists.
|
||||
double default_recv_volume_ = 1.0;
|
||||
// Sink for unsignalled stream, which may be set before the stream exists.
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface> default_sink_;
|
||||
std::unique_ptr<webrtc::AudioSinkInterface> default_sink_;
|
||||
// Default SSRC to use for RTCP receiver reports in case of no signaled
|
||||
// send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740
|
||||
// and https://code.google.com/p/chromium/issues/detail?id=547661
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/pc/channel.h"
|
||||
#include "webrtc/base/arraysize.h"
|
||||
#include "webrtc/base/byteorder.h"
|
||||
@ -2782,10 +2784,10 @@ TEST_F(WebRtcVoiceEngineTestFake, InitDoesNotOverwriteDefaultAgcConfig) {
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
|
||||
EXPECT_TRUE(SetupEngineWithSendStream());
|
||||
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel1(
|
||||
std::unique_ptr<cricket::WebRtcVoiceMediaChannel> channel1(
|
||||
static_cast<cricket::WebRtcVoiceMediaChannel*>(engine_.CreateChannel(
|
||||
&call_, cricket::MediaConfig(), cricket::AudioOptions())));
|
||||
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel2(
|
||||
std::unique_ptr<cricket::WebRtcVoiceMediaChannel> channel2(
|
||||
static_cast<cricket::WebRtcVoiceMediaChannel*>(engine_.CreateChannel(
|
||||
&call_, cricket::MediaConfig(), cricket::AudioOptions())));
|
||||
|
||||
@ -2885,7 +2887,7 @@ TEST_F(WebRtcVoiceEngineTestFake, TestSetDscpOptions) {
|
||||
EXPECT_TRUE(SetupEngineWithSendStream());
|
||||
cricket::FakeNetworkInterface network_interface;
|
||||
cricket::MediaConfig config;
|
||||
rtc::scoped_ptr<cricket::VoiceMediaChannel> channel;
|
||||
std::unique_ptr<cricket::VoiceMediaChannel> channel;
|
||||
|
||||
channel.reset(engine_.CreateChannel(&call_, config, cricket::AudioOptions()));
|
||||
channel->SetInterface(&network_interface);
|
||||
@ -3113,8 +3115,8 @@ TEST_F(WebRtcVoiceEngineTestFake, AssociateChannelResetUponDeleteChannnel) {
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetRawAudioSink) {
|
||||
EXPECT_TRUE(SetupEngine());
|
||||
rtc::scoped_ptr<FakeAudioSink> fake_sink_1(new FakeAudioSink());
|
||||
rtc::scoped_ptr<FakeAudioSink> fake_sink_2(new FakeAudioSink());
|
||||
std::unique_ptr<FakeAudioSink> fake_sink_1(new FakeAudioSink());
|
||||
std::unique_ptr<FakeAudioSink> fake_sink_2(new FakeAudioSink());
|
||||
|
||||
// Setting the sink before a recv stream exists should do nothing.
|
||||
channel_->SetRawAudioSink(kSsrc1, std::move(fake_sink_1));
|
||||
@ -3133,8 +3135,8 @@ TEST_F(WebRtcVoiceEngineTestFake, SetRawAudioSink) {
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetRawAudioSinkDefaultRecvStream) {
|
||||
EXPECT_TRUE(SetupEngine());
|
||||
rtc::scoped_ptr<FakeAudioSink> fake_sink_1(new FakeAudioSink());
|
||||
rtc::scoped_ptr<FakeAudioSink> fake_sink_2(new FakeAudioSink());
|
||||
std::unique_ptr<FakeAudioSink> fake_sink_1(new FakeAudioSink());
|
||||
std::unique_ptr<FakeAudioSink> fake_sink_2(new FakeAudioSink());
|
||||
|
||||
// Should be able to set a default sink even when no stream exists.
|
||||
channel_->SetRawAudioSink(0, std::move(fake_sink_1));
|
||||
@ -3161,7 +3163,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetRawAudioSinkDefaultRecvStream) {
|
||||
TEST(WebRtcVoiceEngineTest, StartupShutdown) {
|
||||
cricket::WebRtcVoiceEngine engine;
|
||||
EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
|
||||
rtc::scoped_ptr<webrtc::Call> call(
|
||||
std::unique_ptr<webrtc::Call> call(
|
||||
webrtc::Call::Create(webrtc::Call::Config()));
|
||||
cricket::VoiceMediaChannel* channel = engine.CreateChannel(
|
||||
call.get(), cricket::MediaConfig(), cricket::AudioOptions());
|
||||
@ -3263,7 +3265,7 @@ TEST(WebRtcVoiceEngineTest, HasCorrectCodecs) {
|
||||
TEST(WebRtcVoiceEngineTest, Has32Channels) {
|
||||
cricket::WebRtcVoiceEngine engine;
|
||||
EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
|
||||
rtc::scoped_ptr<webrtc::Call> call(
|
||||
std::unique_ptr<webrtc::Call> call(
|
||||
webrtc::Call::Create(webrtc::Call::Config()));
|
||||
|
||||
cricket::VoiceMediaChannel* channels[32];
|
||||
@ -3289,7 +3291,7 @@ TEST(WebRtcVoiceEngineTest, Has32Channels) {
|
||||
TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
|
||||
cricket::WebRtcVoiceEngine engine;
|
||||
EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
|
||||
rtc::scoped_ptr<webrtc::Call> call(
|
||||
std::unique_ptr<webrtc::Call> call(
|
||||
webrtc::Call::Create(webrtc::Call::Config()));
|
||||
cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
|
||||
cricket::AudioOptions(), call.get());
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
@ -1020,13 +1022,13 @@ bool SctpDataMediaChannel::SendQueuedStreamResets() {
|
||||
void SctpDataMediaChannel::OnMessage(rtc::Message* msg) {
|
||||
switch (msg->message_id) {
|
||||
case MSG_SCTPINBOUNDPACKET: {
|
||||
rtc::scoped_ptr<InboundPacketMessage> pdata(
|
||||
std::unique_ptr<InboundPacketMessage> pdata(
|
||||
static_cast<InboundPacketMessage*>(msg->pdata));
|
||||
OnInboundPacketFromSctpToChannel(pdata->data().get());
|
||||
break;
|
||||
}
|
||||
case MSG_SCTPOUTBOUNDPACKET: {
|
||||
rtc::scoped_ptr<OutboundPacketMessage> pdata(
|
||||
std::unique_ptr<OutboundPacketMessage> pdata(
|
||||
static_cast<OutboundPacketMessage*>(msg->pdata));
|
||||
OnPacketFromSctpToNetwork(pdata->data().get());
|
||||
break;
|
||||
|
||||
@ -25,7 +25,6 @@ enum PreservedErrno {
|
||||
} // namespace cricket
|
||||
|
||||
#include "webrtc/base/buffer.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/media/base/codec.h"
|
||||
#include "webrtc/media/base/mediachannel.h"
|
||||
#include "webrtc/media/base/mediaengine.h"
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -21,7 +23,6 @@
|
||||
#include "webrtc/base/helpers.h"
|
||||
#include "webrtc/base/messagehandler.h"
|
||||
#include "webrtc/base/messagequeue.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/base/ssladapter.h"
|
||||
#include "webrtc/base/thread.h"
|
||||
#include "webrtc/media/base/constants.h"
|
||||
@ -63,7 +64,7 @@ class SctpFakeNetworkInterface : public cricket::MediaChannel::NetworkInterface,
|
||||
// an SCTP packet.
|
||||
virtual void OnMessage(rtc::Message* msg) {
|
||||
LOG(LS_VERBOSE) << "SctpFakeNetworkInterface::OnMessage";
|
||||
rtc::scoped_ptr<rtc::Buffer> buffer(
|
||||
std::unique_ptr<rtc::Buffer> buffer(
|
||||
static_cast<rtc::TypedMessageData<rtc::Buffer*>*>(
|
||||
msg->pdata)->data());
|
||||
if (dest_) {
|
||||
@ -313,13 +314,13 @@ class SctpDataMediaChannelTest : public testing::Test,
|
||||
int channel1_ready_to_send_count() { return chan1_ready_to_send_count_; }
|
||||
int channel2_ready_to_send_count() { return chan2_ready_to_send_count_; }
|
||||
private:
|
||||
rtc::scoped_ptr<cricket::SctpDataEngine> engine_;
|
||||
rtc::scoped_ptr<SctpFakeNetworkInterface> net1_;
|
||||
rtc::scoped_ptr<SctpFakeNetworkInterface> net2_;
|
||||
rtc::scoped_ptr<SctpFakeDataReceiver> recv1_;
|
||||
rtc::scoped_ptr<SctpFakeDataReceiver> recv2_;
|
||||
rtc::scoped_ptr<cricket::SctpDataMediaChannel> chan1_;
|
||||
rtc::scoped_ptr<cricket::SctpDataMediaChannel> chan2_;
|
||||
std::unique_ptr<cricket::SctpDataEngine> engine_;
|
||||
std::unique_ptr<SctpFakeNetworkInterface> net1_;
|
||||
std::unique_ptr<SctpFakeNetworkInterface> net2_;
|
||||
std::unique_ptr<SctpFakeDataReceiver> recv1_;
|
||||
std::unique_ptr<SctpFakeDataReceiver> recv2_;
|
||||
std::unique_ptr<cricket::SctpDataMediaChannel> chan1_;
|
||||
std::unique_ptr<cricket::SctpDataMediaChannel> chan2_;
|
||||
|
||||
int chan1_ready_to_send_count_;
|
||||
int chan2_ready_to_send_count_;
|
||||
|
||||
@ -33,7 +33,7 @@ namespace {
|
||||
bool SetRawAudioSink_w(VoiceMediaChannel* channel,
|
||||
uint32_t ssrc,
|
||||
rtc::scoped_ptr<webrtc::AudioSinkInterface>* sink) {
|
||||
channel->SetRawAudioSink(ssrc, std::move(*sink));
|
||||
channel->SetRawAudioSink(ssrc, rtc::ScopedToUnique(std::move(*sink)));
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user