OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |