| 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 "media/cast/sender/fake_software_video_encoder.h" | 5 #include "media/cast/sender/fake_software_video_encoder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
| 12 #include "media/cast/common/rtp_time.h" | 12 #include "media/cast/common/rtp_time.h" |
| 13 #include "media/cast/constants.h" | 13 #include "media/cast/constants.h" |
| 14 | 14 |
| 15 #ifndef OFFICIAL_BUILD | 15 #ifndef OFFICIAL_BUILD |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 namespace cast { | 18 namespace cast { |
| 19 | 19 |
| 20 FakeSoftwareVideoEncoder::FakeSoftwareVideoEncoder( | 20 FakeSoftwareVideoEncoder::FakeSoftwareVideoEncoder( |
| 21 const VideoSenderConfig& video_config) | 21 const FrameSenderConfig& video_config) |
| 22 : video_config_(video_config), | 22 : video_config_(video_config), |
| 23 next_frame_is_key_(true), | 23 next_frame_is_key_(true), |
| 24 frame_id_(FrameId::first()), | 24 frame_id_(FrameId::first()), |
| 25 frame_size_(0) {} | 25 frame_size_(0) { |
| 26 DCHECK_GT(video_config_.max_frame_rate, 0); |
| 27 } |
| 26 | 28 |
| 27 FakeSoftwareVideoEncoder::~FakeSoftwareVideoEncoder() {} | 29 FakeSoftwareVideoEncoder::~FakeSoftwareVideoEncoder() {} |
| 28 | 30 |
| 29 void FakeSoftwareVideoEncoder::Initialize() {} | 31 void FakeSoftwareVideoEncoder::Initialize() {} |
| 30 | 32 |
| 31 void FakeSoftwareVideoEncoder::Encode( | 33 void FakeSoftwareVideoEncoder::Encode( |
| 32 const scoped_refptr<media::VideoFrame>& video_frame, | 34 const scoped_refptr<media::VideoFrame>& video_frame, |
| 33 const base::TimeTicks& reference_time, | 35 const base::TimeTicks& reference_time, |
| 34 SenderEncodedFrame* encoded_frame) { | 36 SenderEncodedFrame* encoded_frame) { |
| 35 DCHECK(encoded_frame); | 37 DCHECK(encoded_frame); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 78 } |
| 77 | 79 |
| 78 void FakeSoftwareVideoEncoder::GenerateKeyFrame() { | 80 void FakeSoftwareVideoEncoder::GenerateKeyFrame() { |
| 79 next_frame_is_key_ = true; | 81 next_frame_is_key_ = true; |
| 80 } | 82 } |
| 81 | 83 |
| 82 } // namespace cast | 84 } // namespace cast |
| 83 } // namespace media | 85 } // namespace media |
| 84 | 86 |
| 85 #endif | 87 #endif |
| OLD | NEW |