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

Side by Side Diff: webrtc/sdk/android/src/jni/androidvideotracksource.cc

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Fix Mac CE Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 buffer_pool_.CreateBuffer(adapted_width, adapted_height); 92 buffer_pool_.CreateBuffer(adapted_width, adapted_height);
93 93
94 nv12toi420_scaler_.NV12ToI420Scale( 94 nv12toi420_scaler_.NV12ToI420Scale(
95 y_plane, width, uv_plane, uv_width * 2, crop_width, crop_height, 95 y_plane, width, uv_plane, uv_width * 2, crop_width, crop_height,
96 buffer->MutableDataY(), buffer->StrideY(), 96 buffer->MutableDataY(), buffer->StrideY(),
97 // Swap U and V, since we have NV21, not NV12. 97 // Swap U and V, since we have NV21, not NV12.
98 buffer->MutableDataV(), buffer->StrideV(), buffer->MutableDataU(), 98 buffer->MutableDataV(), buffer->StrideV(), buffer->MutableDataU(),
99 buffer->StrideU(), buffer->width(), buffer->height()); 99 buffer->StrideU(), buffer->width(), buffer->height());
100 100
101 OnFrame(VideoFrame(buffer, static_cast<webrtc::VideoRotation>(rotation), 101 OnFrame(VideoFrame(buffer, static_cast<webrtc::VideoRotation>(rotation),
102 webrtc::VideoContentType::kDefault,
102 translated_camera_time_us)); 103 translated_camera_time_us));
103 } 104 }
104 105
105 void AndroidVideoTrackSource::OnTextureFrameCaptured( 106 void AndroidVideoTrackSource::OnTextureFrameCaptured(
106 int width, 107 int width,
107 int height, 108 int height,
108 int rotation, 109 int rotation,
109 int64_t timestamp_ns, 110 int64_t timestamp_ns,
110 const webrtc_jni::NativeHandleImpl& handle) { 111 const webrtc_jni::NativeHandleImpl& handle) {
111 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread()); 112 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 149 }
149 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation)); 150 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation));
150 } 151 }
151 152
152 OnFrame(VideoFrame( 153 OnFrame(VideoFrame(
153 surface_texture_helper_->CreateTextureFrame( 154 surface_texture_helper_->CreateTextureFrame(
154 adapted_width, adapted_height, 155 adapted_width, adapted_height,
155 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)), 156 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)),
156 do_rotate ? webrtc::kVideoRotation_0 157 do_rotate ? webrtc::kVideoRotation_0
157 : static_cast<webrtc::VideoRotation>(rotation), 158 : static_cast<webrtc::VideoRotation>(rotation),
158 translated_camera_time_us)); 159 webrtc::VideoContentType::kDefault, translated_camera_time_us));
159 } 160 }
160 161
161 void AndroidVideoTrackSource::OnOutputFormatRequest(int width, 162 void AndroidVideoTrackSource::OnOutputFormatRequest(int width,
162 int height, 163 int height,
163 int fps) { 164 int fps) {
164 cricket::VideoFormat format(width, height, 165 cricket::VideoFormat format(width, height,
165 cricket::VideoFormat::FpsToInterval(fps), 0); 166 cricket::VideoFormat::FpsToInterval(fps), 0);
166 video_adapter()->OnOutputFormatRequest(format); 167 video_adapter()->OnOutputFormatRequest(format);
167 } 168 }
168 169
169 } // namespace webrtc 170 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698