OLD | NEW |
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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "webrtc/media/base/videobroadcaster.h" | 24 #include "webrtc/media/base/videobroadcaster.h" |
25 #include "webrtc/media/base/videosinkinterface.h" | 25 #include "webrtc/media/base/videosinkinterface.h" |
26 #include "third_party/libyuv/include/libyuv/convert.h" | 26 #include "third_party/libyuv/include/libyuv/convert.h" |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 | 29 |
30 class AndroidVideoTrackSource : public Notifier<VideoTrackSourceInterface> { | 30 class AndroidVideoTrackSource : public Notifier<VideoTrackSourceInterface> { |
31 public: | 31 public: |
32 AndroidVideoTrackSource(rtc::Thread* signaling_thread, | 32 AndroidVideoTrackSource(rtc::Thread* signaling_thread, |
33 JNIEnv* jni, | 33 JNIEnv* jni, |
34 jobject j_egl_context); | 34 jobject j_egl_context, |
| 35 bool is_screencast = false); |
35 | 36 |
36 // Not used on Android. | 37 // Not used on Android. |
37 // TODO(sakal/magjed): Try to remove this from the interface. | 38 // TODO(sakal/magjed): Try to remove this from the interface. |
38 void Stop() override { RTC_NOTREACHED(); }; | 39 void Stop() override { RTC_NOTREACHED(); }; |
39 // Not used on Android. | 40 // Not used on Android. |
40 // TODO(sakal/magjed): Try to remove this from the interface. | 41 // TODO(sakal/magjed): Try to remove this from the interface. |
41 void Restart() override { RTC_NOTREACHED(); } | 42 void Restart() override { RTC_NOTREACHED(); } |
42 | 43 |
43 // Currently, none of the Android implementations are screencast. | 44 bool is_screencast() const override { return is_screencast_; } |
44 bool is_screencast() const override { return false; } | |
45 | 45 |
46 // Indicates that the encoder should denoise video before encoding it. | 46 // Indicates that the encoder should denoise video before encoding it. |
47 // If it is not set, the default configuration is used which is different | 47 // If it is not set, the default configuration is used which is different |
48 // depending on video codec. | 48 // depending on video codec. |
49 rtc::Optional<bool> needs_denoising() const override { | 49 rtc::Optional<bool> needs_denoising() const override { |
50 return rtc::Optional<bool>(false); | 50 return rtc::Optional<bool>(false); |
51 } | 51 } |
52 | 52 |
53 // Returns false if no stats are available, e.g, for a remote | 53 // Returns false if no stats are available, e.g, for a remote |
54 // source, or a source which has not seen its first frame yet. | 54 // source, or a source which has not seen its first frame yet. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 rtc::Optional<Stats> stats_ GUARDED_BY(stats_crit_); | 95 rtc::Optional<Stats> stats_ GUARDED_BY(stats_crit_); |
96 SourceState state_; | 96 SourceState state_; |
97 rtc::VideoBroadcaster broadcaster_; | 97 rtc::VideoBroadcaster broadcaster_; |
98 rtc::TimestampAligner timestamp_aligner_; | 98 rtc::TimestampAligner timestamp_aligner_; |
99 cricket::VideoAdapter video_adapter_; | 99 cricket::VideoAdapter video_adapter_; |
100 rtc::CriticalSection apply_rotation_crit_; | 100 rtc::CriticalSection apply_rotation_crit_; |
101 bool apply_rotation_ GUARDED_BY(apply_rotation_crit_); | 101 bool apply_rotation_ GUARDED_BY(apply_rotation_crit_); |
102 webrtc::I420BufferPool pre_scale_pool_; | 102 webrtc::I420BufferPool pre_scale_pool_; |
103 webrtc::I420BufferPool post_scale_pool_; | 103 webrtc::I420BufferPool post_scale_pool_; |
104 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> surface_texture_helper_; | 104 rtc::scoped_refptr<webrtc_jni::SurfaceTextureHelper> surface_texture_helper_; |
| 105 const bool is_screencast_; |
105 | 106 |
106 void OnFrame(const cricket::VideoFrame& frame, int width, int height); | 107 void OnFrame(const cricket::VideoFrame& frame, int width, int height); |
107 | 108 |
108 void OnSinkWantsChanged(const rtc::VideoSinkWants& wants); | 109 void OnSinkWantsChanged(const rtc::VideoSinkWants& wants); |
109 | 110 |
110 bool AdaptFrame(int width, | 111 bool AdaptFrame(int width, |
111 int height, | 112 int height, |
112 int64_t camera_time_us, | 113 int64_t camera_time_us, |
113 int* out_width, | 114 int* out_width, |
114 int* out_height, | 115 int* out_height, |
115 int* crop_width, | 116 int* crop_width, |
116 int* crop_height, | 117 int* crop_height, |
117 int* crop_x, | 118 int* crop_x, |
118 int* crop_y, | 119 int* crop_y, |
119 int64_t* translated_camera_time_us); | 120 int64_t* translated_camera_time_us); |
120 }; | 121 }; |
121 | 122 |
122 } // namespace webrtc | 123 } // namespace webrtc |
123 | 124 |
124 #endif // WEBRTC_API_ANDROIDVIDEOTRACKSOURCE_H_ | 125 #endif // WEBRTC_API_ANDROIDVIDEOTRACKSOURCE_H_ |
OLD | NEW |