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/webrtc/video_destination_handler.h" | 5 #include "content/renderer/media/webrtc/video_destination_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // PpFrameWriterProxy is a helper class to make sure the user won't use | 182 // PpFrameWriterProxy is a helper class to make sure the user won't use |
183 // PpFrameWriter after it is released (IOW its owner - WebMediaStreamSource - | 183 // PpFrameWriter after it is released (IOW its owner - WebMediaStreamSource - |
184 // is released). | 184 // is released). |
185 class PpFrameWriterProxy : public FrameWriterInterface { | 185 class PpFrameWriterProxy : public FrameWriterInterface { |
186 public: | 186 public: |
187 explicit PpFrameWriterProxy(const base::WeakPtr<PpFrameWriter>& writer) | 187 explicit PpFrameWriterProxy(const base::WeakPtr<PpFrameWriter>& writer) |
188 : writer_(writer) { | 188 : writer_(writer) { |
189 DCHECK(writer_ != NULL); | 189 DCHECK(writer_ != NULL); |
190 } | 190 } |
191 | 191 |
192 virtual ~PpFrameWriterProxy() {} | 192 ~PpFrameWriterProxy() override {} |
193 | 193 |
194 virtual void PutFrame(PPB_ImageData_Impl* image_data, | 194 void PutFrame(PPB_ImageData_Impl* image_data, int64 time_stamp_ns) override { |
195 int64 time_stamp_ns) override { | |
196 writer_->PutFrame(image_data, time_stamp_ns); | 195 writer_->PutFrame(image_data, time_stamp_ns); |
197 } | 196 } |
198 | 197 |
199 private: | 198 private: |
200 base::WeakPtr<PpFrameWriter> writer_; | 199 base::WeakPtr<PpFrameWriter> writer_; |
201 | 200 |
202 DISALLOW_COPY_AND_ASSIGN(PpFrameWriterProxy); | 201 DISALLOW_COPY_AND_ASSIGN(PpFrameWriterProxy); |
203 }; | 202 }; |
204 | 203 |
205 bool VideoDestinationHandler::Open( | 204 bool VideoDestinationHandler::Open( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 244 |
246 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack( | 245 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack( |
247 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(), | 246 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(), |
248 track_enabled)); | 247 track_enabled)); |
249 | 248 |
250 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); | 249 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); |
251 return true; | 250 return true; |
252 } | 251 } |
253 | 252 |
254 } // namespace content | 253 } // namespace content |
OLD | NEW |