| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/pepper_to_video_track_adapter.h" | 5 #include "content/renderer/media/pepper_to_video_track_adapter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 delegate_->DeliverFrame(new_frame); | 202 delegate_->DeliverFrame(new_frame); |
| 203 } | 203 } |
| 204 | 204 |
| 205 // PpFrameWriterProxy is a helper class to make sure the user won't use | 205 // PpFrameWriterProxy is a helper class to make sure the user won't use |
| 206 // PpFrameWriter after it is released (IOW its owner - WebMediaStreamSource - | 206 // PpFrameWriter after it is released (IOW its owner - WebMediaStreamSource - |
| 207 // is released). | 207 // is released). |
| 208 class PpFrameWriterProxy : public FrameWriterInterface { | 208 class PpFrameWriterProxy : public FrameWriterInterface { |
| 209 public: | 209 public: |
| 210 explicit PpFrameWriterProxy(const base::WeakPtr<PpFrameWriter>& writer) | 210 explicit PpFrameWriterProxy(const base::WeakPtr<PpFrameWriter>& writer) |
| 211 : writer_(writer) { | 211 : writer_(writer) { |
| 212 DCHECK(writer_ != NULL); | 212 DCHECK(writer_); |
| 213 } | 213 } |
| 214 | 214 |
| 215 ~PpFrameWriterProxy() override {} | 215 ~PpFrameWriterProxy() override {} |
| 216 | 216 |
| 217 void PutFrame(PPB_ImageData_Impl* image_data, | 217 void PutFrame(PPB_ImageData_Impl* image_data, |
| 218 int64_t time_stamp_ns) override { | 218 int64_t time_stamp_ns) override { |
| 219 writer_->PutFrame(image_data, time_stamp_ns); | 219 writer_->PutFrame(image_data, time_stamp_ns); |
| 220 } | 220 } |
| 221 | 221 |
| 222 private: | 222 private: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack( | 268 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack( |
| 269 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(), | 269 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(), |
| 270 track_enabled)); | 270 track_enabled)); |
| 271 | 271 |
| 272 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); | 272 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); |
| 273 return true; | 273 return true; |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace content | 276 } // namespace content |
| OLD | NEW |