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

Side by Side Diff: content/renderer/media/video_track_recorder.cc

Issue 2440143002: Roll OpenH264 from v1.4.1 to v1.6.0 (Closed)
Patch Set: Use medium complexity setting Created 4 years, 1 month 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 | « DEPS ('k') | third_party/openh264/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/video_track_recorder.h" 5 #include "content/renderer/media/video_track_recorder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 init_params.iRCMode = RC_BITRATE_MODE; 1016 init_params.iRCMode = RC_BITRATE_MODE;
1017 init_params.iTargetBitrate = bits_per_second_; 1017 init_params.iTargetBitrate = bits_per_second_;
1018 } else { 1018 } else {
1019 init_params.iRCMode = RC_OFF_MODE; 1019 init_params.iRCMode = RC_OFF_MODE;
1020 } 1020 }
1021 1021
1022 // Threading model: Set to 1 due to https://crbug.com/583348. 1022 // Threading model: Set to 1 due to https://crbug.com/583348.
1023 init_params.iMultipleThreadIdc = 1; 1023 init_params.iMultipleThreadIdc = 1;
1024 1024
1025 // TODO(mcasas): consider reducing complexity if there are few CPUs available. 1025 // TODO(mcasas): consider reducing complexity if there are few CPUs available.
1026 DCHECK_EQ(MEDIUM_COMPLEXITY, init_params.iComplexityMode); 1026 init_params.iComplexityMode = MEDIUM_COMPLEXITY;
1027 DCHECK(!init_params.bEnableDenoise); 1027 DCHECK(!init_params.bEnableDenoise);
1028 DCHECK(init_params.bEnableFrameSkip); 1028 DCHECK(init_params.bEnableFrameSkip);
1029 1029
1030 // The base spatial layer 0 is the only one we use. 1030 // The base spatial layer 0 is the only one we use.
1031 DCHECK_EQ(1, init_params.iSpatialLayerNum); 1031 DCHECK_EQ(1, init_params.iSpatialLayerNum);
1032 init_params.sSpatialLayers[0].iVideoWidth = init_params.iPicWidth; 1032 init_params.sSpatialLayers[0].iVideoWidth = init_params.iPicWidth;
1033 init_params.sSpatialLayers[0].iVideoHeight = init_params.iPicHeight; 1033 init_params.sSpatialLayers[0].iVideoHeight = init_params.iPicHeight;
1034 init_params.sSpatialLayers[0].iSpatialBitrate = init_params.iTargetBitrate; 1034 init_params.sSpatialLayers[0].iSpatialBitrate = init_params.iTargetBitrate;
1035 // Slice num according to number of threads. 1035
1036 init_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE; 1036 // When uiSliceMode = SM_FIXEDSLCNUM_SLICE, uiSliceNum = 0 means auto design
1037 // it with cpu core number.
1038 init_params.sSpatialLayers[0].sSliceArgument.uiSliceNum = 0;
1039 init_params.sSpatialLayers[0].sSliceArgument.uiSliceMode =
1040 SM_FIXEDSLCNUM_SLICE;
1037 1041
1038 if (openh264_encoder_->InitializeExt(&init_params) != cmResultSuccess) { 1042 if (openh264_encoder_->InitializeExt(&init_params) != cmResultSuccess) {
1039 NOTREACHED() << "Failed to initialize OpenH264 encoder"; 1043 NOTREACHED() << "Failed to initialize OpenH264 encoder";
1040 return; 1044 return;
1041 } 1045 }
1042 1046
1043 int pixel_format = EVideoFormatType::videoFormatI420; 1047 int pixel_format = EVideoFormatType::videoFormatI420;
1044 openh264_encoder_->SetOption(ENCODER_OPTION_DATAFORMAT, &pixel_format); 1048 openh264_encoder_->SetOption(ENCODER_OPTION_DATAFORMAT, &pixel_format);
1045 } 1049 }
1046 #endif //#if BUILDFLAG(RTC_USE_H264) 1050 #endif //#if BUILDFLAG(RTC_USE_H264)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 encoder_->SetPaused(paused_before_init_); 1147 encoder_->SetPaused(paused_before_init_);
1144 1148
1145 // StartFrameEncode() will be called on Render IO thread. 1149 // StartFrameEncode() will be called on Render IO thread.
1146 MediaStreamVideoSink::ConnectToTrack( 1150 MediaStreamVideoSink::ConnectToTrack(
1147 track_, 1151 track_,
1148 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_), 1152 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_),
1149 false); 1153 false);
1150 } 1154 }
1151 1155
1152 } // namespace content 1156 } // namespace content
OLDNEW
« no previous file with comments | « DEPS ('k') | third_party/openh264/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698