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

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

Issue 2982213002: Add support for capturers to capture VideoFrames. (Closed)
Patch Set: Minor changes Created 3 years, 4 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 jfloatArray j_transform_matrix, 62 jfloatArray j_transform_matrix,
63 jint j_rotation, 63 jint j_rotation,
64 jlong j_timestamp) { 64 jlong j_timestamp) {
65 webrtc::AndroidVideoTrackSource* source = 65 webrtc::AndroidVideoTrackSource* source =
66 AndroidVideoTrackSourceFromJavaProxy(j_source); 66 AndroidVideoTrackSourceFromJavaProxy(j_source);
67 source->OnTextureFrameCaptured( 67 source->OnTextureFrameCaptured(
68 j_width, j_height, jintToVideoRotation(j_rotation), j_timestamp, 68 j_width, j_height, jintToVideoRotation(j_rotation), j_timestamp,
69 NativeHandleImpl(jni, j_oes_texture_id, j_transform_matrix)); 69 NativeHandleImpl(jni, j_oes_texture_id, j_transform_matrix));
70 } 70 }
71 71
72 JOW_OBSERVER_METHOD(void, nativeOnFrameCaptured)
73 (JNIEnv* jni,
74 jclass,
75 jlong j_source,
76 jint j_width,
77 jint j_height,
78 jint j_rotation,
79 jlong j_timestamp_ns,
80 jobject j_video_frame_buffer) {
81 webrtc::AndroidVideoTrackSource* source =
82 AndroidVideoTrackSourceFromJavaProxy(j_source);
83 source->OnFrameCaptured(jni, j_width, j_height, j_timestamp_ns,
84 jintToVideoRotation(j_rotation),
85 j_video_frame_buffer);
86 }
87
72 JOW_OBSERVER_METHOD(void, nativeCapturerStarted) 88 JOW_OBSERVER_METHOD(void, nativeCapturerStarted)
73 (JNIEnv* jni, jclass, jlong j_source, jboolean j_success) { 89 (JNIEnv* jni, jclass, jlong j_source, jboolean j_success) {
74 LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted"; 90 LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
75 webrtc::AndroidVideoTrackSource* source = 91 webrtc::AndroidVideoTrackSource* source =
76 AndroidVideoTrackSourceFromJavaProxy(j_source); 92 AndroidVideoTrackSourceFromJavaProxy(j_source);
77 source->SetState(j_success 93 source->SetState(j_success
78 ? webrtc::AndroidVideoTrackSource::SourceState::kLive 94 ? webrtc::AndroidVideoTrackSource::SourceState::kLive
79 : webrtc::AndroidVideoTrackSource::SourceState::kEnded); 95 : webrtc::AndroidVideoTrackSource::SourceState::kEnded);
80 } 96 }
81 97
82 JOW_OBSERVER_METHOD(void, nativeCapturerStopped) 98 JOW_OBSERVER_METHOD(void, nativeCapturerStopped)
83 (JNIEnv* jni, jclass, jlong j_source) { 99 (JNIEnv* jni, jclass, jlong j_source) {
84 LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped"; 100 LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped";
85 webrtc::AndroidVideoTrackSource* source = 101 webrtc::AndroidVideoTrackSource* source =
86 AndroidVideoTrackSourceFromJavaProxy(j_source); 102 AndroidVideoTrackSourceFromJavaProxy(j_source);
87 source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kEnded); 103 source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kEnded);
88 } 104 }
89 105
90 JOW(void, VideoSource_nativeAdaptOutputFormat) 106 JOW(void, VideoSource_nativeAdaptOutputFormat)
91 (JNIEnv* jni, jclass, jlong j_source, jint j_width, jint j_height, jint j_fps) { 107 (JNIEnv* jni, jclass, jlong j_source, jint j_width, jint j_height, jint j_fps) {
92 LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat"; 108 LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat";
93 webrtc::AndroidVideoTrackSource* source = 109 webrtc::AndroidVideoTrackSource* source =
94 AndroidVideoTrackSourceFromJavaProxy(j_source); 110 AndroidVideoTrackSourceFromJavaProxy(j_source);
95 source->OnOutputFormatRequest(j_width, j_height, j_fps); 111 source->OnOutputFormatRequest(j_width, j_height, j_fps);
96 } 112 }
97 113
98 } // namespace webrtc_jni 114 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/androidvideotracksource.cc ('k') | webrtc/sdk/android/src/jni/native_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698