Chromium Code Reviews| 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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1220 texture_mailbox_sync_token.GetData()); | 1220 texture_mailbox_sync_token.GetData()); |
| 1221 | 1221 |
| 1222 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( | 1222 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( |
| 1223 media::PIXEL_FORMAT_ARGB, | 1223 media::PIXEL_FORMAT_ARGB, |
| 1224 gpu::MailboxHolder(texture_mailbox_, texture_mailbox_sync_token, | 1224 gpu::MailboxHolder(texture_mailbox_, texture_mailbox_sync_token, |
| 1225 texture_target), | 1225 texture_target), |
| 1226 media::BindToCurrentLoop(base::Bind( | 1226 media::BindToCurrentLoop(base::Bind( |
| 1227 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)), | 1227 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)), |
| 1228 natural_size_, gfx::Rect(natural_size_), natural_size_, | 1228 natural_size_, gfx::Rect(natural_size_), natural_size_, |
| 1229 base::TimeDelta()); | 1229 base::TimeDelta()); |
| 1230 new_frame->metadata()->SetBoolean(media::VideoFrameMetadata::COPY_REQUIRED, | 1230 if (new_frame.get()) { |
| 1231 enable_texture_copy_); | 1231 new_frame->metadata()->SetBoolean( |
|
Torne
2016/02/03 11:05:32
Did you mean to change this?
Tobias Sargeant
2016/02/03 11:14:11
No, comes from another CL. Will remove.
| |
| 1232 media::VideoFrameMetadata::COPY_REQUIRED, enable_texture_copy_); | |
| 1233 } | |
| 1232 SetCurrentFrameInternal(new_frame); | 1234 SetCurrentFrameInternal(new_frame); |
| 1233 } | 1235 } |
| 1234 } | 1236 } |
| 1235 | 1237 |
| 1236 void WebMediaPlayerAndroid::SetVideoFrameProviderClient( | 1238 void WebMediaPlayerAndroid::SetVideoFrameProviderClient( |
| 1237 cc::VideoFrameProvider::Client* client) { | 1239 cc::VideoFrameProvider::Client* client) { |
| 1238 // This is called from both the main renderer thread and the compositor | 1240 // This is called from both the main renderer thread and the compositor |
| 1239 // thread (when the main thread is blocked). | 1241 // thread (when the main thread is blocked). |
| 1240 | 1242 |
| 1241 // Set the callback target when a frame is produced. Need to do this before | 1243 // Set the callback target when a frame is produced. Need to do this before |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1925 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1927 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1926 } else if (is_hls_url == is_hls) { | 1928 } else if (is_hls_url == is_hls) { |
| 1927 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1929 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1928 } | 1930 } |
| 1929 UMA_HISTOGRAM_ENUMERATION( | 1931 UMA_HISTOGRAM_ENUMERATION( |
| 1930 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1932 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1931 result, PREDICTION_RESULT_MAX); | 1933 result, PREDICTION_RESULT_MAX); |
| 1932 } | 1934 } |
| 1933 | 1935 |
| 1934 } // namespace content | 1936 } // namespace content |
| OLD | NEW |