Skip to content

Fix simulcast using hardware encoder on Android #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class HardwareVideoEncoder implements VideoEncoder {
private static final int MEDIA_CODEC_RELEASE_TIMEOUT_MS = 5000;
private static final int DEQUEUE_OUTPUT_BUFFER_TIMEOUT_US = 100000;

// Size of the input frames should be multiple of 16 for the H/W encoder.
private static final int REQUIRED_RESOLUTION_ALIGNMENT = 16;
// Size of the input frames should be multiple of 2 for the H/W encoder.
private static final int REQUIRED_RESOLUTION_ALIGNMENT = 2;

/**
* Keeps track of the number of output buffers that have been passed down the pipeline and not yet
Expand Down Expand Up @@ -213,7 +213,7 @@ public VideoCodecStatus initEncode(Settings settings, Callback callback) {

if (settings.width % REQUIRED_RESOLUTION_ALIGNMENT != 0
|| settings.height % REQUIRED_RESOLUTION_ALIGNMENT != 0) {
Logging.e(TAG, "MediaCodec is only tested with resolutions that are 16x16 aligned.");
Logging.e(TAG, "MediaCodec requires 2x2 alignment.");
return VideoCodecStatus.ERR_SIZE;
}
this.width = settings.width;
Expand Down Expand Up @@ -530,7 +530,7 @@ private VideoCodecStatus resetCodec(int newWidth, int newHeight, boolean newUseS

if (newWidth % REQUIRED_RESOLUTION_ALIGNMENT != 0
|| newHeight % REQUIRED_RESOLUTION_ALIGNMENT != 0) {
Logging.e(TAG, "MediaCodec is only tested with resolutions that are 16x16 aligned.");
Logging.e(TAG, "MediaCodec requires 2x2 alignment.");
return VideoCodecStatus.ERR_SIZE;
}
width = newWidth;
Expand Down