| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 int32_t ReleaseOnCodecThread(); | 105 int32_t ReleaseOnCodecThread(); |
| 106 int32_t DecodeOnCodecThread(const EncodedImage& inputImage); | 106 int32_t DecodeOnCodecThread(const EncodedImage& inputImage); |
| 107 // Deliver any outputs pending in the MediaCodec to our |callback_| and return | 107 // Deliver any outputs pending in the MediaCodec to our |callback_| and return |
| 108 // true on success. | 108 // true on success. |
| 109 bool DeliverPendingOutputs(JNIEnv* jni, int dequeue_timeout_us); | 109 bool DeliverPendingOutputs(JNIEnv* jni, int dequeue_timeout_us); |
| 110 int32_t ProcessHWErrorOnCodecThread(); | 110 int32_t ProcessHWErrorOnCodecThread(); |
| 111 | 111 |
| 112 // Type of video codec. | 112 // Type of video codec. |
| 113 VideoCodecType codecType_; | 113 VideoCodecType codecType_; |
| 114 | 114 |
| 115 // Render EGL context - owned by factory, should not be allocated/destroyed |
| 116 // by VideoDecoder. |
| 117 jobject render_egl_context_; |
| 118 |
| 115 bool key_frame_required_; | 119 bool key_frame_required_; |
| 116 bool inited_; | 120 bool inited_; |
| 117 bool sw_fallback_required_; | 121 bool sw_fallback_required_; |
| 118 bool use_surface_; | 122 bool use_surface_; |
| 119 VideoCodec codec_; | 123 VideoCodec codec_; |
| 120 webrtc::I420BufferPool decoded_frame_pool_; | 124 webrtc::I420BufferPool decoded_frame_pool_; |
| 121 rtc::scoped_refptr<SurfaceTextureHelper> surface_texture_helper_; | 125 rtc::scoped_refptr<SurfaceTextureHelper> surface_texture_helper_; |
| 122 DecodedImageCallback* callback_; | 126 DecodedImageCallback* callback_; |
| 123 int frames_received_; // Number of frames received by decoder. | 127 int frames_received_; // Number of frames received by decoder. |
| 124 int frames_decoded_; // Number of frames decoded by decoder. | 128 int frames_decoded_; // Number of frames decoded by decoder. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // MediaCodecVideoDecoder.DecodedOutputBuffer fields. | 162 // MediaCodecVideoDecoder.DecodedOutputBuffer fields. |
| 159 jfieldID j_info_index_field_; | 163 jfieldID j_info_index_field_; |
| 160 jfieldID j_info_offset_field_; | 164 jfieldID j_info_offset_field_; |
| 161 jfieldID j_info_size_field_; | 165 jfieldID j_info_size_field_; |
| 162 jfieldID j_info_timestamp_ms_field_; | 166 jfieldID j_info_timestamp_ms_field_; |
| 163 jfieldID j_info_ntp_timestamp_ms_field_; | 167 jfieldID j_info_ntp_timestamp_ms_field_; |
| 164 jfieldID j_byte_buffer_decode_time_ms_field_; | 168 jfieldID j_byte_buffer_decode_time_ms_field_; |
| 165 | 169 |
| 166 // Global references; must be deleted in Release(). | 170 // Global references; must be deleted in Release(). |
| 167 std::vector<jobject> input_buffers_; | 171 std::vector<jobject> input_buffers_; |
| 168 | |
| 169 // Render EGL context - owned by factory, should not be allocated/destroyed | |
| 170 // by VideoDecoder. | |
| 171 jobject render_egl_context_; | |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 MediaCodecVideoDecoder::MediaCodecVideoDecoder( | 174 MediaCodecVideoDecoder::MediaCodecVideoDecoder( |
| 175 JNIEnv* jni, VideoCodecType codecType, jobject render_egl_context) : | 175 JNIEnv* jni, VideoCodecType codecType, jobject render_egl_context) : |
| 176 codecType_(codecType), | 176 codecType_(codecType), |
| 177 render_egl_context_(render_egl_context), | 177 render_egl_context_(render_egl_context), |
| 178 key_frame_required_(true), | 178 key_frame_required_(true), |
| 179 inited_(false), | 179 inited_(false), |
| 180 sw_fallback_required_(false), | 180 sw_fallback_required_(false), |
| 181 codec_thread_(new Thread()), | 181 codec_thread_(new Thread()), |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 ALOGD << "Destroy video decoder."; | 907 ALOGD << "Destroy video decoder."; |
| 908 delete decoder; | 908 delete decoder; |
| 909 } | 909 } |
| 910 | 910 |
| 911 const char* MediaCodecVideoDecoder::ImplementationName() const { | 911 const char* MediaCodecVideoDecoder::ImplementationName() const { |
| 912 return "MediaCodec"; | 912 return "MediaCodec"; |
| 913 } | 913 } |
| 914 | 914 |
| 915 } // namespace webrtc_jni | 915 } // namespace webrtc_jni |
| 916 | 916 |
| OLD | NEW |