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

Unified Diff: webrtc/api/android/jni/androidmediaencoder_jni.cc

Issue 2497163002: Android HW encoder: Set constrained baseline as the profile (Closed)
Patch Set: Fix compile failures. 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/jni/androidmediaencoder_jni.cc
diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.cc b/webrtc/api/android/jni/androidmediaencoder_jni.cc
index 680ee4e694ebea2b87c13deecc1d7cf640b88ab2..f6d15b74495d25b13fd331ac2870d459e07e8e9c 100644
--- a/webrtc/api/android/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/android/jni/androidmediaencoder_jni.cc
@@ -30,6 +30,7 @@
#include "webrtc/base/timeutils.h"
#include "webrtc/common_types.h"
#include "webrtc/common_video/h264/h264_bitstream_parser.h"
+#include "webrtc/common_video/h264/profile_level_id.h"
#include "webrtc/media/engine/internalencoderfactory.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
@@ -1334,7 +1335,21 @@ MediaCodecVideoEncoderFactory::MediaCodecVideoEncoderFactory()
CHECK_EXCEPTION(jni);
if (is_h264_hw_supported) {
ALOGD << "H.264 HW Encoder supported.";
- supported_codecs_.push_back(cricket::VideoCodec("H264"));
+ // TODO(magjed): Push Constrained High profile as well when negotiation is
+ // ready, http://crbug/webrtc/6337. We can negotiate Constrained High
+ // profile as long as we have decode support for it and still send Baseline
+ // since Baseline is a subset of the High profile.
+ 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 webrtc::H264::ProfileLevelId constrained_baseline_profile(
+ webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1);
+ constrained_baseline.SetParam(
+ cricket::kH264FmtpProfileLevelId,
+ *webrtc::H264::ProfileLevelIdToString(constrained_baseline_profile));
+ constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
+ constrained_baseline.SetParam(cricket::kH264FmtpPacketizationMode, "1");
+ supported_codecs_.push_back(constrained_baseline);
}
}
« 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