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

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

Issue 2991633002: Implement AndroidVideoBuffer::ToI420. (Closed)
Patch Set: Undo private change. 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 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 int height() const override; 122 int height() const override;
123 123
124 rtc::scoped_refptr<webrtc::I420BufferInterface> ToI420() override; 124 rtc::scoped_refptr<webrtc::I420BufferInterface> ToI420() override;
125 125
126 AndroidType android_type() override { return AndroidType::kJavaBuffer; } 126 AndroidType android_type() override { return AndroidType::kJavaBuffer; }
127 127
128 const jmethodID j_release_id_; 128 const jmethodID j_release_id_;
129 const int width_; 129 const int width_;
130 const int height_; 130 const int height_;
131 // Holds a VideoFrame.Buffer. 131 // Holds a VideoFrame.Buffer.
132 ScopedGlobalRef<jobject> j_video_frame_buffer_; 132 const ScopedGlobalRef<jobject> j_video_frame_buffer_;
133 }; 133 };
134 134
135 class AndroidVideoBufferFactory { 135 class AndroidVideoBufferFactory {
136 public: 136 public:
137 explicit AndroidVideoBufferFactory(JNIEnv* jni); 137 explicit AndroidVideoBufferFactory(JNIEnv* jni);
138 138
139 webrtc::VideoFrame CreateFrame(JNIEnv* jni, 139 webrtc::VideoFrame CreateFrame(JNIEnv* jni,
140 jobject j_video_frame, 140 jobject j_video_frame,
141 uint32_t timestamp_rtp) const; 141 uint32_t timestamp_rtp) const;
142 142
143 rtc::scoped_refptr<AndroidVideoBuffer> CreateBuffer( 143 rtc::scoped_refptr<AndroidVideoBuffer> CreateBuffer(
144 jobject j_video_frame_buffer) const; 144 jobject j_video_frame_buffer) const;
145 145
146 private: 146 private:
147 ScopedGlobalRef<jclass> j_video_frame_class_; 147 ScopedGlobalRef<jclass> j_video_frame_class_;
148 jmethodID j_get_buffer_id_; 148 jmethodID j_get_buffer_id_;
149 jmethodID j_get_rotation_id_; 149 jmethodID j_get_rotation_id_;
150 jmethodID j_get_timestamp_ns_id_; 150 jmethodID j_get_timestamp_ns_id_;
151 151
152 ScopedGlobalRef<jclass> j_video_frame_buffer_class_; 152 ScopedGlobalRef<jclass> j_video_frame_buffer_class_;
153 jmethodID j_retain_id_; 153 jmethodID j_retain_id_;
154 jmethodID j_release_id_; 154 jmethodID j_release_id_;
155 jmethodID j_get_width_id_; 155 jmethodID j_get_width_id_;
156 jmethodID j_get_height_id_; 156 jmethodID j_get_height_id_;
157 }; 157 };
158 158
159 } // namespace webrtc_jni 159 } // namespace webrtc_jni
160 160
161 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_NATIVE_HANDLE_IMPL_H_ 161 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_NATIVE_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698