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

Unified Diff: webrtc/api/android/jni/androidvideotracksource_jni.cc

Issue 2547483003: Move /webrtc/api/android files to /webrtc/sdk/android (Closed)
Patch Set: Move to api folder under Android instead of src Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/android/jni/androidvideotracksource.cc ('k') | webrtc/api/android/jni/classreferenceholder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/jni/androidvideotracksource_jni.cc
diff --git a/webrtc/api/android/jni/androidvideotracksource_jni.cc b/webrtc/api/android/jni/androidvideotracksource_jni.cc
deleted file mode 100644
index 5aba4c6dcd792801928608b8f90df190bdd12545..0000000000000000000000000000000000000000
--- a/webrtc/api/android/jni/androidvideotracksource_jni.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/api/android/jni/androidvideotracksource.h"
-#include "webrtc/api/android/jni/classreferenceholder.h"
-#include "webrtc/api/videosourceproxy.h"
-
-// Identifiers are over 80 characters long so this is needed to fit them on one
-// line.
-#define JOW_OBSERVER_METHOD(rettype, name) \
- JOW(rettype, VideoCapturer_00024AndroidVideoTrackSourceObserver_##name)
-
-namespace webrtc_jni {
-
-static webrtc::AndroidVideoTrackSource* AndroidVideoTrackSourceFromJavaProxy(
- jlong j_proxy) {
- auto proxy_source = reinterpret_cast<webrtc::VideoTrackSourceProxy*>(j_proxy);
- return reinterpret_cast<webrtc::AndroidVideoTrackSource*>(
- proxy_source->internal());
-}
-
-JOW_OBSERVER_METHOD(void, nativeOnByteBufferFrameCaptured)
-(JNIEnv* jni,
- jclass,
- jlong j_source,
- jbyteArray j_frame,
- jint length,
- jint width,
- jint height,
- jint rotation,
- jlong timestamp) {
- webrtc::AndroidVideoTrackSource* source =
- AndroidVideoTrackSourceFromJavaProxy(j_source);
- jbyte* bytes = jni->GetByteArrayElements(j_frame, nullptr);
- source->OnByteBufferFrameCaptured(bytes, length, width, height, rotation,
- timestamp);
- jni->ReleaseByteArrayElements(j_frame, bytes, JNI_ABORT);
-}
-
-JOW_OBSERVER_METHOD(void, nativeOnTextureFrameCaptured)
-(JNIEnv* jni,
- jclass,
- jlong j_source,
- jint j_width,
- jint j_height,
- jint j_oes_texture_id,
- jfloatArray j_transform_matrix,
- jint j_rotation,
- jlong j_timestamp) {
- webrtc::AndroidVideoTrackSource* source =
- AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->OnTextureFrameCaptured(
- j_width, j_height, j_rotation, j_timestamp,
- NativeHandleImpl(jni, j_oes_texture_id, j_transform_matrix));
-}
-
-JOW_OBSERVER_METHOD(void, nativeCapturerStarted)
-(JNIEnv* jni, jclass, jlong j_source, jboolean j_success) {
- LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
- webrtc::AndroidVideoTrackSource* source =
- AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->SetState(j_success
- ? webrtc::AndroidVideoTrackSource::SourceState::kLive
- : webrtc::AndroidVideoTrackSource::SourceState::kEnded);
-}
-
-JOW_OBSERVER_METHOD(void, nativeCapturerStopped)
-(JNIEnv* jni, jclass, jlong j_source) {
- LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped";
- webrtc::AndroidVideoTrackSource* source =
- AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kEnded);
-}
-
-JOW(void, VideoSource_nativeAdaptOutputFormat)
-(JNIEnv* jni, jclass, jlong j_source, jint j_width, jint j_height, jint j_fps) {
- LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat";
- webrtc::AndroidVideoTrackSource* source =
- AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->OnOutputFormatRequest(j_width, j_height, j_fps);
-}
-
-} // namespace webrtc_jni
« no previous file with comments | « webrtc/api/android/jni/androidvideotracksource.cc ('k') | webrtc/api/android/jni/classreferenceholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698