Index: webrtc/api/androidvideocapturer.h |
diff --git a/webrtc/api/androidvideocapturer.h b/webrtc/api/androidvideocapturer.h |
index 4c73f3159874e76323fdee76a04702c6d575969d..842a2700eae915add9085bb9cdecc4027c4cf7ee 100644 |
--- a/webrtc/api/androidvideocapturer.h |
+++ b/webrtc/api/androidvideocapturer.h |
@@ -17,6 +17,14 @@ |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/common_video/include/video_frame_buffer.h" |
#include "webrtc/media/base/videocapturer.h" |
+#include "third_party/libyuv/include/libyuv/rotate.h" |
+ |
+namespace webrtc_jni { |
+ |
+struct NativeHandleImpl; |
+class SurfaceTextureHelper; |
+ |
+} // namespace webrtc_jni |
namespace webrtc { |
@@ -41,19 +49,28 @@ class AndroidVideoCapturerDelegate : public rtc::RefCountInterface { |
// PeerConnection. |
class AndroidVideoCapturer : public cricket::VideoCapturer { |
public: |
- explicit AndroidVideoCapturer( |
- const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate); |
+ AndroidVideoCapturer( |
+ const rtc::scoped_refptr<AndroidVideoCapturerDelegate>& delegate, |
+ rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> helper); |
virtual ~AndroidVideoCapturer(); |
// Called from JNI when the capturer has been started. |
void OnCapturerStarted(bool success); |
// Called from JNI when a new frame has been captured. |
- // Argument |buffer| is intentionally by value, for use with rtc::Bind. |
- void OnIncomingFrame( |
- const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
- int rotation, |
- int64_t time_stamp); |
+ void OnNV21Frame(const uint8_t* video_frame, |
+ int length, |
+ int width, |
+ int height, |
+ webrtc::VideoRotation rotation, |
+ int64_t timestamp_ns); |
+ |
+ // Called from JNI when a new frame has been captured. |
+ void OnTextureFrame(int width, |
+ int height, |
+ webrtc::VideoRotation rotation, |
+ int64_t timestamp_ns, |
+ const webrtc_jni::NativeHandleImpl& handle); |
// Called from JNI to request a new video format. |
void OnOutputFormatRequest(int width, int height, int fps); |
@@ -77,12 +94,9 @@ class AndroidVideoCapturer : public cricket::VideoCapturer { |
bool running_; |
rtc::scoped_refptr<AndroidVideoCapturerDelegate> delegate_; |
- |
+ rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> surface_texture_helper_; |
rtc::ThreadChecker thread_checker_; |
- class FrameFactory; |
- FrameFactory* frame_factory_; // Owned by cricket::VideoCapturer. |
- |
cricket::CaptureState current_state_; |
}; |