| 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/media_codec_player.h" | 5 #include "media/base/android/media_codec_player.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 DetachListener(); | 137 DetachListener(); |
| 138 | 138 |
| 139 // The base class part that deals with MediaPlayerListener | 139 // The base class part that deals with MediaPlayerListener |
| 140 // has to be destroyed on UI thread. | 140 // has to be destroyed on UI thread. |
| 141 DestroyListenerOnUIThread(); | 141 DestroyListenerOnUIThread(); |
| 142 | 142 |
| 143 // Post deletion onto Media thread | 143 // Post deletion onto Media thread |
| 144 GetMediaTaskRunner()->DeleteSoon(FROM_HERE, this); | 144 GetMediaTaskRunner()->DeleteSoon(FROM_HERE, this); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void MediaCodecPlayer::SetVideoSurface(gfx::ScopedJavaSurface surface) { | 147 void MediaCodecPlayer::SetVideoSurface(gl::ScopedJavaSurface surface) { |
| 148 RUN_ON_MEDIA_THREAD(SetVideoSurface, base::Passed(&surface)); | 148 RUN_ON_MEDIA_THREAD(SetVideoSurface, base::Passed(&surface)); |
| 149 | 149 |
| 150 DVLOG(1) << __FUNCTION__ << (surface.IsEmpty() ? " empty" : " non-empty"); | 150 DVLOG(1) << __FUNCTION__ << (surface.IsEmpty() ? " empty" : " non-empty"); |
| 151 | 151 |
| 152 // Save the empty-ness before we pass the surface to the decoder. | 152 // Save the empty-ness before we pass the surface to the decoder. |
| 153 bool surface_is_empty = surface.IsEmpty(); | 153 bool surface_is_empty = surface.IsEmpty(); |
| 154 | 154 |
| 155 // Apparently RemoveVideoSurface() can be called several times in a row, | 155 // Apparently RemoveVideoSurface() can be called several times in a row, |
| 156 // ignore the second and subsequent calls. | 156 // ignore the second and subsequent calls. |
| 157 if (surface_is_empty && !video_decoder_->HasVideoSurface()) { | 157 if (surface_is_empty && !video_decoder_->HasVideoSurface()) { |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 RETURN_STRING(kStateWaitingForMediaCrypto); | 1413 RETURN_STRING(kStateWaitingForMediaCrypto); |
| 1414 RETURN_STRING(kStateWaitingForSeek); | 1414 RETURN_STRING(kStateWaitingForSeek); |
| 1415 RETURN_STRING(kStateError); | 1415 RETURN_STRING(kStateError); |
| 1416 } | 1416 } |
| 1417 return nullptr; // crash early | 1417 return nullptr; // crash early |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 #undef RETURN_STRING | 1420 #undef RETURN_STRING |
| 1421 | 1421 |
| 1422 } // namespace media | 1422 } // namespace media |
| OLD | NEW |