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

Side by Side Diff: media/filters/decrypting_video_decoder.cc

Issue 17408005: Refactored DecoderBuffer to use unix_hacker_style naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@localrefactor
Patch Set: Created 7 years, 5 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 "media/filters/decrypting_video_decoder.h" 5 #include "media/filters/decrypting_video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 209
210 void DecryptingVideoDecoder::DecodePendingBuffer() { 210 void DecryptingVideoDecoder::DecodePendingBuffer() {
211 DCHECK(message_loop_->BelongsToCurrentThread()); 211 DCHECK(message_loop_->BelongsToCurrentThread());
212 DCHECK_EQ(state_, kPendingDecode) << state_; 212 DCHECK_EQ(state_, kPendingDecode) << state_;
213 TRACE_EVENT_ASYNC_BEGIN0( 213 TRACE_EVENT_ASYNC_BEGIN0(
214 "eme", "DecryptingVideoDecoder::DecodePendingBuffer", ++trace_id_); 214 "eme", "DecryptingVideoDecoder::DecodePendingBuffer", ++trace_id_);
215 215
216 int buffer_size = 0; 216 int buffer_size = 0;
217 if (!pending_buffer_to_decode_->IsEndOfStream()) { 217 if (!pending_buffer_to_decode_->end_of_stream()) {
218 buffer_size = pending_buffer_to_decode_->GetDataSize(); 218 buffer_size = pending_buffer_to_decode_->data_size();
219 } 219 }
220 220
221 decryptor_->DecryptAndDecodeVideo( 221 decryptor_->DecryptAndDecodeVideo(
222 pending_buffer_to_decode_, BindToCurrentLoop(base::Bind( 222 pending_buffer_to_decode_, BindToCurrentLoop(base::Bind(
223 &DecryptingVideoDecoder::DeliverFrame, weak_this_, buffer_size))); 223 &DecryptingVideoDecoder::DeliverFrame, weak_this_, buffer_size)));
224 } 224 }
225 225
226 void DecryptingVideoDecoder::DeliverFrame( 226 void DecryptingVideoDecoder::DeliverFrame(
227 int buffer_size, 227 int buffer_size,
228 Decryptor::Status status, 228 Decryptor::Status status,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 DecodePendingBuffer(); 272 DecodePendingBuffer();
273 return; 273 return;
274 } 274 }
275 275
276 state_ = kWaitingForKey; 276 state_ = kWaitingForKey;
277 return; 277 return;
278 } 278 }
279 279
280 if (status == Decryptor::kNeedMoreData) { 280 if (status == Decryptor::kNeedMoreData) {
281 DVLOG(2) << "DeliverFrame() - kNeedMoreData"; 281 DVLOG(2) << "DeliverFrame() - kNeedMoreData";
282 if (scoped_pending_buffer_to_decode->IsEndOfStream()) { 282 if (scoped_pending_buffer_to_decode->end_of_stream()) {
283 state_ = kDecodeFinished; 283 state_ = kDecodeFinished;
284 base::ResetAndReturn(&read_cb_).Run( 284 base::ResetAndReturn(&read_cb_).Run(
285 kOk, media::VideoFrame::CreateEmptyFrame()); 285 kOk, media::VideoFrame::CreateEmptyFrame());
286 return; 286 return;
287 } 287 }
288 288
289 state_ = kIdle; 289 state_ = kIdle;
290 base::ResetAndReturn(&read_cb_).Run(kNotEnoughData, NULL); 290 base::ResetAndReturn(&read_cb_).Run(kNotEnoughData, NULL);
291 return; 291 return;
292 } 292 }
(...skipping 21 matching lines...) Expand all
314 } 314 }
315 315
316 void DecryptingVideoDecoder::DoReset() { 316 void DecryptingVideoDecoder::DoReset() {
317 DCHECK(init_cb_.is_null()); 317 DCHECK(init_cb_.is_null());
318 DCHECK(read_cb_.is_null()); 318 DCHECK(read_cb_.is_null());
319 state_ = kIdle; 319 state_ = kIdle;
320 base::ResetAndReturn(&reset_cb_).Run(); 320 base::ResetAndReturn(&reset_cb_).Run();
321 } 321 }
322 322
323 } // namespace media 323 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_demuxer_stream_unittest.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698