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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 start_time_ms_ = GetCurrentTimeMs(); | 647 start_time_ms_ = GetCurrentTimeMs(); |
648 current_frames_ = 0; | 648 current_frames_ = 0; |
649 current_bytes_ = 0; | 649 current_bytes_ = 0; |
650 current_decoding_time_ms_ = 0; | 650 current_decoding_time_ms_ = 0; |
651 } | 651 } |
652 | 652 |
653 // Callback - output decoded frame. | 653 // Callback - output decoded frame. |
654 int32_t callback_status = WEBRTC_VIDEO_CODEC_OK; | 654 int32_t callback_status = WEBRTC_VIDEO_CODEC_OK; |
655 if (use_surface_) { | 655 if (use_surface_) { |
656 native_handle_.SetTextureObject(surface_texture_, texture_id); | 656 native_handle_.SetTextureObject(surface_texture_, texture_id); |
657 VideoFrame texture_image(&native_handle_, width, height, output_timestamp_, | 657 VideoFrame texture_image(new rtc::RefCountedObject<JniNativeHandleBuffer>( |
658 0, webrtc::kVideoRotation_0, | 658 &native_handle_, width, height), |
659 rtc::Callback0<void>()); | 659 output_timestamp_, 0, webrtc::kVideoRotation_0); |
660 texture_image.set_ntp_time_ms(output_ntp_time_ms_); | 660 texture_image.set_ntp_time_ms(output_ntp_time_ms_); |
661 callback_status = callback_->Decoded(texture_image); | 661 callback_status = callback_->Decoded(texture_image); |
662 } else { | 662 } else { |
663 decoded_image_.set_timestamp(output_timestamp_); | 663 decoded_image_.set_timestamp(output_timestamp_); |
664 decoded_image_.set_ntp_time_ms(output_ntp_time_ms_); | 664 decoded_image_.set_ntp_time_ms(output_ntp_time_ms_); |
665 callback_status = callback_->Decoded(decoded_image_); | 665 callback_status = callback_->Decoded(decoded_image_); |
666 } | 666 } |
667 if (callback_status > 0) { | 667 if (callback_status > 0) { |
668 ALOGE("callback error"); | 668 ALOGE("callback error"); |
669 } | 669 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 return NULL; | 771 return NULL; |
772 } | 772 } |
773 | 773 |
774 void MediaCodecVideoDecoderFactory::DestroyVideoDecoder( | 774 void MediaCodecVideoDecoderFactory::DestroyVideoDecoder( |
775 webrtc::VideoDecoder* decoder) { | 775 webrtc::VideoDecoder* decoder) { |
776 delete decoder; | 776 delete decoder; |
777 } | 777 } |
778 | 778 |
779 } // namespace webrtc_jni | 779 } // namespace webrtc_jni |
780 | 780 |
OLD | NEW |