OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "remoting/protocol/webrtc_dummy_video_encoder.h" | 5 #include "remoting/protocol/webrtc_dummy_video_encoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 encoded_image.capture_time_ms_ = capture_time_ms; | 121 encoded_image.capture_time_ms_ = capture_time_ms; |
122 encoded_image._timeStamp = static_cast<uint32_t>(capture_time_ms * 90); | 122 encoded_image._timeStamp = static_cast<uint32_t>(capture_time_ms * 90); |
123 encoded_image.playout_delay_.min_ms = 0; | 123 encoded_image.playout_delay_.min_ms = 0; |
124 encoded_image.playout_delay_.max_ms = 0; | 124 encoded_image.playout_delay_.max_ms = 0; |
125 | 125 |
126 webrtc::CodecSpecificInfo codec_specific_info; | 126 webrtc::CodecSpecificInfo codec_specific_info; |
127 memset(&codec_specific_info, 0, sizeof(codec_specific_info)); | 127 memset(&codec_specific_info, 0, sizeof(codec_specific_info)); |
128 codec_specific_info.codecType = codec_type_; | 128 codec_specific_info.codecType = codec_type_; |
129 | 129 |
130 if (codec_type_ == webrtc::kVideoCodecVP8) { | 130 if (codec_type_ == webrtc::kVideoCodecVP8) { |
131 codec_specific_info.codecSpecific.VP8.simulcastIdx = 0; | 131 webrtc::CodecSpecificInfoVP8* vp8_info = |
132 codec_specific_info.codecSpecific.VP8.temporalIdx = webrtc::kNoTemporalIdx; | 132 &codec_specific_info.codecSpecific.VP8; |
133 codec_specific_info.codecSpecific.VP8.tl0PicIdx = webrtc::kNoTl0PicIdx; | 133 vp8_info->simulcastIdx = 0; |
134 codec_specific_info.codecSpecific.VP8.pictureId = webrtc::kNoPictureId; | 134 vp8_info->temporalIdx = webrtc::kNoTemporalIdx; |
| 135 vp8_info->tl0PicIdx = webrtc::kNoTl0PicIdx; |
| 136 vp8_info->pictureId = webrtc::kNoPictureId; |
135 } else if (codec_type_ == webrtc::kVideoCodecVP9) { | 137 } else if (codec_type_ == webrtc::kVideoCodecVP9) { |
136 codec_specific_info.codecSpecific.generic.simulcast_idx = 0; | 138 webrtc::CodecSpecificInfoVP9* vp9_info = |
137 codec_specific_info.codecSpecific.VP9.gof_idx = webrtc::kNoGofIdx; | 139 &codec_specific_info.codecSpecific.VP9; |
138 codec_specific_info.codecSpecific.VP9.temporal_idx = webrtc::kNoTemporalIdx; | 140 vp9_info->inter_pic_predicted = !frame.key_frame; |
139 codec_specific_info.codecSpecific.VP9.spatial_idx = webrtc::kNoSpatialIdx; | 141 vp9_info->ss_data_available = frame.key_frame; |
140 codec_specific_info.codecSpecific.VP9.tl0_pic_idx = webrtc::kNoTl0PicIdx; | 142 vp9_info->spatial_layer_resolution_present = frame.key_frame; |
141 codec_specific_info.codecSpecific.VP9.picture_id = webrtc::kNoPictureId; | 143 if (frame.key_frame) { |
| 144 vp9_info->width[0] = frame.size.width(); |
| 145 vp9_info->height[0] = frame.size.height(); |
| 146 } |
| 147 vp9_info->num_spatial_layers = 1; |
| 148 vp9_info->gof_idx = webrtc::kNoGofIdx; |
| 149 vp9_info->temporal_idx = webrtc::kNoTemporalIdx; |
| 150 vp9_info->spatial_idx = webrtc::kNoSpatialIdx; |
| 151 vp9_info->tl0_pic_idx = webrtc::kNoTl0PicIdx; |
| 152 vp9_info->picture_id = webrtc::kNoPictureId; |
142 } else { | 153 } else { |
143 NOTREACHED(); | 154 NOTREACHED(); |
144 } | 155 } |
145 | 156 |
146 webrtc::RTPFragmentationHeader header; | 157 webrtc::RTPFragmentationHeader header; |
147 memset(&header, 0, sizeof(header)); | 158 memset(&header, 0, sizeof(header)); |
148 | 159 |
149 header.VerifyAndAllocateFragmentationHeader(1); | 160 header.VerifyAndAllocateFragmentationHeader(1); |
150 header.fragmentationOffset[0] = 0; | 161 header.fragmentationOffset[0] = 0; |
151 header.fragmentationLength[0] = buffer_size; | 162 header.fragmentationLength[0] = buffer_size; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 void WebrtcDummyVideoEncoderFactory::SetVideoChannelStateObserver( | 243 void WebrtcDummyVideoEncoderFactory::SetVideoChannelStateObserver( |
233 base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer) { | 244 base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer) { |
234 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 245 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
235 DCHECK(encoders_.empty()); | 246 DCHECK(encoders_.empty()); |
236 base::AutoLock lock(lock_); | 247 base::AutoLock lock(lock_); |
237 video_channel_state_observer_ = video_channel_state_observer; | 248 video_channel_state_observer_ = video_channel_state_observer; |
238 } | 249 } |
239 | 250 |
240 } // namespace protocol | 251 } // namespace protocol |
241 } // namespace remoting | 252 } // namespace remoting |
OLD | NEW |