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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 bitmap->setPixelRef(pixel_ref)->unref(); | 129 bitmap->setPixelRef(pixel_ref)->unref(); |
130 return true; | 130 return true; |
131 } | 131 } |
132 | 132 |
133 class SyncTokenClientImpl : public media::VideoFrame::SyncTokenClient { | 133 class SyncTokenClientImpl : public media::VideoFrame::SyncTokenClient { |
134 public: | 134 public: |
135 explicit SyncTokenClientImpl( | 135 explicit SyncTokenClientImpl( |
136 blink::WebGraphicsContext3D* web_graphics_context) | 136 blink::WebGraphicsContext3D* web_graphics_context) |
137 : web_graphics_context_(web_graphics_context) {} | 137 : web_graphics_context_(web_graphics_context) {} |
138 ~SyncTokenClientImpl() override {} | 138 ~SyncTokenClientImpl() override {} |
139 uint32 InsertSyncPoint() override { | 139 void GenerateSyncToken(gpu::SyncToken* sync_token) override { |
140 gpu::SyncToken sync_token; | 140 if (!web_graphics_context_->insertSyncPoint(sync_token->GetData())) { |
141 if (!web_graphics_context_->insertSyncPoint(sync_token.GetData())) | 141 sync_token->Clear(); |
142 return 0; | 142 } |
143 return static_cast<uint32>(sync_token.release_count()); | |
144 } | 143 } |
145 void WaitSyncToken(const gpu::SyncToken& sync_token) override { | 144 void WaitSyncToken(const gpu::SyncToken& sync_token) override { |
146 web_graphics_context_->waitSyncToken(sync_token.GetConstData()); | 145 web_graphics_context_->waitSyncToken(sync_token.GetConstData()); |
147 } | 146 } |
148 | 147 |
149 private: | 148 private: |
150 blink::WebGraphicsContext3D* web_graphics_context_; | 149 blink::WebGraphicsContext3D* web_graphics_context_; |
151 }; | 150 }; |
152 | 151 |
153 } // namespace | 152 } // namespace |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 | 1921 |
1923 bool is_hls = IsHLSStream(); | 1922 bool is_hls = IsHLSStream(); |
1924 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); | 1923 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); |
1925 if (is_hls) { | 1924 if (is_hls) { |
1926 media::RecordOriginOfHLSPlayback( | 1925 media::RecordOriginOfHLSPlayback( |
1927 GURL(frame_->document().securityOrigin().toString())); | 1926 GURL(frame_->document().securityOrigin().toString())); |
1928 } | 1927 } |
1929 } | 1928 } |
1930 | 1929 |
1931 } // namespace content | 1930 } // namespace content |
OLD | NEW |