| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const EncodedImage& inputImage, bool missingFrames, | 93 const EncodedImage& inputImage, bool missingFrames, |
| 94 const RTPFragmentationHeader* fragmentation, | 94 const RTPFragmentationHeader* fragmentation, |
| 95 const CodecSpecificInfo* codecSpecificInfo = NULL, | 95 const CodecSpecificInfo* codecSpecificInfo = NULL, |
| 96 int64_t renderTimeMs = -1) override; | 96 int64_t renderTimeMs = -1) override; |
| 97 | 97 |
| 98 int32_t RegisterDecodeCompleteCallback(DecodedImageCallback* callback) | 98 int32_t RegisterDecodeCompleteCallback(DecodedImageCallback* callback) |
| 99 override; | 99 override; |
| 100 | 100 |
| 101 int32_t Release() override; | 101 int32_t Release() override; |
| 102 | 102 |
| 103 int32_t Reset() override; | |
| 104 | |
| 105 bool PrefersLateDecoding() const override { return true; } | 103 bool PrefersLateDecoding() const override { return true; } |
| 106 | 104 |
| 107 // rtc::MessageHandler implementation. | 105 // rtc::MessageHandler implementation. |
| 108 void OnMessage(rtc::Message* msg) override; | 106 void OnMessage(rtc::Message* msg) override; |
| 109 | 107 |
| 110 const char* ImplementationName() const override; | 108 const char* ImplementationName() const override; |
| 111 | 109 |
| 112 private: | 110 private: |
| 113 // CHECK-fail if not running on |codec_thread_|. | 111 // CHECK-fail if not running on |codec_thread_|. |
| 114 void CheckOnCodecThread(); | 112 void CheckOnCodecThread(); |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 } | 796 } |
| 799 return true; | 797 return true; |
| 800 } | 798 } |
| 801 | 799 |
| 802 int32_t MediaCodecVideoDecoder::RegisterDecodeCompleteCallback( | 800 int32_t MediaCodecVideoDecoder::RegisterDecodeCompleteCallback( |
| 803 DecodedImageCallback* callback) { | 801 DecodedImageCallback* callback) { |
| 804 callback_ = callback; | 802 callback_ = callback; |
| 805 return WEBRTC_VIDEO_CODEC_OK; | 803 return WEBRTC_VIDEO_CODEC_OK; |
| 806 } | 804 } |
| 807 | 805 |
| 808 int32_t MediaCodecVideoDecoder::Reset() { | |
| 809 ALOGD << "DecoderReset"; | |
| 810 if (!inited_) { | |
| 811 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | |
| 812 } | |
| 813 return InitDecode(&codec_, 1); | |
| 814 } | |
| 815 | |
| 816 void MediaCodecVideoDecoder::OnMessage(rtc::Message* msg) { | 806 void MediaCodecVideoDecoder::OnMessage(rtc::Message* msg) { |
| 817 JNIEnv* jni = AttachCurrentThreadIfNeeded(); | 807 JNIEnv* jni = AttachCurrentThreadIfNeeded(); |
| 818 ScopedLocalRefFrame local_ref_frame(jni); | 808 ScopedLocalRefFrame local_ref_frame(jni); |
| 819 if (!inited_) { | 809 if (!inited_) { |
| 820 return; | 810 return; |
| 821 } | 811 } |
| 822 // We only ever send one message to |this| directly (not through a Bind()'d | 812 // We only ever send one message to |this| directly (not through a Bind()'d |
| 823 // functor), so expect no ID/data. | 813 // functor), so expect no ID/data. |
| 824 RTC_CHECK(!msg->message_id) << "Unexpected message!"; | 814 RTC_CHECK(!msg->message_id) << "Unexpected message!"; |
| 825 RTC_CHECK(!msg->pdata) << "Unexpected message!"; | 815 RTC_CHECK(!msg->pdata) << "Unexpected message!"; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 ALOGD << "Destroy video decoder."; | 898 ALOGD << "Destroy video decoder."; |
| 909 delete decoder; | 899 delete decoder; |
| 910 } | 900 } |
| 911 | 901 |
| 912 const char* MediaCodecVideoDecoder::ImplementationName() const { | 902 const char* MediaCodecVideoDecoder::ImplementationName() const { |
| 913 return "MediaCodec"; | 903 return "MediaCodec"; |
| 914 } | 904 } |
| 915 | 905 |
| 916 } // namespace webrtc_jni | 906 } // namespace webrtc_jni |
| 917 | 907 |
| OLD | NEW |