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

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

Issue 1992913002: [merged] Report media error if PlayOutputBuffer failed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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_decoder.h ('k') | media/base/android/media_decoder_job.h » ('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 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_decoder.h" 5 #include "media/base/android/media_codec_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 case MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED: 885 case MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED:
886 // Output buffers are replaced in MediaCodecBridge, nothing to do. 886 // Output buffers are replaced in MediaCodecBridge, nothing to do.
887 DVLOG(2) << class_name() << "::" << __FUNCTION__ 887 DVLOG(2) << class_name() << "::" << __FUNCTION__
888 << " MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED"; 888 << " MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED";
889 break; 889 break;
890 890
891 case MEDIA_CODEC_OUTPUT_FORMAT_CHANGED: 891 case MEDIA_CODEC_OUTPUT_FORMAT_CHANGED:
892 DVLOG(2) << class_name() << "::" << __FUNCTION__ 892 DVLOG(2) << class_name() << "::" << __FUNCTION__
893 << " MEDIA_CODEC_OUTPUT_FORMAT_CHANGED"; 893 << " MEDIA_CODEC_OUTPUT_FORMAT_CHANGED";
894 if (!OnOutputFormatChanged()) { 894 if (!OnOutputFormatChanged()) {
895 DVLOG(0) << class_name() << "::" << __FUNCTION__ 895 DVLOG(1) << class_name() << "::" << __FUNCTION__
896 << ": OnOutputFormatChanged failed"; 896 << ": OnOutputFormatChanged failed, stopping frame"
897 status = MEDIA_CODEC_ERROR; 897 << " processing";
898 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); 898 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_);
899 return false;
899 } 900 }
900 break; 901 break;
901 902
902 case MEDIA_CODEC_OK: 903 case MEDIA_CODEC_OK:
903 // We got the decoded frame. 904 // We got the decoded frame.
904 905
905 is_prepared_ = true; 906 is_prepared_ = true;
906 907
907 if (pts < preroll_timestamp_) 908 if (pts < preroll_timestamp_)
908 render_mode = kRenderSkip; 909 render_mode = kRenderSkip;
909 else if (GetState() == kPrerolling) 910 else if (GetState() == kPrerolling)
910 render_mode = kRenderAfterPreroll; 911 render_mode = kRenderAfterPreroll;
911 else 912 else
912 render_mode = kRenderNow; 913 render_mode = kRenderNow;
913 914
914 Render(buffer_index, offset, size, render_mode, pts, eos_encountered); 915 if (!Render(buffer_index, offset, size, render_mode, pts,
916 eos_encountered)) {
917 DVLOG(1) << class_name() << "::" << __FUNCTION__
918 << " Render failed, stopping frame processing";
919 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_);
920 return false;
921 }
915 922
916 if (render_mode == kRenderAfterPreroll) { 923 if (render_mode == kRenderAfterPreroll) {
917 DVLOG(1) << class_name() << "::" << __FUNCTION__ << " pts " << pts 924 DVLOG(1) << class_name() << "::" << __FUNCTION__ << " pts " << pts
918 << " >= preroll timestamp " << preroll_timestamp_ 925 << " >= preroll timestamp " << preroll_timestamp_
919 << " preroll done, stopping frame processing"; 926 << " preroll done, stopping frame processing";
920 media_task_runner_->PostTask(FROM_HERE, internal_preroll_done_cb_); 927 media_task_runner_->PostTask(FROM_HERE, internal_preroll_done_cb_);
921 return false; 928 return false;
922 } 929 }
923 break; 930 break;
924 931
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 RETURN_STRING(kStopping); 1001 RETURN_STRING(kStopping);
995 RETURN_STRING(kInEmergencyStop); 1002 RETURN_STRING(kInEmergencyStop);
996 RETURN_STRING(kError); 1003 RETURN_STRING(kError);
997 } 1004 }
998 return nullptr; // crash early 1005 return nullptr; // crash early
999 } 1006 }
1000 1007
1001 #undef RETURN_STRING 1008 #undef RETURN_STRING
1002 1009
1003 } // namespace media 1010 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_decoder.h ('k') | media/base/android/media_decoder_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698