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

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

Issue 2697643003: media: Clean up MediaCodecBridge and remove subclasses (Closed)
Patch Set: rebase Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_loop.h" 5 #include "media/base/android/media_codec_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/bind_to_current_loop.h" 10 #include "media/base/bind_to_current_loop.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 InputBuffer result(pending_input_buf_index_, true); 143 InputBuffer result(pending_input_buf_index_, true);
144 pending_input_buf_index_ = kInvalidBufferIndex; 144 pending_input_buf_index_ = kInvalidBufferIndex;
145 return result; 145 return result;
146 } 146 }
147 147
148 int input_buf_index = kInvalidBufferIndex; 148 int input_buf_index = kInvalidBufferIndex;
149 149
150 media::MediaCodecStatus status = 150 media::MediaCodecStatus status =
151 media_codec_->DequeueInputBuffer(kNoWaitTimeout, &input_buf_index); 151 media_codec_->DequeueInputBuffer(kNoWaitTimeout, &input_buf_index);
152 switch (status) { 152 switch (status) {
153 case media::MEDIA_CODEC_DEQUEUE_INPUT_AGAIN_LATER: 153 case media::MEDIA_CODEC_TRY_AGAIN_LATER:
154 break; 154 break;
155 155
156 case media::MEDIA_CODEC_ERROR: 156 case media::MEDIA_CODEC_ERROR:
157 DLOG(ERROR) << __func__ << ": MEDIA_CODEC_ERROR from DequeInputBuffer"; 157 DLOG(ERROR) << __func__ << ": MEDIA_CODEC_ERROR from DequeInputBuffer";
158 SetState(STATE_ERROR); 158 SetState(STATE_ERROR);
159 break; 159 break;
160 160
161 case media::MEDIA_CODEC_OK: 161 case media::MEDIA_CODEC_OK:
162 break; 162 break;
163 163
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 client_->OnDecodedEos(out); 281 client_->OnDecodedEos(out);
282 } else { 282 } else {
283 if (!client_->OnDecodedFrame(out)) 283 if (!client_->OnDecodedFrame(out))
284 SetState(STATE_ERROR); 284 SetState(STATE_ERROR);
285 } 285 }
286 286
287 did_work = true; 287 did_work = true;
288 break; 288 break;
289 289
290 case MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER: 290 case MEDIA_CODEC_TRY_AGAIN_LATER:
291 // Nothing to do. 291 // Nothing to do.
292 break; 292 break;
293 293
294 case MEDIA_CODEC_ERROR: 294 case MEDIA_CODEC_ERROR:
295 DLOG(ERROR) << __func__ << ": MEDIA_CODEC_ERROR from DequeueOutputBuffer"; 295 DLOG(ERROR) << __func__ << ": MEDIA_CODEC_ERROR from DequeueOutputBuffer";
296 SetState(STATE_ERROR); 296 SetState(STATE_ERROR);
297 break; 297 break;
298 298
299 default: 299 default:
300 NOTREACHED() << "Unknown DequeueOutputBuffer status " << status; 300 NOTREACHED() << "Unknown DequeueOutputBuffer status " << status;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 RETURN_STRING(STATE_DRAINED); 360 RETURN_STRING(STATE_DRAINED);
361 RETURN_STRING(STATE_ERROR); 361 RETURN_STRING(STATE_ERROR);
362 } 362 }
363 #undef RETURN_STRING 363 #undef RETURN_STRING
364 364
365 NOTREACHED() << "Unknown state " << state; 365 NOTREACHED() << "Unknown state " << state;
366 return nullptr; 366 return nullptr;
367 } 367 }
368 368
369 } // namespace media 369 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_direction.h ('k') | media/base/android/media_codec_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698