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

Side by Side Diff: talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoEncoder.java

Issue 1460703002: Implement AndroidTextureBuffer::NativeToI420. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed Magnus' comments. Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 mediaCodec = createByCodecName(properties.codecName); 316 mediaCodec = createByCodecName(properties.codecName);
317 this.type = type; 317 this.type = type;
318 if (mediaCodec == null) { 318 if (mediaCodec == null) {
319 Logging.e(TAG, "Can not create media encoder"); 319 Logging.e(TAG, "Can not create media encoder");
320 return false; 320 return false;
321 } 321 }
322 mediaCodec.configure( 322 mediaCodec.configure(
323 format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); 323 format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
324 324
325 if (useSurface) { 325 if (useSurface) {
326 eglBase = new EglBase(sharedContext, EglBase.ConfigType.RECORDABLE); 326 eglBase = new EglBase(sharedContext, EglBase.CONFIG_RECORDABLE);
327 // Create an input surface and keep a reference since we must release th e surface when done. 327 // Create an input surface and keep a reference since we must release th e surface when done.
328 inputSurface = mediaCodec.createInputSurface(); 328 inputSurface = mediaCodec.createInputSurface();
329 eglBase.createSurface(inputSurface); 329 eglBase.createSurface(inputSurface);
330 drawer = new GlRectDrawer(); 330 drawer = new GlRectDrawer();
331 } 331 }
332 mediaCodec.start(); 332 mediaCodec.start();
333 outputBuffers = mediaCodec.getOutputBuffers(); 333 outputBuffers = mediaCodec.getOutputBuffers();
334 Logging.d(TAG, "Output buffers: " + outputBuffers.length); 334 Logging.d(TAG, "Output buffers: " + outputBuffers.length);
335 335
336 } catch (IllegalStateException e) { 336 } catch (IllegalStateException e) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 checkOnMediaCodecThread(); 565 checkOnMediaCodecThread();
566 try { 566 try {
567 mediaCodec.releaseOutputBuffer(index, false); 567 mediaCodec.releaseOutputBuffer(index, false);
568 return true; 568 return true;
569 } catch (IllegalStateException e) { 569 } catch (IllegalStateException e) {
570 Logging.e(TAG, "releaseOutputBuffer failed", e); 570 Logging.e(TAG, "releaseOutputBuffer failed", e);
571 return false; 571 return false;
572 } 572 }
573 } 573 }
574 } 574 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698