Revert of Remove webrtc/base/scoped_ptr.h (patchset #3 id:100001 of https://codereview.webrtc.org/1942823002/ )

Reason for revert:
Breaks user code. Said code needs to stop using scoped_ptr!

Original issue's description:
> Remove webrtc/base/scoped_ptr.h
>
> BUG=webrtc:5520
>
> NOTRY=True
>
> Committed: https://crrev.com/65fc62e9dd8a8716db625aaef76ab92f542ecc5a
> Cr-Commit-Position: refs/heads/master@{#12684}

TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5520

Review-Url: https://codereview.webrtc.org/1965063003
Cr-Commit-Position: refs/heads/master@{#12686}
This commit is contained in:
kwiberg
2016-05-11 05:07:26 -07:00
committed by Commit bot
parent 7e3968e46c
commit 6ab3db249b
74 changed files with 133 additions and 26 deletions

View File

@ -14,6 +14,9 @@ Governed by http://www.fourmilab.ch/md5/ (Public domain):
base/md5.c base/md5.c
base/md5.h base/md5.h
Governed by http://www.boost.org/LICENSE_1_0.txt (Boost license):
base/scoped_ptr.h
Governed by license within files (Public domain): Governed by license within files (Public domain):
Originally downloaded from http://svn.ghostscript.com/jbig2dec/tags/release_0_02/sha1.* Originally downloaded from http://svn.ghostscript.com/jbig2dec/tags/release_0_02/sha1.*
base/sha1.c base/sha1.c

View File

@ -17,6 +17,7 @@
#include "webrtc/api/mediastreamtrack.h" #include "webrtc/api/mediastreamtrack.h"
#include "webrtc/api/notifier.h" #include "webrtc/api/notifier.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"

View File

@ -20,6 +20,7 @@
#include "webrtc/api/jsep.h" #include "webrtc/api/jsep.h"
#include "webrtc/api/jsepicecandidate.h" #include "webrtc/api/jsepicecandidate.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/p2p/base/candidate.h" #include "webrtc/p2p/base/candidate.h"
namespace cricket { namespace cricket {

View File

@ -14,6 +14,7 @@
#include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/mediastreaminterface.h"
#include "webrtc/api/notifier.h" #include "webrtc/api/notifier.h"
#include "webrtc/api/peerconnectioninterface.h" #include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/mediachannel.h" #include "webrtc/media/base/mediachannel.h"
// LocalAudioSource implements AudioSourceInterface. // LocalAudioSource implements AudioSourceInterface.

View File

@ -15,6 +15,7 @@
#include "webrtc/api/rtpsenderinterface.h" #include "webrtc/api/rtpsenderinterface.h"
#include "webrtc/base/basictypes.h" #include "webrtc/base/basictypes.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/videosinkinterface.h" #include "webrtc/media/base/videosinkinterface.h"
#include "webrtc/media/base/videosourceinterface.h" #include "webrtc/media/base/videosourceinterface.h"

View File

@ -24,6 +24,7 @@
#include "webrtc/api/statscollector.h" #include "webrtc/api/statscollector.h"
#include "webrtc/api/streamcollection.h" #include "webrtc/api/streamcollection.h"
#include "webrtc/api/webrtcsession.h" #include "webrtc/api/webrtcsession.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {

View File

@ -18,6 +18,7 @@
#include "webrtc/api/mediacontroller.h" #include "webrtc/api/mediacontroller.h"
#include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/mediastreaminterface.h"
#include "webrtc/api/peerconnectioninterface.h" #include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread.h" #include "webrtc/base/thread.h"
#include "webrtc/pc/channelmanager.h" #include "webrtc/pc/channelmanager.h"

View File

@ -934,20 +934,20 @@ class PeerConnectionInterfaceTest : public testing::Test {
ASSERT_TRUE(stream->AddTrack(video_track)); ASSERT_TRUE(stream->AddTrack(video_track));
} }
std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() { rtc::scoped_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() {
CreatePeerConnection(); CreatePeerConnection();
AddVoiceStream(kStreamLabel1); AddVoiceStream(kStreamLabel1);
std::unique_ptr<SessionDescriptionInterface> offer; rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(&offer, nullptr)); EXPECT_TRUE(DoCreateOffer(&offer, nullptr));
return offer; return offer;
} }
std::unique_ptr<SessionDescriptionInterface> rtc::scoped_ptr<SessionDescriptionInterface>
CreateAnswerWithOneAudioStream() { CreateAnswerWithOneAudioStream() {
std::unique_ptr<SessionDescriptionInterface> offer = rtc::scoped_ptr<SessionDescriptionInterface> offer =
CreateOfferWithOneAudioStream(); CreateOfferWithOneAudioStream();
EXPECT_TRUE(DoSetRemoteDescription(offer.release())); EXPECT_TRUE(DoSetRemoteDescription(offer.release()));
std::unique_ptr<SessionDescriptionInterface> answer; rtc::scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(&answer, nullptr)); EXPECT_TRUE(DoCreateAnswer(&answer, nullptr));
return answer; return answer;
} }
@ -973,18 +973,18 @@ class PeerConnectionInterfaceTest : public testing::Test {
// The CNAMEs are expected to be generated randomly. It is possible // The CNAMEs are expected to be generated randomly. It is possible
// that the test fails, though the possibility is very low. // that the test fails, though the possibility is very low.
TEST_F(PeerConnectionInterfaceTest, CnameGenerationInOffer) { TEST_F(PeerConnectionInterfaceTest, CnameGenerationInOffer) {
std::unique_ptr<SessionDescriptionInterface> offer1 = rtc::scoped_ptr<SessionDescriptionInterface> offer1 =
CreateOfferWithOneAudioStream(); CreateOfferWithOneAudioStream();
std::unique_ptr<SessionDescriptionInterface> offer2 = rtc::scoped_ptr<SessionDescriptionInterface> offer2 =
CreateOfferWithOneAudioStream(); CreateOfferWithOneAudioStream();
EXPECT_NE(GetFirstAudioStreamCname(offer1.get()), EXPECT_NE(GetFirstAudioStreamCname(offer1.get()),
GetFirstAudioStreamCname(offer2.get())); GetFirstAudioStreamCname(offer2.get()));
} }
TEST_F(PeerConnectionInterfaceTest, CnameGenerationInAnswer) { TEST_F(PeerConnectionInterfaceTest, CnameGenerationInAnswer) {
std::unique_ptr<SessionDescriptionInterface> answer1 = rtc::scoped_ptr<SessionDescriptionInterface> answer1 =
CreateAnswerWithOneAudioStream(); CreateAnswerWithOneAudioStream();
std::unique_ptr<SessionDescriptionInterface> answer2 = rtc::scoped_ptr<SessionDescriptionInterface> answer2 =
CreateAnswerWithOneAudioStream(); CreateAnswerWithOneAudioStream();
EXPECT_NE(GetFirstAudioStreamCname(answer1.get()), EXPECT_NE(GetFirstAudioStreamCname(answer1.get()),
GetFirstAudioStreamCname(answer2.get())); GetFirstAudioStreamCname(answer2.get()));

View File

@ -23,6 +23,7 @@
#include "webrtc/api/statscollector.h" #include "webrtc/api/statscollector.h"
#include "webrtc/base/basictypes.h" #include "webrtc/base/basictypes.h"
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/audiosource.h" #include "webrtc/media/base/audiosource.h"
namespace webrtc { namespace webrtc {

View File

@ -24,6 +24,7 @@
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/linked_ptr.h" #include "webrtc/base/linked_ptr.h"
#include "webrtc/base/refcount.h" #include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/stringencode.h" #include "webrtc/base/stringencode.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"

View File

@ -25,6 +25,7 @@
#include "webrtc/base/basictypes.h" #include "webrtc/base/basictypes.h"
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/messagehandler.h" #include "webrtc/base/messagehandler.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/common_types.h" #include "webrtc/common_types.h"
#include "webrtc/modules/audio_device/include/audio_device.h" #include "webrtc/modules/audio_device/include/audio_device.h"

View File

@ -16,6 +16,7 @@
#include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/mediastreaminterface.h"
#include "webrtc/api/videotracksource.h" #include "webrtc/api/videotracksource.h"
#include "webrtc/base/asyncinvoker.h" #include "webrtc/base/asyncinvoker.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sigslot.h" #include "webrtc/base/sigslot.h"
#include "webrtc/media/base/videocapturer.h" #include "webrtc/media/base/videocapturer.h"
#include "webrtc/media/base/videocommon.h" #include "webrtc/media/base/videocommon.h"

View File

@ -15,6 +15,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/config.h" #include "webrtc/config.h"
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h" #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
#include "webrtc/transport.h" #include "webrtc/transport.h"

View File

@ -144,6 +144,7 @@ static_library("rtc_base_approved") {
"refcount.h", "refcount.h",
"safe_conversions.h", "safe_conversions.h",
"safe_conversions_impl.h", "safe_conversions_impl.h",
"scoped_ptr.h",
"scoped_ref_ptr.h", "scoped_ref_ptr.h",
"stringencode.cc", "stringencode.cc",
"stringencode.h", "stringencode.h",

View File

@ -75,6 +75,7 @@
'refcount.h', 'refcount.h',
'safe_conversions.h', 'safe_conversions.h',
'safe_conversions_impl.h', 'safe_conversions_impl.h',
'scoped_ptr.h',
'scoped_ref_ptr.h', 'scoped_ref_ptr.h',
'stringencode.cc', 'stringencode.cc',
'stringencode.h', 'stringencode.h',

View File

@ -15,6 +15,7 @@
#include <utility> #include <utility>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
namespace rtc { namespace rtc {

49
webrtc/base/scoped_ptr.h Normal file
View File

@ -0,0 +1,49 @@
/*
* Copyright 2012 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This entire file is deprecated, and will be removed in XXXX 2016. Use
// std::unique_ptr instead!
#ifndef WEBRTC_BASE_SCOPED_PTR_H__
#define WEBRTC_BASE_SCOPED_PTR_H__
// All these #includes are left to maximize backwards compatibility.
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <algorithm>
#include <cstddef>
#include <memory>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/template_util.h"
#include "webrtc/typedefs.h"
namespace rtc {
template <typename T, typename Deleter = std::default_delete<T>>
using scoped_ptr = std::unique_ptr<T, Deleter>;
// These used to convert between std::unique_ptr and std::unique_ptr. Now they
// are no-ops.
template <typename T>
std::unique_ptr<T> ScopedToUnique(std::unique_ptr<T> up) {
return up;
}
template <typename T>
std::unique_ptr<T> UniqueToScoped(std::unique_ptr<T> up) {
return up;
}
} // namespace rtc
#endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__

View File

@ -14,6 +14,7 @@
#include <complex> #include <complex>
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/aligned_malloc.h" #include "webrtc/system_wrappers/include/aligned_malloc.h"
// Uniform interface class for the real DFT and its inverse, for power-of-2 // Uniform interface class for the real DFT and its inverse, for power-of-2

View File

@ -10,7 +10,6 @@
#include "webrtc/common_video/include/bitrate_adjuster.h" #include "webrtc/common_video/include/bitrate_adjuster.h"
#include <algorithm>
#include <cmath> #include <cmath>
#include "webrtc/base/checks.h" #include "webrtc/base/checks.h"

View File

@ -21,6 +21,7 @@
#include "webrtc/api/peerconnectioninterface.h" #include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/examples/peerconnection/client/main_wnd.h" #include "webrtc/examples/peerconnection/client/main_wnd.h"
#include "webrtc/examples/peerconnection/client/peer_connection_client.h" #include "webrtc/examples/peerconnection/client/peer_connection_client.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {
class VideoCaptureModule; class VideoCaptureModule;

View File

@ -18,6 +18,7 @@
#include "webrtc/base/nethelpers.h" #include "webrtc/base/nethelpers.h"
#include "webrtc/base/physicalsocketserver.h" #include "webrtc/base/physicalsocketserver.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/signalthread.h" #include "webrtc/base/signalthread.h"
#include "webrtc/base/sigslot.h" #include "webrtc/base/sigslot.h"

View File

@ -15,6 +15,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "webrtc/libjingle/xmllite/xmlparser.h" #include "webrtc/libjingle/xmllite/xmlparser.h"
#include "webrtc/base/scoped_ptr.h"
#ifdef EXPAT_RELATIVE_PATH #ifdef EXPAT_RELATIVE_PATH
#include "expat.h" #include "expat.h"

View File

@ -15,6 +15,7 @@
#include <string> #include <string>
#include "webrtc/libjingle/xmllite/qname.h" #include "webrtc/libjingle/xmllite/qname.h"
#include "webrtc/base/scoped_ptr.h"
namespace buzz { namespace buzz {

View File

@ -15,6 +15,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "webrtc/libjingle/xmllite/qname.h" #include "webrtc/libjingle/xmllite/qname.h"
#include "webrtc/base/scoped_ptr.h"
namespace buzz { namespace buzz {

View File

@ -13,7 +13,6 @@
#ifndef WEBRTC_LIBJINGLE_XMPP_FAKEXMPPCLIENT_H_ #ifndef WEBRTC_LIBJINGLE_XMPP_FAKEXMPPCLIENT_H_
#define WEBRTC_LIBJINGLE_XMPP_FAKEXMPPCLIENT_H_ #define WEBRTC_LIBJINGLE_XMPP_FAKEXMPPCLIENT_H_
#include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -19,6 +19,7 @@
#include "webrtc/libjingle/xmpp/jid.h" #include "webrtc/libjingle/xmpp/jid.h"
#include "webrtc/libjingle/xmpp/pubsubclient.h" #include "webrtc/libjingle/xmpp/pubsubclient.h"
#include "webrtc/libjingle/xmpp/pubsubstateclient.h" #include "webrtc/libjingle/xmpp/pubsubstateclient.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sigslot.h" #include "webrtc/base/sigslot.h"
#include "webrtc/base/sigslotrepeater.h" #include "webrtc/base/sigslotrepeater.h"

View File

@ -22,6 +22,7 @@
#include "webrtc/libjingle/xmpp/jid.h" #include "webrtc/libjingle/xmpp/jid.h"
#include "webrtc/libjingle/xmpp/pubsubclient.h" #include "webrtc/libjingle/xmpp/pubsubclient.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sigslot.h" #include "webrtc/base/sigslot.h"
#include "webrtc/base/sigslotrepeater.h" #include "webrtc/base/sigslotrepeater.h"

View File

@ -18,6 +18,7 @@
#include "webrtc/libjingle/xmpp/jid.h" #include "webrtc/libjingle/xmpp/jid.h"
#include "webrtc/libjingle/xmpp/xmppengine.h" #include "webrtc/libjingle/xmpp/xmppengine.h"
#include "webrtc/base/logging.h" #include "webrtc/base/logging.h"
#include "webrtc/base/scoped_ptr.h"
namespace buzz { namespace buzz {

View File

@ -22,7 +22,6 @@
#include "webrtc/base/common.h" #include "webrtc/base/common.h"
#include "webrtc/base/cryptstring.h" #include "webrtc/base/cryptstring.h"
#include "webrtc/base/gunit.h" #include "webrtc/base/gunit.h"
#include "webrtc/typedefs.h"
using buzz::Jid; using buzz::Jid;
using buzz::QName; using buzz::QName;

View File

@ -10,7 +10,6 @@
#include "webrtc/modules/audio_device/dummy/file_audio_device_factory.h" #include "webrtc/modules/audio_device/dummy/file_audio_device_factory.h"
#include <cstdlib>
#include <cstring> #include <cstring>
#include "webrtc/modules/audio_device/dummy/file_audio_device.h" #include "webrtc/modules/audio_device/dummy/file_audio_device.h"
@ -27,7 +26,7 @@ FileAudioDevice* FileAudioDeviceFactory::CreateFileAudioDevice(
if (!_isConfigured) { if (!_isConfigured) {
printf("Was compiled with WEBRTC_DUMMY_AUDIO_PLAY_STATIC_FILE " printf("Was compiled with WEBRTC_DUMMY_AUDIO_PLAY_STATIC_FILE "
"but did not set input/output files to use. Bailing out.\n"); "but did not set input/output files to use. Bailing out.\n");
std::exit(1); exit(1);
} }
return new FileAudioDevice(id, _inputAudioFilename, _outputAudioFilename); return new FileAudioDevice(id, _inputAudioFilename, _outputAudioFilename);
} }
@ -46,7 +45,7 @@ void FileAudioDeviceFactory::SetFilenamesToUse(
// Sanity: must be compiled with the right define to run this. // Sanity: must be compiled with the right define to run this.
printf("Trying to use dummy file devices, but is not compiled " printf("Trying to use dummy file devices, but is not compiled "
"with WEBRTC_DUMMY_FILE_DEVICES. Bailing out.\n"); "with WEBRTC_DUMMY_FILE_DEVICES. Bailing out.\n");
std::exit(1); exit(1);
#endif #endif
} }

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h" #include "webrtc/common_types.h"
#include "webrtc/modules/include/module.h" #include "webrtc/modules/include/module.h"
#include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/include/module_common_types.h"

View File

@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h" #include "webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "webrtc/modules/desktop_capture/screen_capturer.h" #include "webrtc/modules/desktop_capture/screen_capturer.h"
#include "webrtc/modules/desktop_capture/window_capturer.h" #include "webrtc/modules/desktop_capture/window_capturer.h"

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_capturer.h" #include "webrtc/modules/desktop_capture/desktop_capturer.h"
#include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h"

View File

@ -15,6 +15,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_capture_types.h" #include "webrtc/modules/desktop_capture/desktop_capture_types.h"
#include "webrtc/modules/desktop_capture/shared_memory.h" #include "webrtc/modules/desktop_capture/shared_memory.h"

View File

@ -20,6 +20,7 @@
#include <memory> #include <memory>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
namespace webrtc { namespace webrtc {

View File

@ -18,6 +18,7 @@
#include <windows.h> #include <windows.h>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
#include "webrtc/modules/desktop_capture/screen_capturer_helper.h" #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
#include "webrtc/modules/desktop_capture/shared_desktop_frame.h" #include "webrtc/modules/desktop_capture/shared_desktop_frame.h"

View File

@ -18,6 +18,7 @@
#include <wincodec.h> #include <wincodec.h>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
#include "webrtc/modules/desktop_capture/screen_capturer.h" #include "webrtc/modules/desktop_capture/screen_capturer.h"
#include "webrtc/modules/desktop_capture/screen_capturer_helper.h" #include "webrtc/modules/desktop_capture/screen_capturer_helper.h"

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/rtp_to_ntp.h" #include "webrtc/system_wrappers/include/rtp_to_ntp.h"
namespace webrtc { namespace webrtc {

View File

@ -15,6 +15,7 @@
#include <memory> #include <memory>
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"

View File

@ -12,8 +12,6 @@
#include <math.h> #include <math.h>
#include <cstdlib>
#include "webrtc/modules/rtp_rtcp/source/bitrate.h" #include "webrtc/modules/rtp_rtcp/source/bitrate.h"
#include "webrtc/modules/rtp_rtcp/source/time_util.h" #include "webrtc/modules/rtp_rtcp/source/time_util.h"
@ -115,7 +113,7 @@ void StreamStatisticianImpl::UpdateJitter(const RTPHeader& header,
int32_t time_diff_samples = (receive_time_rtp - last_receive_time_rtp) - int32_t time_diff_samples = (receive_time_rtp - last_receive_time_rtp) -
(header.timestamp - last_received_timestamp_); (header.timestamp - last_received_timestamp_);
time_diff_samples = std::abs(time_diff_samples); time_diff_samples = abs(time_diff_samples);
// lib_jingle sometimes deliver crazy jumps in TS for the same stream. // lib_jingle sometimes deliver crazy jumps in TS for the same stream.
// If this happens, don't update jitter value. Use 5 secs video frequency // If this happens, don't update jitter value. Use 5 secs video frequency
@ -135,7 +133,7 @@ void StreamStatisticianImpl::UpdateJitter(const RTPHeader& header,
(last_received_timestamp_ + (last_received_timestamp_ +
last_received_transmission_time_offset_)); last_received_transmission_time_offset_));
time_diff_samples_ext = std::abs(time_diff_samples_ext); time_diff_samples_ext = abs(time_diff_samples_ext);
if (time_diff_samples_ext < 450000) { if (time_diff_samples_ext < 450000) {
int32_t jitter_diffQ4TransmissionTimeOffset = int32_t jitter_diffQ4TransmissionTimeOffset =

View File

@ -16,6 +16,7 @@
#include <vector> #include <vector>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" // RTCPReportBlock #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" // RTCPReportBlock
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h" #include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"

View File

@ -15,6 +15,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h"

View File

@ -11,6 +11,7 @@
#define WEBRTC_MODULES_RTP_RTCP_TEST_TESTAPI_TEST_API_H_ #define WEBRTC_MODULES_RTP_RTCP_TEST_TESTAPI_TEST_API_H_
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h" #include "webrtc/common_types.h"
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"

View File

@ -16,6 +16,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"
#include "webrtc/modules/utility/include/helpers_android.h" #include "webrtc/modules/utility/include/helpers_android.h"

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {
class Module; class Module;

View File

@ -20,6 +20,7 @@
#include <vector> #include <vector>
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread_annotations.h" #include "webrtc/base/thread_annotations.h"
#include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/video_coding/packet.h" #include "webrtc/modules/video_coding/packet.h"

View File

@ -12,7 +12,6 @@
#include <stdio.h> #include <stdio.h>
#include <cstdlib>
#include <map> #include <map>
#include <memory> #include <memory>
@ -342,7 +341,7 @@ class RtpPlayerImpl : public RtpPlayerInterface {
assert(packet_source); assert(packet_source);
assert(packet_source->get()); assert(packet_source->get());
packet_source_.swap(*packet_source); packet_source_.swap(*packet_source);
std::srand(321); srand(321);
} }
virtual ~RtpPlayerImpl() {} virtual ~RtpPlayerImpl() {}
@ -435,8 +434,7 @@ class RtpPlayerImpl : public RtpPlayerInterface {
if (no_loss_startup_ > 0) { if (no_loss_startup_ > 0) {
no_loss_startup_--; no_loss_startup_--;
} else if ((std::rand() + 1.0) / (RAND_MAX + 1.0) < } else if ((rand() + 1.0) / (RAND_MAX + 1.0) < loss_rate_) { // NOLINT
loss_rate_) { // NOLINT
uint16_t seq_num = header.sequenceNumber; uint16_t seq_num = header.sequenceNumber;
lost_packets_.AddPacket(new RawRtpPacket(data, length, ssrc, seq_num)); lost_packets_.AddPacket(new RawRtpPacket(data, length, ssrc, seq_num));
DEBUG_LOG1("Dropped packet: %d!", header.header.sequenceNumber); DEBUG_LOG1("Dropped packet: %d!", header.header.sequenceNumber);

View File

@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/video_processing/include/video_processing_defines.h" #include "webrtc/modules/video_processing/include/video_processing_defines.h"
#include "webrtc/modules/video_processing/util/denoiser_filter.h" #include "webrtc/modules/video_processing/util/denoiser_filter.h"

View File

@ -13,6 +13,7 @@
#include "webrtc/base/asynctcpsocket.h" #include "webrtc/base/asynctcpsocket.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/socketfactory.h" #include "webrtc/base/socketfactory.h"
namespace cricket { namespace cricket {

View File

@ -42,7 +42,7 @@ static bool IsRtpLeadByte(uint8_t b) {
cricket::TransportDescription MakeTransportDescription( cricket::TransportDescription MakeTransportDescription(
const rtc::scoped_refptr<rtc::RTCCertificate>& cert, const rtc::scoped_refptr<rtc::RTCCertificate>& cert,
cricket::ConnectionRole role) { cricket::ConnectionRole role) {
std::unique_ptr<rtc::SSLFingerprint> fingerprint; rtc::scoped_ptr<rtc::SSLFingerprint> fingerprint;
if (cert) { if (cert) {
std::string digest_algorithm; std::string digest_algorithm;
cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm); cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm);

View File

@ -15,6 +15,7 @@
#include "webrtc/p2p/base/stun.h" #include "webrtc/p2p/base/stun.h"
#include "webrtc/base/asyncudpsocket.h" #include "webrtc/base/asyncudpsocket.h"
#include "webrtc/base/scoped_ptr.h"
namespace cricket { namespace cricket {

View File

@ -15,6 +15,7 @@
#include "webrtc/p2p/base/relayserver.h" #include "webrtc/p2p/base/relayserver.h"
#include "webrtc/base/asynctcpsocket.h" #include "webrtc/base/asynctcpsocket.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sigslot.h" #include "webrtc/base/sigslot.h"
#include "webrtc/base/socketadapters.h" #include "webrtc/base/socketadapters.h"
#include "webrtc/base/thread.h" #include "webrtc/base/thread.h"

View File

@ -17,6 +17,7 @@
#include <vector> #include <vector>
#include "webrtc/p2p/base/p2pconstants.h" #include "webrtc/p2p/base/p2pconstants.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sslfingerprint.h" #include "webrtc/base/sslfingerprint.h"
namespace cricket { namespace cricket {

View File

@ -18,6 +18,7 @@
#include "webrtc/p2p/base/portallocator.h" #include "webrtc/p2p/base/portallocator.h"
#include "webrtc/base/messagequeue.h" #include "webrtc/base/messagequeue.h"
#include "webrtc/base/network.h" #include "webrtc/base/network.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread.h" #include "webrtc/base/thread.h"
namespace cricket { namespace cricket {

View File

@ -17,6 +17,7 @@
#include "webrtc/p2p/base/basicpacketsocketfactory.h" #include "webrtc/p2p/base/basicpacketsocketfactory.h"
#include "webrtc/p2p/base/portallocator.h" #include "webrtc/p2p/base/portallocator.h"
#include "webrtc/p2p/base/udpport.h" #include "webrtc/p2p/base/udpport.h"
#include "webrtc/base/scoped_ptr.h"
namespace rtc { namespace rtc {
class SocketFactory; class SocketFactory;

View File

@ -19,6 +19,7 @@
#include "net/quic/quic_packet_writer.h" #include "net/quic/quic_packet_writer.h"
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/optional.h" #include "webrtc/base/optional.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/p2p/base/transportchannelimpl.h" #include "webrtc/p2p/base/transportchannelimpl.h"
#include "webrtc/p2p/quic/quicconnectionhelper.h" #include "webrtc/p2p/quic/quicconnectionhelper.h"
#include "webrtc/p2p/quic/quicsession.h" #include "webrtc/p2p/quic/quicsession.h"

View File

@ -22,6 +22,7 @@
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/ipaddress.h" #include "webrtc/base/ipaddress.h"
#include "webrtc/base/network.h" #include "webrtc/base/network.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/socketaddress.h" #include "webrtc/base/socketaddress.h"
#include "webrtc/base/thread.h" #include "webrtc/base/thread.h"
#include "webrtc/base/thread_checker.h" #include "webrtc/base/thread_checker.h"

View File

@ -2404,9 +2404,9 @@ class MediaProtocolTest : public ::testing::TestWithParam<const char*> {
f1_.set_secure(SEC_ENABLED); f1_.set_secure(SEC_ENABLED);
f2_.set_secure(SEC_ENABLED); f2_.set_secure(SEC_ENABLED);
tdf1_.set_certificate(rtc::RTCCertificate::Create( tdf1_.set_certificate(rtc::RTCCertificate::Create(
std::unique_ptr<rtc::SSLIdentity>(new rtc::FakeSSLIdentity("id1")))); rtc::scoped_ptr<rtc::SSLIdentity>(new rtc::FakeSSLIdentity("id1"))));
tdf2_.set_certificate(rtc::RTCCertificate::Create( tdf2_.set_certificate(rtc::RTCCertificate::Create(
std::unique_ptr<rtc::SSLIdentity>(new rtc::FakeSSLIdentity("id2")))); rtc::scoped_ptr<rtc::SSLIdentity>(new rtc::FakeSSLIdentity("id2"))));
tdf1_.set_secure(SEC_ENABLED); tdf1_.set_secure(SEC_ENABLED);
tdf2_.set_secure(SEC_ENABLED); tdf2_.set_secure(SEC_ENABLED);
} }

View File

@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include "webrtc/api/jsep.h" #include "webrtc/api/jsep.h"
#include "webrtc/base/scoped_ptr.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

View File

@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include "webrtc/api/mediaconstraintsinterface.h" #include "webrtc/api/mediaconstraintsinterface.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {

View File

@ -11,6 +11,7 @@
#import "WebRTC/RTCMediaStreamTrack.h" #import "WebRTC/RTCMediaStreamTrack.h"
#include "webrtc/api/mediastreaminterface.h" #include "webrtc/api/mediastreaminterface.h"
#include "webrtc/base/scoped_ptr.h"
typedef NS_ENUM(NSInteger, RTCMediaStreamTrackType) { typedef NS_ENUM(NSInteger, RTCMediaStreamTrackType) {
RTCMediaStreamTrackTypeAudio, RTCMediaStreamTrackTypeAudio,

View File

@ -13,6 +13,7 @@
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/media/base/videocapturer.h" #include "webrtc/media/base/videocapturer.h"
#include "webrtc/video_frame.h" #include "webrtc/video_frame.h"

View File

@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h" #include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"

View File

@ -24,6 +24,7 @@
#include <vector> #include <vector>
#include "webrtc/base/platform_thread.h" #include "webrtc/base/platform_thread.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
namespace webrtc { namespace webrtc {

View File

@ -19,6 +19,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {

View File

@ -15,6 +15,7 @@
#include <memory> #include <memory>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/file_wrapper.h" #include "webrtc/system_wrappers/include/file_wrapper.h"
namespace webrtc { namespace webrtc {

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/event_wrapper.h" #include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/file_wrapper.h" #include "webrtc/system_wrappers/include/file_wrapper.h"
#include "webrtc/system_wrappers/include/static_instance.h" #include "webrtc/system_wrappers/include/static_instance.h"

View File

@ -14,6 +14,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/video_encoder.h" #include "webrtc/video_encoder.h"
namespace webrtc { namespace webrtc {

View File

@ -17,6 +17,7 @@
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/event.h" #include "webrtc/base/event.h"
#include "webrtc/base/platform_thread.h" #include "webrtc/base/platform_thread.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/test/fake_network_pipe.h" #include "webrtc/test/fake_network_pipe.h"
#include "webrtc/transport.h" #include "webrtc/transport.h"

View File

@ -15,6 +15,7 @@
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/platform_thread.h" #include "webrtc/base/platform_thread.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_device/include/fake_audio_device.h" #include "webrtc/modules/audio_device/include/fake_audio_device.h"
#include "webrtc/test/drifting_clock.h" #include "webrtc/test/drifting_clock.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"

View File

@ -19,6 +19,7 @@
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/random.h" #include "webrtc/base/random.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"
namespace webrtc { namespace webrtc {

View File

@ -15,6 +15,7 @@
#include "webrtc/base/criticalsection.h" #include "webrtc/base/criticalsection.h"
#include "webrtc/base/platform_thread.h" #include "webrtc/base/platform_thread.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_video/rotation.h" #include "webrtc/common_video/rotation.h"
#include "webrtc/test/video_capturer.h" #include "webrtc/test/video_capturer.h"
#include "webrtc/typedefs.h" #include "webrtc/typedefs.h"

View File

@ -20,6 +20,7 @@
#include <memory> #include <memory>
#include "webrtc/base/constructormagic.h" #include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {