Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: talk/app/webrtc/java/jni/androidmediadecoder_jni.cc

Issue 1158273010: Re-land "Convert native handles to buffers before encoding." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/native_handle_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/native_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698