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

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc

Issue 2440113002: Make WebRTC compatible with OpenH264 v1.6. (Closed)
Patch Set: Changed from SM_SIZELIMITED_SLICE to SM_FIXEDSLCNUM_SLICE Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 3dfa0b559d1228725ae8820bbb0f2aecd551b410..56b88b1276d3059d332dd8047056a78c0d66c9a0 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -16,6 +16,7 @@
#include "third_party/openh264/src/codec/api/svc/codec_api.h"
#include "third_party/openh264/src/codec/api/svc/codec_app_def.h"
#include "third_party/openh264/src/codec/api/svc/codec_def.h"
+#include "third_party/openh264/src/codec/api/svc/codec_ver.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
@@ -149,6 +150,7 @@ static void RtpFragmentize(EncodedImage* encoded_image,
H264EncoderImpl::H264EncoderImpl()
: openh264_encoder_(nullptr),
+ number_of_cores_(0),
encoded_image_callback_(nullptr),
has_reported_init_(false),
has_reported_error_(false) {
@@ -439,7 +441,12 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams() const {
encoder_params.sSpatialLayers[0].iMaxSpatialBitrate =
encoder_params.iMaxBitrate;
// Slice num according to number of threads.
+#if (OPENH264_MAJOR == 1) && (OPENH264_MINOR <= 5)
encoder_params.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_AUTO_SLICE;
+#else
+ encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceMode =
+ SM_FIXEDSLCNUM_SLICE;
stefan-webrtc 2016/10/24 10:42:02 Maybe comment on what this means? Reading the head
sprang_webrtc 2016/10/24 11:28:19 Comment above still says "// Slice num according t
hbos_chromium 2016/10/24 14:10:37 According to the link, SM_FIXEDSLCNUM_SLICE sets i
+#endif
return encoder_params;
}
« 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