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

Unified Diff: sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java

Issue 3013903002: Slice video frame buffers before copying data from them into the encoder's input buffer (Closed)
Patch Set: Created 3 years, 3 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: sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
diff --git a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
index f3be4cbc694ebeac96d04b07b0fdfce35dfabf05..4a0a4d993d147a7e0c5e2dc8afb0f0ca5014792a 100644
--- a/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
+++ b/sdk/android/src/java/org/webrtc/HardwareVideoEncoder.java
@@ -542,19 +542,19 @@ class HardwareVideoEncoder implements VideoEncoder {
I420 {
@Override
void fillBufferFromI420(ByteBuffer buffer, VideoFrame.I420Buffer i420) {
- buffer.put(i420.getDataY());
- buffer.put(i420.getDataU());
- buffer.put(i420.getDataV());
+ buffer.put(i420.getDataY().slice());
sakal 2017/09/28 07:43:53 Hmm, I think it is better to fix this at the Video
mellem 2017/09/28 17:02:39 Yes, I like that idea even better. I'll just aban
+ buffer.put(i420.getDataU().slice());
+ buffer.put(i420.getDataV().slice());
}
},
NV12 {
@Override
void fillBufferFromI420(ByteBuffer buffer, VideoFrame.I420Buffer i420) {
- buffer.put(i420.getDataY());
+ buffer.put(i420.getDataY().slice());
// Interleave the bytes from the U and V portions, starting with U.
- ByteBuffer u = i420.getDataU();
- ByteBuffer v = i420.getDataV();
+ ByteBuffer u = i420.getDataU().slice();
+ ByteBuffer v = i420.getDataV().slice();
int i = 0;
while (u.hasRemaining() && v.hasRemaining()) {
buffer.put(u.get());
« 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