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

Side by Side Diff: remoting/codec/audio_decoder_opus.cc

Issue 1545723002: Use std::move() instead of .Pass() in remoting/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass_host
Patch Set: Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/codec/audio_decoder_opus.h" 5 #include "remoting/codec/audio_decoder_opus.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 } 68 }
69 69
70 if (!decoder_) { 70 if (!decoder_) {
71 InitDecoder(); 71 InitDecoder();
72 } 72 }
73 73
74 return decoder_ != nullptr; 74 return decoder_ != nullptr;
75 } 75 }
76 76
77
78 scoped_ptr<AudioPacket> AudioDecoderOpus::Decode( 77 scoped_ptr<AudioPacket> AudioDecoderOpus::Decode(
79 scoped_ptr<AudioPacket> packet) { 78 scoped_ptr<AudioPacket> packet) {
80 if (packet->encoding() != AudioPacket::ENCODING_OPUS) { 79 if (packet->encoding() != AudioPacket::ENCODING_OPUS) {
81 LOG(WARNING) << "Received an audio packet with encoding " 80 LOG(WARNING) << "Received an audio packet with encoding "
82 << packet->encoding() << " when an OPUS packet was expected."; 81 << packet->encoding() << " when an OPUS packet was expected.";
83 return nullptr; 82 return nullptr;
84 } 83 }
85 if (packet->data_size() > kMaxFramesPerPacket) { 84 if (packet->data_size() > kMaxFramesPerPacket) {
86 LOG(WARNING) << "Received an packet with too many frames."; 85 LOG(WARNING) << "Received an packet with too many frames.";
87 return nullptr; 86 return nullptr;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 buffer_pos += result * packet->channels() * 125 buffer_pos += result * packet->channels() *
127 decoded_packet->bytes_per_sample(); 126 decoded_packet->bytes_per_sample();
128 } 127 }
129 128
130 if (!buffer_pos) { 129 if (!buffer_pos) {
131 return nullptr; 130 return nullptr;
132 } 131 }
133 132
134 decoded_data->resize(buffer_pos); 133 decoded_data->resize(buffer_pos);
135 134
136 return decoded_packet.Pass(); 135 return decoded_packet;
137 } 136 }
138 137
139 } // namespace remoting 138 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/software_video_renderer_unittest.cc ('k') | remoting/codec/audio_decoder_verbatim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698