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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 // If |key_added_while_decode_pending_| is true and both audio and video | 515 // If |key_added_while_decode_pending_| is true and both audio and video |
516 // decoding succeeded, we should clear |key_added_while_decode_pending_| here. | 516 // decoding succeeded, we should clear |key_added_while_decode_pending_| here. |
517 // But that would add more complexity into this function. If we don't clear it | 517 // But that would add more complexity into this function. If we don't clear it |
518 // here, the worst case would be we call ResumePlaybackAfterKeyAdded() when | 518 // here, the worst case would be we call ResumePlaybackAfterKeyAdded() when |
519 // we don't really have a new key. This should rarely happen and the | 519 // we don't really have a new key. This should rarely happen and the |
520 // performance impact should be pretty small. | 520 // performance impact should be pretty small. |
521 // TODO(qinmin/xhwang): This class is complicated because we handle both audio | 521 // TODO(qinmin/xhwang): This class is complicated because we handle both audio |
522 // and video in one file. If we separate them, we should be able to remove a | 522 // and video in one file. If we separate them, we should be able to remove a |
523 // lot of duplication. | 523 // lot of duplication. |
524 | 524 |
525 // If the status is MEDIA_CODEC_STOPPED, stop decoding new data. The player is | 525 // If the status is MEDIA_CODEC_ABORT, stop decoding new data. The player is |
526 // in the middle of a seek or stop event and needs to wait for the IPCs to | 526 // in the middle of a seek or stop event and needs to wait for the IPCs to |
527 // come. | 527 // come. |
528 if (status == MEDIA_CODEC_STOPPED) | 528 if (status == MEDIA_CODEC_ABORT) |
529 return; | 529 return; |
530 | 530 |
531 if (prerolling_ && IsPrerollFinished(is_audio)) { | 531 if (prerolling_ && IsPrerollFinished(is_audio)) { |
532 if (IsPrerollFinished(!is_audio)) { | 532 if (IsPrerollFinished(!is_audio)) { |
533 prerolling_ = false; | 533 prerolling_ = false; |
534 StartInternal(); | 534 StartInternal(); |
535 } | 535 } |
536 return; | 536 return; |
537 } | 537 } |
538 | 538 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release | 807 // support setMediaKeys(0) (see http://crbug.com/330324), or when we release |
808 // MediaDrm when the video is paused, or when the device goes to sleep (see | 808 // MediaDrm when the video is paused, or when the device goes to sleep (see |
809 // http://crbug.com/272421). | 809 // http://crbug.com/272421). |
810 audio_decoder_job_->SetDrmBridge(NULL); | 810 audio_decoder_job_->SetDrmBridge(NULL); |
811 video_decoder_job_->SetDrmBridge(NULL); | 811 video_decoder_job_->SetDrmBridge(NULL); |
812 cdm_registration_id_ = 0; | 812 cdm_registration_id_ = 0; |
813 drm_bridge_ = NULL; | 813 drm_bridge_ = NULL; |
814 } | 814 } |
815 | 815 |
816 } // namespace media | 816 } // namespace media |
OLD | NEW |