xref: /aosp_15_r20/external/webrtc/sdk/android/src/jni/native_capturer_observer.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include "sdk/android/src/jni/native_capturer_observer.h"
12 
13 #include "rtc_base/logging.h"
14 #include "sdk/android/generated_video_jni/NativeCapturerObserver_jni.h"
15 #include "sdk/android/native_api/jni/java_types.h"
16 #include "sdk/android/src/jni/android_video_track_source.h"
17 
18 namespace webrtc {
19 namespace jni {
20 
CreateJavaNativeCapturerObserver(JNIEnv * env,rtc::scoped_refptr<AndroidVideoTrackSource> native_source)21 ScopedJavaLocalRef<jobject> CreateJavaNativeCapturerObserver(
22     JNIEnv* env,
23     rtc::scoped_refptr<AndroidVideoTrackSource> native_source) {
24   return Java_NativeCapturerObserver_Constructor(
25       env, NativeToJavaPointer(native_source.release()));
26 }
27 
28 }  // namespace jni
29 }  // namespace webrtc
30