| 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 29 matching lines...) Expand all Loading... |
| 40 PpFrameWriter(); | 40 PpFrameWriter(); |
| 41 ~PpFrameWriter() override; | 41 ~PpFrameWriter() override; |
| 42 | 42 |
| 43 // FrameWriterInterface implementation. | 43 // FrameWriterInterface implementation. |
| 44 // This method will be called by the Pepper host from render thread. | 44 // This method will be called by the Pepper host from render thread. |
| 45 void PutFrame(PPB_ImageData_Impl* image_data, int64_t time_stamp_ns) override; | 45 void PutFrame(PPB_ImageData_Impl* image_data, int64_t time_stamp_ns) override; |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 // MediaStreamVideoSource implementation. | 48 // MediaStreamVideoSource implementation. |
| 49 void StartSourceImpl( | 49 void StartSourceImpl( |
| 50 const media::VideoCaptureFormat& format, | |
| 51 const blink::WebMediaConstraints& constraints, | |
| 52 const VideoCaptureDeliverFrameCB& frame_callback) override; | 50 const VideoCaptureDeliverFrameCB& frame_callback) override; |
| 53 void StopSourceImpl() override; | 51 void StopSourceImpl() override; |
| 54 | 52 |
| 55 private: | 53 private: |
| 56 media::VideoFramePool frame_pool_; | 54 media::VideoFramePool frame_pool_; |
| 57 | 55 |
| 58 class FrameWriterDelegate; | 56 class FrameWriterDelegate; |
| 59 scoped_refptr<FrameWriterDelegate> delegate_; | 57 scoped_refptr<FrameWriterDelegate> delegate_; |
| 60 | 58 |
| 61 DISALLOW_COPY_AND_ASSIGN(PpFrameWriter); | 59 DISALLOW_COPY_AND_ASSIGN(PpFrameWriter); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 103 |
| 106 PpFrameWriter::PpFrameWriter() { | 104 PpFrameWriter::PpFrameWriter() { |
| 107 DVLOG(3) << "PpFrameWriter ctor"; | 105 DVLOG(3) << "PpFrameWriter ctor"; |
| 108 } | 106 } |
| 109 | 107 |
| 110 PpFrameWriter::~PpFrameWriter() { | 108 PpFrameWriter::~PpFrameWriter() { |
| 111 DVLOG(3) << "PpFrameWriter dtor"; | 109 DVLOG(3) << "PpFrameWriter dtor"; |
| 112 } | 110 } |
| 113 | 111 |
| 114 void PpFrameWriter::StartSourceImpl( | 112 void PpFrameWriter::StartSourceImpl( |
| 115 const media::VideoCaptureFormat& format, | |
| 116 const blink::WebMediaConstraints& constraints, | |
| 117 const VideoCaptureDeliverFrameCB& frame_callback) { | 113 const VideoCaptureDeliverFrameCB& frame_callback) { |
| 118 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 114 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 119 DCHECK(!delegate_.get()); | 115 DCHECK(!delegate_.get()); |
| 120 DVLOG(3) << "PpFrameWriter::StartSourceImpl()"; | 116 DVLOG(3) << "PpFrameWriter::StartSourceImpl()"; |
| 121 delegate_ = new FrameWriterDelegate(io_task_runner(), frame_callback); | 117 delegate_ = new FrameWriterDelegate(io_task_runner(), frame_callback); |
| 122 OnStartDone(MEDIA_DEVICE_OK); | 118 OnStartDone(MEDIA_DEVICE_OK); |
| 123 } | 119 } |
| 124 | 120 |
| 125 void PpFrameWriter::StopSourceImpl() { | 121 void PpFrameWriter::StopSourceImpl() { |
| 126 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 122 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 242 |
| 247 bool track_enabled = true; | 243 bool track_enabled = true; |
| 248 stream.AddTrack(MediaStreamVideoTrack::CreateVideoTrack( | 244 stream.AddTrack(MediaStreamVideoTrack::CreateVideoTrack( |
| 249 writer, MediaStreamVideoSource::ConstraintsCallback(), track_enabled)); | 245 writer, MediaStreamVideoSource::ConstraintsCallback(), track_enabled)); |
| 250 | 246 |
| 251 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); | 247 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); |
| 252 return true; | 248 return true; |
| 253 } | 249 } |
| 254 | 250 |
| 255 } // namespace content | 251 } // namespace content |
| OLD | NEW |