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

Side by Side Diff: media/base/android/media_codec_loop.cc

Issue 2491613004: Make base::Timer sequence-friendly. (Closed)
Patch Set: add back commented out DCHECK in Stop() Created 3 years, 6 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
« no previous file with comments | « media/base/android/media_codec_loop.h ('k') | media/base/android/media_codec_loop_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/base/android/media_codec_loop.h" 5 #include "media/base/android/media_codec_loop.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/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 21 matching lines...) Expand all
32 presentation_time(other.presentation_time), 32 presentation_time(other.presentation_time),
33 is_eos(other.is_eos), 33 is_eos(other.is_eos),
34 encryption_scheme(other.encryption_scheme) {} 34 encryption_scheme(other.encryption_scheme) {}
35 35
36 MediaCodecLoop::InputData::~InputData() {} 36 MediaCodecLoop::InputData::~InputData() {}
37 37
38 MediaCodecLoop::MediaCodecLoop( 38 MediaCodecLoop::MediaCodecLoop(
39 int sdk_int, 39 int sdk_int,
40 Client* client, 40 Client* client,
41 std::unique_ptr<MediaCodecBridge> media_codec, 41 std::unique_ptr<MediaCodecBridge> media_codec,
42 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 42 scoped_refptr<base::SingleThreadTaskRunner> timer_task_runner)
43 : state_(STATE_READY), 43 : state_(STATE_READY),
44 client_(client), 44 client_(client),
45 media_codec_(std::move(media_codec)), 45 media_codec_(std::move(media_codec)),
46 pending_input_buf_index_(kInvalidBufferIndex), 46 pending_input_buf_index_(kInvalidBufferIndex),
47 sdk_int_(sdk_int), 47 sdk_int_(sdk_int),
48 weak_factory_(this) { 48 weak_factory_(this) {
49 if (task_runner) 49 if (timer_task_runner)
50 io_timer_.SetTaskRunner(task_runner); 50 io_timer_.SetTaskRunner(timer_task_runner);
51 // TODO(liberato): should this DCHECK? 51 // TODO(liberato): should this DCHECK?
52 if (media_codec_ == nullptr) 52 if (media_codec_ == nullptr)
53 SetState(STATE_ERROR); 53 SetState(STATE_ERROR);
54 } 54 }
55 55
56 MediaCodecLoop::~MediaCodecLoop() { 56 MediaCodecLoop::~MediaCodecLoop() {
57 io_timer_.Stop(); 57 io_timer_.Stop();
58 } 58 }
59 59
60 void MediaCodecLoop::SetTestTickClock(base::TickClock* test_tick_clock) { 60 void MediaCodecLoop::SetTestTickClock(base::TickClock* test_tick_clock) {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 RETURN_STRING(STATE_DRAINED); 361 RETURN_STRING(STATE_DRAINED);
362 RETURN_STRING(STATE_ERROR); 362 RETURN_STRING(STATE_ERROR);
363 } 363 }
364 #undef RETURN_STRING 364 #undef RETURN_STRING
365 365
366 NOTREACHED() << "Unknown state " << state; 366 NOTREACHED() << "Unknown state " << state;
367 return nullptr; 367 return nullptr;
368 } 368 }
369 369
370 } // namespace media 370 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_loop.h ('k') | media/base/android/media_codec_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698