OLD | NEW |
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 "content/renderer/media/android/media_source_delegate.h" | 5 #include "content/renderer/media/android/media_source_delegate.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 DVLOG(1) << "Video config is changed: " << size.width() << "x" | 406 DVLOG(1) << "Video config is changed: " << size.width() << "x" |
407 << size.height(); | 407 << size.height(); |
408 } | 408 } |
409 data->access_units[index].status = status; | 409 data->access_units[index].status = status; |
410 data->access_units.resize(index + 1); | 410 data->access_units.resize(index + 1); |
411 break; | 411 break; |
412 | 412 |
413 case DemuxerStream::kOk: | 413 case DemuxerStream::kOk: |
414 data->access_units[index].status = status; | 414 data->access_units[index].status = status; |
415 if (buffer->end_of_stream()) { | 415 if (buffer->end_of_stream()) { |
416 data->access_units[index].end_of_stream = true; | 416 data->access_units[index].is_end_of_stream = true; |
417 data->access_units.resize(index + 1); | 417 data->access_units.resize(index + 1); |
418 break; | 418 break; |
419 } | 419 } |
| 420 data->access_units[index].is_key_frame = buffer->is_key_frame(); |
420 // TODO(ycheo): We assume that the inputed stream will be decoded | 421 // TODO(ycheo): We assume that the inputed stream will be decoded |
421 // right away. | 422 // right away. |
422 // Need to implement this properly using MediaPlayer.OnInfoListener. | 423 // Need to implement this properly using MediaPlayer.OnInfoListener. |
423 if (is_audio) { | 424 if (is_audio) { |
424 statistics_.audio_bytes_decoded += buffer->data_size(); | 425 statistics_.audio_bytes_decoded += buffer->data_size(); |
425 } else { | 426 } else { |
426 statistics_.video_bytes_decoded += buffer->data_size(); | 427 statistics_.video_bytes_decoded += buffer->data_size(); |
427 statistics_.video_frames_decoded++; | 428 statistics_.video_frames_decoded++; |
428 } | 429 } |
429 data->access_units[index].timestamp = buffer->timestamp(); | 430 data->access_units[index].timestamp = buffer->timestamp(); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 configs->video_size = config.natural_size(); | 745 configs->video_size = config.natural_size(); |
745 configs->is_video_encrypted = config.is_encrypted(); | 746 configs->is_video_encrypted = config.is_encrypted(); |
746 configs->video_extra_data = std::vector<uint8>( | 747 configs->video_extra_data = std::vector<uint8>( |
747 config.extra_data(), config.extra_data() + config.extra_data_size()); | 748 config.extra_data(), config.extra_data() + config.extra_data_size()); |
748 return true; | 749 return true; |
749 } | 750 } |
750 return false; | 751 return false; |
751 } | 752 } |
752 | 753 |
753 } // namespace content | 754 } // namespace content |
OLD | NEW |