OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/video_media_codec_decoder.h" | 5 #include "media/base/android/video_media_codec_decoder.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 void VideoMediaCodecDecoder::ReleaseDecoderResources() { | 80 void VideoMediaCodecDecoder::ReleaseDecoderResources() { |
81 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 81 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
82 DVLOG(1) << class_name() << "::" << __FUNCTION__; | 82 DVLOG(1) << class_name() << "::" << __FUNCTION__; |
83 | 83 |
84 DoEmergencyStop(); | 84 DoEmergencyStop(); |
85 | 85 |
86 ReleaseMediaCodec(); | 86 ReleaseMediaCodec(); |
87 | 87 |
88 surface_ = gfx::ScopedJavaSurface(); | 88 surface_ = gl::ScopedJavaSurface(); |
89 } | 89 } |
90 | 90 |
91 void VideoMediaCodecDecoder::ReleaseMediaCodec() { | 91 void VideoMediaCodecDecoder::ReleaseMediaCodec() { |
92 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 92 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
93 | 93 |
94 MediaCodecDecoder::ReleaseMediaCodec(); | 94 MediaCodecDecoder::ReleaseMediaCodec(); |
95 delayed_buffers_.clear(); | 95 delayed_buffers_.clear(); |
96 } | 96 } |
97 | 97 |
98 void VideoMediaCodecDecoder::SetVideoSurface(gfx::ScopedJavaSurface surface) { | 98 void VideoMediaCodecDecoder::SetVideoSurface(gl::ScopedJavaSurface surface) { |
99 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 99 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
100 | 100 |
101 DVLOG(1) << class_name() << "::" << __FUNCTION__ | 101 DVLOG(1) << class_name() << "::" << __FUNCTION__ |
102 << (surface.IsEmpty() ? " empty" : " non-empty"); | 102 << (surface.IsEmpty() ? " empty" : " non-empty"); |
103 | 103 |
104 surface_ = std::move(surface); | 104 surface_ = std::move(surface); |
105 | 105 |
106 needs_reconfigure_ = true; | 106 needs_reconfigure_ = true; |
107 } | 107 } |
108 | 108 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 // |update_current_time_cb_| might be null if there is audio stream. | 351 // |update_current_time_cb_| might be null if there is audio stream. |
352 // Do not update current time for stand-alone EOS frames. | 352 // Do not update current time for stand-alone EOS frames. |
353 if (!update_current_time_cb_.is_null() && update_time) { | 353 if (!update_current_time_cb_.is_null() && update_time) { |
354 media_task_runner_->PostTask( | 354 media_task_runner_->PostTask( |
355 FROM_HERE, base::Bind(update_current_time_cb_, pts, pts, false)); | 355 FROM_HERE, base::Bind(update_current_time_cb_, pts, pts, false)); |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 } // namespace media | 359 } // namespace media |
OLD | NEW |