OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/pepper/pepper_media_stream_video_track_host.h" | 5 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), | 250 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), |
251 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), | 251 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), |
252 frame_data_size_(0), | 252 frame_data_size_(0), |
253 type_(kWrite), | 253 type_(kWrite), |
254 output_started_(false), | 254 output_started_(false), |
255 weak_factory_(this) { | 255 weak_factory_(this) { |
256 InitBlinkTrack(); | 256 InitBlinkTrack(); |
257 DCHECK(!track_.isNull()); | 257 DCHECK(!track_.isNull()); |
258 } | 258 } |
259 | 259 |
| 260 PepperMediaStreamVideoTrackHost::~PepperMediaStreamVideoTrackHost() { |
| 261 OnClose(); |
| 262 } |
| 263 |
260 bool PepperMediaStreamVideoTrackHost::IsMediaStreamVideoTrackHost() { | 264 bool PepperMediaStreamVideoTrackHost::IsMediaStreamVideoTrackHost() { |
261 return true; | 265 return true; |
262 } | 266 } |
263 | 267 |
264 PepperMediaStreamVideoTrackHost::~PepperMediaStreamVideoTrackHost() { | |
265 OnClose(); | |
266 } | |
267 | |
268 void PepperMediaStreamVideoTrackHost::InitBuffers() { | 268 void PepperMediaStreamVideoTrackHost::InitBuffers() { |
269 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); | 269 gfx::Size size = GetTargetSize(source_frame_size_, plugin_frame_size_); |
270 DCHECK(!size.IsEmpty()); | 270 DCHECK(!size.IsEmpty()); |
271 | 271 |
272 PP_VideoFrame_Format format = | 272 PP_VideoFrame_Format format = |
273 GetTargetFormat(source_frame_format_, plugin_frame_format_); | 273 GetTargetFormat(source_frame_format_, plugin_frame_format_); |
274 DCHECK_NE(format, PP_VIDEOFRAME_FORMAT_UNKNOWN); | 274 DCHECK_NE(format, PP_VIDEOFRAME_FORMAT_UNKNOWN); |
275 | 275 |
276 if (format == PP_VIDEOFRAME_FORMAT_BGRA) { | 276 if (format == PP_VIDEOFRAME_FORMAT_BGRA) { |
277 frame_data_size_ = size.width() * size.height() * 4; | 277 frame_data_size_ = size.width() * size.height() * 4; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 } | 532 } |
533 | 533 |
534 void PepperMediaStreamVideoTrackHost::OnTrackStarted( | 534 void PepperMediaStreamVideoTrackHost::OnTrackStarted( |
535 MediaStreamSource* source, | 535 MediaStreamSource* source, |
536 MediaStreamRequestResult result, | 536 MediaStreamRequestResult result, |
537 const blink::WebString& result_name) { | 537 const blink::WebString& result_name) { |
538 DVLOG(3) << "OnTrackStarted result: " << result; | 538 DVLOG(3) << "OnTrackStarted result: " << result; |
539 } | 539 } |
540 | 540 |
541 } // namespace content | 541 } // namespace content |
OLD | NEW |