Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: media/cast/receiver/cast_receiver_impl.cc

Issue 1905763002: Convert //media/cast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/receiver/cast_receiver_impl.h ('k') | media/cast/receiver/frame_receiver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/receiver/cast_receiver_impl.cc
diff --git a/media/cast/receiver/cast_receiver_impl.cc b/media/cast/receiver/cast_receiver_impl.cc
index 69aa7c54e4a12d19872e918d8ea3e23b7589d3e1..33d9ae43f1d9d29972dd2e5fda13d36e650cdefc 100644
--- a/media/cast/receiver/cast_receiver_impl.cc
+++ b/media/cast/receiver/cast_receiver_impl.cc
@@ -5,12 +5,14 @@
#include "media/cast/receiver/cast_receiver_impl.h"
#include <stddef.h>
+
#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/trace_event/trace_event.h"
#include "media/cast/net/rtcp/rtcp_utility.h"
@@ -20,12 +22,12 @@
namespace media {
namespace cast {
-scoped_ptr<CastReceiver> CastReceiver::Create(
+std::unique_ptr<CastReceiver> CastReceiver::Create(
scoped_refptr<CastEnvironment> cast_environment,
const FrameReceiverConfig& audio_config,
const FrameReceiverConfig& video_config,
CastTransport* const transport) {
- return scoped_ptr<CastReceiver>(new CastReceiverImpl(
+ return std::unique_ptr<CastReceiver>(new CastReceiverImpl(
cast_environment, audio_config, video_config, transport));
}
@@ -46,7 +48,7 @@ CastReceiverImpl::CastReceiverImpl(
CastReceiverImpl::~CastReceiverImpl() {}
-void CastReceiverImpl::ReceivePacket(scoped_ptr<Packet> packet) {
+void CastReceiverImpl::ReceivePacket(std::unique_ptr<Packet> packet) {
const uint8_t* const data = &packet->front();
const size_t length = packet->size();
@@ -114,10 +116,10 @@ void CastReceiverImpl::RequestEncodedVideoFrame(
void CastReceiverImpl::DecodeEncodedAudioFrame(
const AudioFrameDecodedCallback& callback,
- scoped_ptr<EncodedFrame> encoded_frame) {
+ std::unique_ptr<EncodedFrame> encoded_frame) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
if (!encoded_frame) {
- callback.Run(make_scoped_ptr<AudioBus>(NULL), base::TimeTicks(), false);
+ callback.Run(base::WrapUnique<AudioBus>(NULL), base::TimeTicks(), false);
return;
}
@@ -138,7 +140,7 @@ void CastReceiverImpl::DecodeEncodedAudioFrame(
void CastReceiverImpl::DecodeEncodedVideoFrame(
const VideoFrameDecodedCallback& callback,
- scoped_ptr<EncodedFrame> encoded_frame) {
+ std::unique_ptr<EncodedFrame> encoded_frame) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
if (!encoded_frame) {
callback.Run(
@@ -171,14 +173,14 @@ void CastReceiverImpl::EmitDecodedAudioFrame(
uint32_t frame_id,
RtpTimeTicks rtp_timestamp,
const base::TimeTicks& playout_time,
- scoped_ptr<AudioBus> audio_bus,
+ std::unique_ptr<AudioBus> audio_bus,
bool is_continuous) {
DCHECK(cast_environment->CurrentlyOn(CastEnvironment::MAIN));
if (audio_bus.get()) {
// TODO(miu): This is reporting incorrect timestamp and delay.
// http://crbug.com/547251
- scoped_ptr<FrameEvent> playout_event(new FrameEvent());
+ std::unique_ptr<FrameEvent> playout_event(new FrameEvent());
playout_event->timestamp = cast_environment->Clock()->NowTicks();
playout_event->type = FRAME_PLAYOUT;
playout_event->media_type = AUDIO_EVENT;
@@ -205,7 +207,7 @@ void CastReceiverImpl::EmitDecodedVideoFrame(
if (video_frame.get()) {
// TODO(miu): This is reporting incorrect timestamp and delay.
// http://crbug.com/547251
- scoped_ptr<FrameEvent> playout_event(new FrameEvent());
+ std::unique_ptr<FrameEvent> playout_event(new FrameEvent());
playout_event->timestamp = cast_environment->Clock()->NowTicks();
playout_event->type = FRAME_PLAYOUT;
playout_event->media_type = VIDEO_EVENT;
« no previous file with comments | « media/cast/receiver/cast_receiver_impl.h ('k') | media/cast/receiver/frame_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698