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

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

Issue 1525003002: Revert of Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase errors Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_decoder_job.h" 5 #include "media/base/android/media_decoder_job.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/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return MEDIA_CODEC_INPUT_END_OF_STREAM; 275 return MEDIA_CODEC_INPUT_END_OF_STREAM;
276 } 276 }
277 277
278 if (unit.key_id.empty() || unit.iv.empty()) { 278 if (unit.key_id.empty() || unit.iv.empty()) {
279 DCHECK(unit.iv.empty() || !unit.key_id.empty()); 279 DCHECK(unit.iv.empty() || !unit.key_id.empty());
280 return media_codec_bridge_->QueueInputBuffer( 280 return media_codec_bridge_->QueueInputBuffer(
281 input_buf_index, &unit.data[0], unit.data.size(), unit.timestamp); 281 input_buf_index, &unit.data[0], unit.data.size(), unit.timestamp);
282 } 282 }
283 283
284 MediaCodecStatus status = media_codec_bridge_->QueueSecureInputBuffer( 284 MediaCodecStatus status = media_codec_bridge_->QueueSecureInputBuffer(
285 input_buf_index, &unit.data[0], unit.data.size(), unit.key_id, unit.iv, 285 input_buf_index,
286 &unit.data[0], unit.data.size(),
287 reinterpret_cast<const uint8*>(&unit.key_id[0]), unit.key_id.size(),
288 reinterpret_cast<const uint8*>(&unit.iv[0]), unit.iv.size(),
286 unit.subsamples.empty() ? NULL : &unit.subsamples[0], 289 unit.subsamples.empty() ? NULL : &unit.subsamples[0],
287 unit.subsamples.size(), unit.timestamp); 290 unit.subsamples.size(),
291 unit.timestamp);
288 292
289 // In case of MEDIA_CODEC_NO_KEY, we must reuse the |input_buf_index_|. 293 // In case of MEDIA_CODEC_NO_KEY, we must reuse the |input_buf_index_|.
290 // Otherwise MediaDrm will report errors. 294 // Otherwise MediaDrm will report errors.
291 if (status == MEDIA_CODEC_NO_KEY) 295 if (status == MEDIA_CODEC_NO_KEY)
292 input_buf_index_ = input_buf_index; 296 input_buf_index_ = input_buf_index;
293 297
294 return status; 298 return status;
295 } 299 }
296 300
297 bool MediaDecoderJob::HasData() const { 301 bool MediaDecoderJob::HasData() const {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 687
684 void MediaDecoderJob::ReleaseMediaCodecBridge() { 688 void MediaDecoderJob::ReleaseMediaCodecBridge() {
685 if (!media_codec_bridge_) 689 if (!media_codec_bridge_)
686 return; 690 return;
687 691
688 media_codec_bridge_.reset(); 692 media_codec_bridge_.reset();
689 input_buf_index_ = -1; 693 input_buf_index_ = -1;
690 } 694 }
691 695
692 } // namespace media 696 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_video_decoder.cc ('k') | media/base/android/media_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698