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

Unified Diff: webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc

Issue 2484493002: Prepare iOS H264 HW encoder for High Profile (Closed)
Patch Set: Don't use default in switch 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc
diff --git a/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc b/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc
index 07725309bfd92273212773257dd71e8f736be35d..4bf7a4d5595503d8967ce2300b116611a9815c0c 100644
--- a/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc
+++ b/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.cc
@@ -10,6 +10,7 @@
#include "webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.h"
#include "webrtc/base/logging.h"
+#include "webrtc/common_video/h264/profile_level_id.h"
#include "webrtc/media/base/codec.h"
#if defined(WEBRTC_IOS)
#include "webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.h"
@@ -38,7 +39,19 @@ namespace webrtc {
VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory() {
// Hardware H264 encoding only supported on iOS for now.
#if defined(WEBRTC_IOS)
- supported_codecs_.push_back(cricket::VideoCodec(cricket::kH264CodecName));
+ // TODO(magjed): Push Constrained High profile as well when negotiation is
+ // ready, http://crbug/webrtc/6337.
+ cricket::VideoCodec constrained_baseline(cricket::kH264CodecName);
+ // TODO(magjed): Enumerate actual level instead of using hardcoded level 3.1.
+ // Level 3.1 is 1280x720@30fps which is enough for now.
+ const H264::ProfileLevelId constrained_baseline_profile(
+ H264::kProfileConstrainedBaseline, H264::kLevel3_1);
+ constrained_baseline.SetParam(
+ cricket::kH264FmtpProfileLevelId,
+ *H264::ProfileLevelIdToString(constrained_baseline_profile));
+ constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
+ constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1");
+ supported_codecs_.push_back(constrained_baseline);
#endif
}
@@ -49,7 +62,7 @@ VideoEncoder* VideoToolboxVideoEncoderFactory::CreateVideoEncoder(
#if defined(WEBRTC_IOS)
if (FindMatchingCodec(supported_codecs_, codec)) {
LOG(LS_INFO) << "Creating HW encoder for " << codec.name;
- return new H264VideoToolboxEncoder();
+ return new H264VideoToolboxEncoder(codec);
}
#endif
LOG(LS_INFO) << "No HW encoder found for codec " << codec.name;
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698