Update test/ to not use implicit T* --> scoped_refptr<T> conversion

Bug: webrtc:13464
Change-Id: Id0191dfb2028e29499fabb6c58a00c06460c01dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246200
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35685}
This commit is contained in:
Niels Möller
2022-01-13 13:50:20 +01:00
committed by WebRTC LUCI CQ
parent 3babb8af23
commit 93b208992b
3 changed files with 15 additions and 15 deletions

View File

@ -59,7 +59,8 @@ VideoFrame CreateMappableNativeFrame(int64_t ntp_time_ms,
rtc::scoped_refptr<MappableNativeBuffer> GetMappableNativeBufferFromVideoFrame(
const VideoFrame& frame) {
return static_cast<MappableNativeBuffer*>(frame.video_frame_buffer().get());
return rtc::scoped_refptr<MappableNativeBuffer>(
static_cast<MappableNativeBuffer*>(frame.video_frame_buffer().get()));
}
MappableNativeBuffer::ScaledBuffer::ScaledBuffer(
@ -145,7 +146,8 @@ bool MappableNativeBuffer::DidConvertToI420() const {
rtc::scoped_refptr<MappableNativeBuffer::ScaledBuffer>
MappableNativeBuffer::FullSizeBuffer() {
return rtc::make_ref_counted<ScaledBuffer>(this, width_, height_);
return rtc::make_ref_counted<ScaledBuffer>(
rtc::scoped_refptr<MappableNativeBuffer>(this), width_, height_);
}
rtc::scoped_refptr<VideoFrameBuffer>

View File

@ -57,8 +57,7 @@ class MockAudioEncoderFactory
using ::testing::AnyNumber;
using ::testing::Return;
rtc::scoped_refptr<webrtc::MockAudioEncoderFactory> factory =
new rtc::RefCountedObject<webrtc::MockAudioEncoderFactory>;
auto factory = rtc::make_ref_counted<webrtc::MockAudioEncoderFactory>();
ON_CALL(*factory.get(), GetSupportedEncoders())
.WillByDefault(Return(std::vector<webrtc::AudioCodecSpec>()));
ON_CALL(*factory.get(), QueryAudioEncoder(_))
@ -80,8 +79,7 @@ class MockAudioEncoderFactory
using ::testing::Return;
using ::testing::SetArgPointee;
rtc::scoped_refptr<webrtc::MockAudioEncoderFactory> factory =
new rtc::RefCountedObject<webrtc::MockAudioEncoderFactory>;
auto factory = rtc::make_ref_counted<webrtc::MockAudioEncoderFactory>();
ON_CALL(*factory.get(), GetSupportedEncoders())
.WillByDefault(Return(std::vector<webrtc::AudioCodecSpec>()));
ON_CALL(*factory.get(), QueryAudioEncoder(_))

View File

@ -34,10 +34,10 @@ D3dRenderer::D3dRenderer(size_t width, size_t height)
: width_(width),
height_(height),
hwnd_(NULL),
d3d_(NULL),
d3d_device_(NULL),
texture_(NULL),
vertex_buffer_(NULL) {
d3d_(nullptr),
d3d_device_(nullptr),
texture_(nullptr),
vertex_buffer_(nullptr) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
}
@ -59,10 +59,10 @@ LRESULT WINAPI D3dRenderer::WindowProc(HWND hwnd,
}
void D3dRenderer::Destroy() {
texture_ = NULL;
vertex_buffer_ = NULL;
d3d_device_ = NULL;
d3d_ = NULL;
texture_ = nullptr;
vertex_buffer_ = nullptr;
d3d_device_ = nullptr;
d3d_ = nullptr;
if (hwnd_ != NULL) {
DestroyWindow(hwnd_);
@ -82,7 +82,7 @@ bool D3dRenderer::Init(const char* window_title) {
}
d3d_ = Direct3DCreate9(D3D_SDK_VERSION);
if (d3d_ == NULL) {
if (d3d_ == nullptr) {
Destroy();
return false;
}