OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 |
11 #include <jni.h> | 11 #include <jni.h> |
12 | 12 |
13 #include "webrtc/api/mediastreaminterface.h" | 13 #include "webrtc/api/mediastreaminterface.h" |
14 #include "webrtc/base/logging.h" | 14 #include "webrtc/rtc_base/logging.h" |
15 | 15 |
16 namespace webrtc_jni { | 16 namespace webrtc_jni { |
17 | 17 |
18 extern "C" JNIEXPORT void JNICALL | 18 extern "C" JNIEXPORT void JNICALL |
19 Java_org_webrtc_VideoTrack_nativeAddRenderer(JNIEnv* jni, | 19 Java_org_webrtc_VideoTrack_nativeAddRenderer(JNIEnv* jni, |
20 jclass, | 20 jclass, |
21 jlong j_video_track_pointer, | 21 jlong j_video_track_pointer, |
22 jlong j_renderer_pointer) { | 22 jlong j_renderer_pointer) { |
23 LOG(LS_INFO) << "VideoTrack::nativeAddRenderer"; | 23 LOG(LS_INFO) << "VideoTrack::nativeAddRenderer"; |
24 reinterpret_cast<webrtc::VideoTrackInterface*>(j_video_track_pointer) | 24 reinterpret_cast<webrtc::VideoTrackInterface*>(j_video_track_pointer) |
25 ->AddOrUpdateSink( | 25 ->AddOrUpdateSink( |
26 reinterpret_cast<rtc::VideoSinkInterface<webrtc::VideoFrame>*>( | 26 reinterpret_cast<rtc::VideoSinkInterface<webrtc::VideoFrame>*>( |
27 j_renderer_pointer), | 27 j_renderer_pointer), |
28 rtc::VideoSinkWants()); | 28 rtc::VideoSinkWants()); |
29 } | 29 } |
30 | 30 |
31 extern "C" JNIEXPORT void JNICALL | 31 extern "C" JNIEXPORT void JNICALL |
32 Java_org_webrtc_VideoTrack_nativeRemoveRenderer(JNIEnv* jni, | 32 Java_org_webrtc_VideoTrack_nativeRemoveRenderer(JNIEnv* jni, |
33 jclass, | 33 jclass, |
34 jlong j_video_track_pointer, | 34 jlong j_video_track_pointer, |
35 jlong j_renderer_pointer) { | 35 jlong j_renderer_pointer) { |
36 reinterpret_cast<webrtc::VideoTrackInterface*>(j_video_track_pointer) | 36 reinterpret_cast<webrtc::VideoTrackInterface*>(j_video_track_pointer) |
37 ->RemoveSink( | 37 ->RemoveSink( |
38 reinterpret_cast<rtc::VideoSinkInterface<webrtc::VideoFrame>*>( | 38 reinterpret_cast<rtc::VideoSinkInterface<webrtc::VideoFrame>*>( |
39 j_renderer_pointer)); | 39 j_renderer_pointer)); |
40 } | 40 } |
41 | 41 |
42 } // namespace webrtc_jni | 42 } // namespace webrtc_jni |
OLD | NEW |