Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: remoting/protocol/webrtc_dummy_video_encoder.cc

Issue 2837583004: [Remoting Host] Add more codec spec information for VP9 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 codec_specific_info.codecSpecific.VP8.simulcastIdx = 0;
132 codec_specific_info.codecSpecific.VP8.temporalIdx = webrtc::kNoTemporalIdx; 132 codec_specific_info.codecSpecific.VP8.temporalIdx = webrtc::kNoTemporalIdx;
133 codec_specific_info.codecSpecific.VP8.tl0PicIdx = webrtc::kNoTl0PicIdx; 133 codec_specific_info.codecSpecific.VP8.tl0PicIdx = webrtc::kNoTl0PicIdx;
134 codec_specific_info.codecSpecific.VP8.pictureId = webrtc::kNoPictureId; 134 codec_specific_info.codecSpecific.VP8.pictureId = webrtc::kNoPictureId;
135 } else if (codec_type_ == webrtc::kVideoCodecVP9) { 135 } else if (codec_type_ == webrtc::kVideoCodecVP9) {
136 codec_specific_info.codecSpecific.generic.simulcast_idx = 0; 136 webrtc::CodecSpecificInfoVP9* vp9_info =
Sergey Ulanov 2017/04/24 17:11:35 maybe add vp8_info for VP8 above, for consistency.
Yuwei 2017/04/24 19:13:27 Done.
137 codec_specific_info.codecSpecific.VP9.gof_idx = webrtc::kNoGofIdx; 137 &codec_specific_info.codecSpecific.VP9;
138 codec_specific_info.codecSpecific.VP9.temporal_idx = webrtc::kNoTemporalIdx; 138 vp9_info->inter_pic_predicted = !frame.key_frame;
139 codec_specific_info.codecSpecific.VP9.spatial_idx = webrtc::kNoSpatialIdx; 139 vp9_info->ss_data_available = frame.key_frame;
140 codec_specific_info.codecSpecific.VP9.tl0_pic_idx = webrtc::kNoTl0PicIdx; 140 vp9_info->spatial_layer_resolution_present = frame.key_frame;
141 codec_specific_info.codecSpecific.VP9.picture_id = webrtc::kNoPictureId; 141 if (frame.key_frame) {
142 vp9_info->width[0] = frame.size.width();
143 vp9_info->height[0] = frame.size.height();
144 }
145 vp9_info->num_spatial_layers = 1;
146 vp9_info->gof_idx = webrtc::kNoGofIdx;
147 vp9_info->temporal_idx = webrtc::kNoTemporalIdx;
148 vp9_info->spatial_idx = webrtc::kNoSpatialIdx;
149 vp9_info->tl0_pic_idx = webrtc::kNoTl0PicIdx;
150 vp9_info->picture_id = webrtc::kNoPictureId;
142 } else { 151 } else {
143 NOTREACHED(); 152 NOTREACHED();
144 } 153 }
145 154
146 webrtc::RTPFragmentationHeader header; 155 webrtc::RTPFragmentationHeader header;
147 memset(&header, 0, sizeof(header)); 156 memset(&header, 0, sizeof(header));
148 157
149 header.VerifyAndAllocateFragmentationHeader(1); 158 header.VerifyAndAllocateFragmentationHeader(1);
150 header.fragmentationOffset[0] = 0; 159 header.fragmentationOffset[0] = 0;
151 header.fragmentationLength[0] = buffer_size; 160 header.fragmentationLength[0] = buffer_size;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void WebrtcDummyVideoEncoderFactory::SetVideoChannelStateObserver( 241 void WebrtcDummyVideoEncoderFactory::SetVideoChannelStateObserver(
233 base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer) { 242 base::WeakPtr<VideoChannelStateObserver> video_channel_state_observer) {
234 DCHECK(main_task_runner_->BelongsToCurrentThread()); 243 DCHECK(main_task_runner_->BelongsToCurrentThread());
235 DCHECK(encoders_.empty()); 244 DCHECK(encoders_.empty());
236 base::AutoLock lock(lock_); 245 base::AutoLock lock(lock_);
237 video_channel_state_observer_ = video_channel_state_observer; 246 video_channel_state_observer_ = video_channel_state_observer;
238 } 247 }
239 248
240 } // namespace protocol 249 } // namespace protocol
241 } // namespace remoting 250 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698