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

Side by Side Diff: talk/app/webrtc/androidvideocapturer.cc

Issue 1493913007: VideoCapturerAndroid, handle cvo correctly (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fixed tests. Cleaned up Created 5 years 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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 cricket::VideoFrame* CreateAliasedFrame( 98 cricket::VideoFrame* CreateAliasedFrame(
99 const cricket::CapturedFrame* input_frame, 99 const cricket::CapturedFrame* input_frame,
100 int cropped_input_width, 100 int cropped_input_width,
101 int cropped_input_height, 101 int cropped_input_height,
102 int output_width, 102 int output_width,
103 int output_height) const override { 103 int output_height) const override {
104 if (buffer_->native_handle() != nullptr) { 104 if (buffer_->native_handle() != nullptr) {
105 rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer( 105 rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer(
106 static_cast<webrtc_jni::AndroidTextureBuffer*>(buffer_.get()) 106 static_cast<webrtc_jni::AndroidTextureBuffer*>(buffer_.get())
107 ->CropAndScale(cropped_input_width, cropped_input_height, 107 ->CropScaleAndRotate(cropped_input_width, cropped_input_height,
108 output_width, output_height)); 108 output_width, output_height,
109 apply_rotation_ ? input_frame->rotation :
110 webrtc::kVideoRotation_0));
109 return new cricket::WebRtcVideoFrame( 111 return new cricket::WebRtcVideoFrame(
110 scaled_buffer, input_frame->time_stamp, input_frame->rotation); 112 scaled_buffer, input_frame->time_stamp,
113 apply_rotation_ ? webrtc::kVideoRotation_0 : input_frame->rotation);
111 } 114 }
112 return VideoFrameFactory::CreateAliasedFrame(input_frame, 115 return VideoFrameFactory::CreateAliasedFrame(input_frame,
113 cropped_input_width, 116 cropped_input_width,
114 cropped_input_height, 117 cropped_input_height,
115 output_width, 118 output_width,
116 output_height); 119 output_height);
117 } 120 }
118 121
119 private: 122 private:
120 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer_; 123 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer_;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 239
237 bool AndroidVideoCapturer::GetBestCaptureFormat( 240 bool AndroidVideoCapturer::GetBestCaptureFormat(
238 const cricket::VideoFormat& desired, 241 const cricket::VideoFormat& desired,
239 cricket::VideoFormat* best_format) { 242 cricket::VideoFormat* best_format) {
240 // Delegate this choice to VideoCapturerAndroid.startCapture(). 243 // Delegate this choice to VideoCapturerAndroid.startCapture().
241 *best_format = desired; 244 *best_format = desired;
242 return true; 245 return true;
243 } 246 }
244 247
245 } // namespace webrtc 248 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698