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

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

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 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 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_audio_decoder.h" 5 #include "media/filters/decrypting_audio_decoder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstdlib> 9 #include <cstdlib>
10 10
(...skipping 18 matching lines...) Expand all
29 const base::TimeDelta& timestamp_2) { 29 const base::TimeDelta& timestamp_2) {
30 // Out of sync of 100ms would be pretty noticeable and we should keep any 30 // Out of sync of 100ms would be pretty noticeable and we should keep any
31 // drift below that. 31 // drift below that.
32 const int64_t kOutOfSyncThresholdInMilliseconds = 100; 32 const int64_t kOutOfSyncThresholdInMilliseconds = 100;
33 return std::abs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) > 33 return std::abs(timestamp_1.InMilliseconds() - timestamp_2.InMilliseconds()) >
34 kOutOfSyncThresholdInMilliseconds; 34 kOutOfSyncThresholdInMilliseconds;
35 } 35 }
36 36
37 DecryptingAudioDecoder::DecryptingAudioDecoder( 37 DecryptingAudioDecoder::DecryptingAudioDecoder(
38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
39 const scoped_refptr<MediaLog>& media_log, 39 MediaLog* media_log,
40 const base::Closure& waiting_for_decryption_key_cb) 40 const base::Closure& waiting_for_decryption_key_cb)
41 : task_runner_(task_runner), 41 : task_runner_(task_runner),
42 media_log_(media_log), 42 media_log_(media_log),
43 state_(kUninitialized), 43 state_(kUninitialized),
44 waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb), 44 waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb),
45 decryptor_(NULL), 45 decryptor_(NULL),
46 key_added_while_decode_pending_(false), 46 key_added_while_decode_pending_(false),
47 weak_factory_(this) {} 47 weak_factory_(this) {}
48 48
49 std::string DecryptingAudioDecoder::GetDisplayName() const { 49 std::string DecryptingAudioDecoder::GetDisplayName() const {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 351
352 frame->set_timestamp(current_time); 352 frame->set_timestamp(current_time);
353 timestamp_helper_->AddFrames(frame->frame_count()); 353 timestamp_helper_->AddFrames(frame->frame_count());
354 354
355 output_cb_.Run(frame); 355 output_cb_.Run(frame);
356 } 356 }
357 } 357 }
358 358
359 } // namespace media 359 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698