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

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

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
11 #ifndef WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_ 11 #ifndef WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_
12 #define WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_ 12 #define WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_
13 13
14 #include <jni.h>
15
14 #include "webrtc/common_video/include/i420_buffer_pool.h" 16 #include "webrtc/common_video/include/i420_buffer_pool.h"
15 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
16 #include "webrtc/media/base/adaptedvideotracksource.h" 18 #include "webrtc/media/base/adaptedvideotracksource.h"
17 #include "webrtc/rtc_base/asyncinvoker.h" 19 #include "webrtc/rtc_base/asyncinvoker.h"
18 #include "webrtc/rtc_base/checks.h" 20 #include "webrtc/rtc_base/checks.h"
19 #include "webrtc/rtc_base/thread_checker.h" 21 #include "webrtc/rtc_base/thread_checker.h"
20 #include "webrtc/rtc_base/timestampaligner.h" 22 #include "webrtc/rtc_base/timestampaligner.h"
21 #include "webrtc/sdk/android/src/jni/native_handle_impl.h" 23 #include "webrtc/sdk/android/src/jni/native_handle_impl.h"
22 #include "webrtc/sdk/android/src/jni/surfacetexturehelper_jni.h" 24 #include "webrtc/sdk/android/src/jni/surfacetexturehelper_jni.h"
23 25
(...skipping 28 matching lines...) Expand all
52 int height, 54 int height,
53 VideoRotation rotation, 55 VideoRotation rotation,
54 int64_t timestamp_ns); 56 int64_t timestamp_ns);
55 57
56 void OnTextureFrameCaptured(int width, 58 void OnTextureFrameCaptured(int width,
57 int height, 59 int height,
58 VideoRotation rotation, 60 VideoRotation rotation,
59 int64_t timestamp_ns, 61 int64_t timestamp_ns,
60 const webrtc_jni::NativeHandleImpl& handle); 62 const webrtc_jni::NativeHandleImpl& handle);
61 63
64 void OnFrameCaptured(JNIEnv* jni,
65 int width,
66 int height,
67 int64_t timestamp_ns,
68 VideoRotation rotation,
69 jobject j_video_frame_buffer);
70
62 void OnOutputFormatRequest(int width, int height, int fps); 71 void OnOutputFormatRequest(int width, int height, int fps);
63 72
64 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> 73 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper>
65 surface_texture_helper() { 74 surface_texture_helper() {
66 return surface_texture_helper_; 75 return surface_texture_helper_;
67 } 76 }
68 77
69 private: 78 private:
70 rtc::Thread* signaling_thread_; 79 rtc::Thread* signaling_thread_;
71 rtc::AsyncInvoker invoker_; 80 rtc::AsyncInvoker invoker_;
72 rtc::ThreadChecker camera_thread_checker_; 81 rtc::ThreadChecker camera_thread_checker_;
73 SourceState state_; 82 SourceState state_;
74 rtc::TimestampAligner timestamp_aligner_; 83 rtc::TimestampAligner timestamp_aligner_;
75 NV12ToI420Scaler nv12toi420_scaler_; 84 NV12ToI420Scaler nv12toi420_scaler_;
76 I420BufferPool buffer_pool_; 85 I420BufferPool buffer_pool_;
77 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> surface_texture_helper_; 86 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> surface_texture_helper_;
87 webrtc_jni::AndroidVideoBufferFactory video_buffer_factory_;
78 const bool is_screencast_; 88 const bool is_screencast_;
89
90 jmethodID j_crop_and_scale_id_;
79 }; 91 };
80 92
81 } // namespace webrtc 93 } // namespace webrtc
82 94
83 #endif // WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_ 95 #endif // WEBRTC_API_ANDROID_JNI_ANDROIDVIDEOTRACKSOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698