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

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

Issue 1963343002: Report media error if PlayOutputBuffer failed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Min's comment 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 case MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED: 886 case MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED:
887 // Output buffers are replaced in MediaCodecBridge, nothing to do. 887 // Output buffers are replaced in MediaCodecBridge, nothing to do.
888 DVLOG(2) << class_name() << "::" << __FUNCTION__ 888 DVLOG(2) << class_name() << "::" << __FUNCTION__
889 << " MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED"; 889 << " MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED";
890 break; 890 break;
891 891
892 case MEDIA_CODEC_OUTPUT_FORMAT_CHANGED: 892 case MEDIA_CODEC_OUTPUT_FORMAT_CHANGED:
893 DVLOG(2) << class_name() << "::" << __FUNCTION__ 893 DVLOG(2) << class_name() << "::" << __FUNCTION__
894 << " MEDIA_CODEC_OUTPUT_FORMAT_CHANGED"; 894 << " MEDIA_CODEC_OUTPUT_FORMAT_CHANGED";
895 if (!OnOutputFormatChanged()) { 895 if (!OnOutputFormatChanged()) {
896 DVLOG(0) << class_name() << "::" << __FUNCTION__ 896 DVLOG(1) << class_name() << "::" << __FUNCTION__
897 << ": OnOutputFormatChanged failed"; 897 << ": OnOutputFormatChanged failed, stopping frame"
898 status = MEDIA_CODEC_ERROR; 898 << " processing";
899 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); 899 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_);
900 return false;
900 } 901 }
901 break; 902 break;
902 903
903 case MEDIA_CODEC_OK: 904 case MEDIA_CODEC_OK:
904 // We got the decoded frame. 905 // We got the decoded frame.
905 906
906 is_prepared_ = true; 907 is_prepared_ = true;
907 908
908 if (pts < preroll_timestamp_) 909 if (pts < preroll_timestamp_)
909 render_mode = kRenderSkip; 910 render_mode = kRenderSkip;
910 else if (GetState() == kPrerolling) 911 else if (GetState() == kPrerolling)
911 render_mode = kRenderAfterPreroll; 912 render_mode = kRenderAfterPreroll;
912 else 913 else
913 render_mode = kRenderNow; 914 render_mode = kRenderNow;
914 915
915 Render(buffer_index, offset, size, render_mode, pts, eos_encountered); 916 if (!Render(buffer_index, offset, size, render_mode, pts,
917 eos_encountered)) {
918 DVLOG(1) << class_name() << "::" << __FUNCTION__
919 << " Render failed, stopping frame processing";
920 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_);
921 return false;
922 }
916 923
917 if (render_mode == kRenderAfterPreroll) { 924 if (render_mode == kRenderAfterPreroll) {
918 DVLOG(1) << class_name() << "::" << __FUNCTION__ << " pts " << pts 925 DVLOG(1) << class_name() << "::" << __FUNCTION__ << " pts " << pts
919 << " >= preroll timestamp " << preroll_timestamp_ 926 << " >= preroll timestamp " << preroll_timestamp_
920 << " preroll done, stopping frame processing"; 927 << " preroll done, stopping frame processing";
921 media_task_runner_->PostTask(FROM_HERE, internal_preroll_done_cb_); 928 media_task_runner_->PostTask(FROM_HERE, internal_preroll_done_cb_);
922 return false; 929 return false;
923 } 930 }
924 break; 931 break;
925 932
(...skipping 68 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