| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_source_player.h" | 5 #include "media/base/android/media_source_player.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 return; | 518 return; |
| 519 } | 519 } |
| 520 | 520 |
| 521 if (IsEventPending(SURFACE_CHANGE_EVENT_PENDING)) { | 521 if (IsEventPending(SURFACE_CHANGE_EVENT_PENDING)) { |
| 522 DVLOG(1) << __FUNCTION__ << " : Handling SURFACE_CHANGE_EVENT."; | 522 DVLOG(1) << __FUNCTION__ << " : Handling SURFACE_CHANGE_EVENT."; |
| 523 // Setting a new surface will require a new MediaCodec to be created. | 523 // Setting a new surface will require a new MediaCodec to be created. |
| 524 ResetVideoDecoderJob(); | 524 ResetVideoDecoderJob(); |
| 525 ConfigureVideoDecoderJob(); | 525 ConfigureVideoDecoderJob(); |
| 526 | 526 |
| 527 // Return early if we can't successfully configure a new video decoder job | 527 // Return early if we can't successfully configure a new video decoder job |
| 528 // yet, except continue processing other pending events if |surface_| is | 528 // yet. |
| 529 // empty. | 529 if (HasVideo() && !video_decoder_job_) |
| 530 if (HasVideo() && !video_decoder_job_ && !surface_.IsEmpty()) | |
| 531 return; | 530 return; |
| 532 } | 531 } |
| 533 | 532 |
| 534 if (IsEventPending(PREFETCH_REQUEST_EVENT_PENDING)) { | 533 if (IsEventPending(PREFETCH_REQUEST_EVENT_PENDING)) { |
| 535 DVLOG(1) << __FUNCTION__ << " : Handling PREFETCH_REQUEST_EVENT."; | 534 DVLOG(1) << __FUNCTION__ << " : Handling PREFETCH_REQUEST_EVENT."; |
| 536 DCHECK(audio_decoder_job_ || AudioFinished()); | 535 DCHECK(audio_decoder_job_ || AudioFinished()); |
| 537 DCHECK(video_decoder_job_ || VideoFinished()); | 536 DCHECK(video_decoder_job_ || VideoFinished()); |
| 538 | 537 |
| 539 int count = (AudioFinished() ? 0 : 1) + (VideoFinished() ? 0 : 1); | 538 int count = (AudioFinished() ? 0 : 1) + (VideoFinished() ? 0 : 1); |
| 540 | 539 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 | 987 |
| 989 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) { | 988 void MediaSourcePlayer::ClearPendingEvent(PendingEventFlags event) { |
| 990 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")"; | 989 DVLOG(1) << __FUNCTION__ << "(" << GetEventName(event) << ")"; |
| 991 DCHECK_NE(event, NO_EVENT_PENDING); | 990 DCHECK_NE(event, NO_EVENT_PENDING); |
| 992 DCHECK(IsEventPending(event)) << GetEventName(event); | 991 DCHECK(IsEventPending(event)) << GetEventName(event); |
| 993 | 992 |
| 994 pending_event_ &= ~event; | 993 pending_event_ &= ~event; |
| 995 } | 994 } |
| 996 | 995 |
| 997 } // namespace media | 996 } // namespace media |
| OLD | NEW |