| 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/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/renderer/render_view_impl.h" | 32 #include "content/renderer/render_view_impl.h" |
| 33 #include "gpu/GLES2/gl2extchromium.h" | 33 #include "gpu/GLES2/gl2extchromium.h" |
| 34 #include "gpu/command_buffer/client/gles2_interface.h" | 34 #include "gpu/command_buffer/client/gles2_interface.h" |
| 35 #include "gpu/command_buffer/common/constants.h" | 35 #include "gpu/command_buffer/common/constants.h" |
| 36 #include "gpu/command_buffer/common/mailbox_holder.h" | 36 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 37 #include "media/base/android/media_codec_util.h" | 37 #include "media/base/android/media_codec_util.h" |
| 38 #include "media/base/android/media_common_android.h" | 38 #include "media/base/android/media_common_android.h" |
| 39 #include "media/base/android/media_player_android.h" | 39 #include "media/base/android/media_player_android.h" |
| 40 #include "media/base/bind_to_current_loop.h" | 40 #include "media/base/bind_to_current_loop.h" |
| 41 #include "media/base/cdm_context.h" | 41 #include "media/base/cdm_context.h" |
| 42 #include "media/base/media_content_type.h" |
| 42 #include "media/base/media_keys.h" | 43 #include "media/base/media_keys.h" |
| 43 #include "media/base/media_log.h" | 44 #include "media/base/media_log.h" |
| 44 #include "media/base/media_switches.h" | 45 #include "media/base/media_switches.h" |
| 45 #include "media/base/timestamp_constants.h" | 46 #include "media/base/timestamp_constants.h" |
| 46 #include "media/base/video_frame.h" | 47 #include "media/base/video_frame.h" |
| 47 #include "media/blink/webcontentdecryptionmodule_impl.h" | 48 #include "media/blink/webcontentdecryptionmodule_impl.h" |
| 48 #include "media/blink/webmediaplayer_cast_android.h" | 49 #include "media/blink/webmediaplayer_cast_android.h" |
| 49 #include "media/blink/webmediaplayer_delegate.h" | 50 #include "media/blink/webmediaplayer_delegate.h" |
| 50 #include "media/blink/webmediaplayer_util.h" | 51 #include "media/blink/webmediaplayer_util.h" |
| 51 #include "net/base/mime_util.h" | 52 #include "net/base/mime_util.h" |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 else | 1381 else |
| 1381 interpolator_.StopInterpolating(); | 1382 interpolator_.StopInterpolating(); |
| 1382 | 1383 |
| 1383 if (delegate_) { | 1384 if (delegate_) { |
| 1384 if (is_playing) { | 1385 if (is_playing) { |
| 1385 // We must specify either video or audio to the delegate, but neither may | 1386 // We must specify either video or audio to the delegate, but neither may |
| 1386 // be known at this point -- there are no video only containers, so only | 1387 // be known at this point -- there are no video only containers, so only |
| 1387 // send audio if we know for sure its audio. The browser side player will | 1388 // send audio if we know for sure its audio. The browser side player will |
| 1388 // fill in the correct value later for media sessions. | 1389 // fill in the correct value later for media sessions. |
| 1389 delegate_->DidPlay(delegate_id_, hasVideo(), !hasVideo(), isRemote(), | 1390 delegate_->DidPlay(delegate_id_, hasVideo(), !hasVideo(), isRemote(), |
| 1390 duration_); | 1391 media::DurationToMediaContentType(duration_)); |
| 1391 } else { | 1392 } else { |
| 1392 // Even if OnPlaybackComplete() has not been called yet, Blink may have | 1393 // Even if OnPlaybackComplete() has not been called yet, Blink may have |
| 1393 // already fired the ended event based on current time relative to | 1394 // already fired the ended event based on current time relative to |
| 1394 // duration -- so we need to check both possibilities here. | 1395 // duration -- so we need to check both possibilities here. |
| 1395 delegate_->DidPause(delegate_id_, | 1396 delegate_->DidPause(delegate_id_, |
| 1396 playback_completed_ || currentTime() >= duration()); | 1397 playback_completed_ || currentTime() >= duration()); |
| 1397 } | 1398 } |
| 1398 } | 1399 } |
| 1399 } | 1400 } |
| 1400 | 1401 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1663 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1663 } else if (is_hls_url == is_hls) { | 1664 } else if (is_hls_url == is_hls) { |
| 1664 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1665 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1665 } | 1666 } |
| 1666 UMA_HISTOGRAM_ENUMERATION( | 1667 UMA_HISTOGRAM_ENUMERATION( |
| 1667 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1668 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1668 result, PREDICTION_RESULT_MAX); | 1669 result, PREDICTION_RESULT_MAX); |
| 1669 } | 1670 } |
| 1670 | 1671 |
| 1671 } // namespace content | 1672 } // namespace content |
| OLD | NEW |