OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 15 matching lines...) Expand all Loading... |
26 */ | 26 */ |
27 | 27 |
28 package org.webrtc; | 28 package org.webrtc; |
29 | 29 |
30 import android.graphics.SurfaceTexture; | 30 import android.graphics.SurfaceTexture; |
31 import android.media.MediaCodec; | 31 import android.media.MediaCodec; |
32 import android.media.MediaCodecInfo; | 32 import android.media.MediaCodecInfo; |
33 import android.media.MediaCodecInfo.CodecCapabilities; | 33 import android.media.MediaCodecInfo.CodecCapabilities; |
34 import android.media.MediaCodecList; | 34 import android.media.MediaCodecList; |
35 import android.media.MediaFormat; | 35 import android.media.MediaFormat; |
36 import android.opengl.EGLContext; | |
37 import android.opengl.GLES11Ext; | 36 import android.opengl.GLES11Ext; |
38 import android.opengl.GLES20; | 37 import android.opengl.GLES20; |
39 import android.os.Build; | 38 import android.os.Build; |
40 import android.view.Surface; | 39 import android.view.Surface; |
41 | 40 |
42 import org.webrtc.Logging; | 41 import org.webrtc.Logging; |
43 | 42 |
44 import java.nio.ByteBuffer; | 43 import java.nio.ByteBuffer; |
45 import java.util.Arrays; | 44 import java.util.Arrays; |
46 import java.util.List; | 45 import java.util.List; |
47 | 46 |
| 47 import javax.microedition.khronos.egl.EGLContext; |
| 48 |
48 // Java-side of peerconnection_jni.cc:MediaCodecVideoDecoder. | 49 // Java-side of peerconnection_jni.cc:MediaCodecVideoDecoder. |
49 // This class is an implementation detail of the Java PeerConnection API. | 50 // This class is an implementation detail of the Java PeerConnection API. |
50 // MediaCodec is thread-hostile so this class must be operated on a single | 51 // MediaCodec is thread-hostile so this class must be operated on a single |
51 // thread. | 52 // thread. |
52 public class MediaCodecVideoDecoder { | 53 public class MediaCodecVideoDecoder { |
53 // This class is constructed, operated, and destroyed by its C++ incarnation, | 54 // This class is constructed, operated, and destroyed by its C++ incarnation, |
54 // so the class and its methods have non-public visibility. The API this | 55 // so the class and its methods have non-public visibility. The API this |
55 // class exposes aims to mimic the webrtc::VideoDecoder API as closely as | 56 // class exposes aims to mimic the webrtc::VideoDecoder API as closely as |
56 // possibly to minimize the amount of translation work necessary. | 57 // possibly to minimize the amount of translation work necessary. |
57 | 58 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // MediaCodec.CodecException upon codec error. | 409 // MediaCodec.CodecException upon codec error. |
409 private void returnDecodedByteBuffer(int index) | 410 private void returnDecodedByteBuffer(int index) |
410 throws IllegalStateException, MediaCodec.CodecException { | 411 throws IllegalStateException, MediaCodec.CodecException { |
411 checkOnMediaCodecThread(); | 412 checkOnMediaCodecThread(); |
412 if (useSurface) { | 413 if (useSurface) { |
413 throw new IllegalStateException("returnDecodedByteBuffer() called for surf
ace decoding."); | 414 throw new IllegalStateException("returnDecodedByteBuffer() called for surf
ace decoding."); |
414 } | 415 } |
415 mediaCodec.releaseOutputBuffer(index, false /* render */); | 416 mediaCodec.releaseOutputBuffer(index, false /* render */); |
416 } | 417 } |
417 } | 418 } |
OLD | NEW |