OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // at any time which is needed since the signal may be called from an | 255 // at any time which is needed since the signal may be called from an |
256 // unmarshalled thread owned by the VideoCapturer. | 256 // unmarshalled thread owned by the VideoCapturer. |
257 // Signal the captured frame to downstream. | 257 // Signal the captured frame to downstream. |
258 sigslot::signal2<VideoCapturer*, const CapturedFrame*, | 258 sigslot::signal2<VideoCapturer*, const CapturedFrame*, |
259 sigslot::multi_threaded_local> SignalFrameCaptured; | 259 sigslot::multi_threaded_local> SignalFrameCaptured; |
260 // Signal the captured and possibly adapted frame to downstream consumers | 260 // Signal the captured and possibly adapted frame to downstream consumers |
261 // such as the encoder. | 261 // such as the encoder. |
262 sigslot::signal2<VideoCapturer*, const VideoFrame*, | 262 sigslot::signal2<VideoCapturer*, const VideoFrame*, |
263 sigslot::multi_threaded_local> SignalVideoFrame; | 263 sigslot::multi_threaded_local> SignalVideoFrame; |
264 | 264 |
265 // If 'screencast_max_pixels' is set greater than zero, screencasts will be | |
266 // scaled to be no larger than this value. | |
267 // If set to zero, the max pixels will be limited to | |
268 // Retina MacBookPro 15" resolution of 2880 x 1800. | |
269 // For high fps, maximum pixels limit is set based on common 24" monitor | |
270 // resolution of 2048 x 1280. | |
271 int screencast_max_pixels() const { return screencast_max_pixels_; } | |
272 void set_screencast_max_pixels(int p) { | |
273 screencast_max_pixels_ = std::max(0, p); | |
274 } | |
275 | |
276 // If true, run video adaptation. By default, video adaptation is enabled | 265 // If true, run video adaptation. By default, video adaptation is enabled |
277 // and users must call video_adapter()->OnOutputFormatRequest() | 266 // and users must call video_adapter()->OnOutputFormatRequest() |
278 // to receive frames. | 267 // to receive frames. |
279 bool enable_video_adapter() const { return enable_video_adapter_; } | 268 bool enable_video_adapter() const { return enable_video_adapter_; } |
280 void set_enable_video_adapter(bool enable_video_adapter) { | 269 void set_enable_video_adapter(bool enable_video_adapter) { |
281 enable_video_adapter_ = enable_video_adapter; | 270 enable_video_adapter_ = enable_video_adapter; |
282 } | 271 } |
283 | 272 |
284 CoordinatedVideoAdapter* video_adapter() { return &video_adapter_; } | 273 CoordinatedVideoAdapter* video_adapter() { return &video_adapter_; } |
285 const CoordinatedVideoAdapter* video_adapter() const { | 274 const CoordinatedVideoAdapter* video_adapter() const { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 std::vector<VideoFormat> supported_formats_; | 351 std::vector<VideoFormat> supported_formats_; |
363 rtc::scoped_ptr<VideoFormat> max_format_; | 352 rtc::scoped_ptr<VideoFormat> max_format_; |
364 std::vector<VideoFormat> filtered_supported_formats_; | 353 std::vector<VideoFormat> filtered_supported_formats_; |
365 | 354 |
366 int ratio_w_; // View resolution. e.g. 1280 x 720. | 355 int ratio_w_; // View resolution. e.g. 1280 x 720. |
367 int ratio_h_; | 356 int ratio_h_; |
368 bool enable_camera_list_; | 357 bool enable_camera_list_; |
369 bool square_pixel_aspect_ratio_; // Enable scaling to square pixels. | 358 bool square_pixel_aspect_ratio_; // Enable scaling to square pixels. |
370 int scaled_width_; // Current output size from ComputeScale. | 359 int scaled_width_; // Current output size from ComputeScale. |
371 int scaled_height_; | 360 int scaled_height_; |
372 int screencast_max_pixels_; // Downscale screencasts further if requested. | |
373 bool muted_; | 361 bool muted_; |
374 int black_frame_count_down_; | 362 int black_frame_count_down_; |
375 | 363 |
376 bool enable_video_adapter_; | 364 bool enable_video_adapter_; |
377 CoordinatedVideoAdapter video_adapter_; | 365 CoordinatedVideoAdapter video_adapter_; |
378 | 366 |
379 rtc::Timing frame_length_time_reporter_; | 367 rtc::Timing frame_length_time_reporter_; |
380 rtc::CriticalSection frame_stats_crit_; | 368 rtc::CriticalSection frame_stats_crit_; |
381 | 369 |
382 int adapt_frame_drops_; | 370 int adapt_frame_drops_; |
383 rtc::RollingAccumulator<int> adapt_frame_drops_data_; | 371 rtc::RollingAccumulator<int> adapt_frame_drops_data_; |
384 double previous_frame_time_; | 372 double previous_frame_time_; |
385 rtc::RollingAccumulator<double> frame_time_data_; | 373 rtc::RollingAccumulator<double> frame_time_data_; |
386 // The captured frame format before potential adapation. | 374 // The captured frame format before potential adapation. |
387 VideoFormat last_captured_frame_format_; | 375 VideoFormat last_captured_frame_format_; |
388 | 376 |
389 // Whether capturer should apply rotation to the frame before signaling it. | 377 // Whether capturer should apply rotation to the frame before signaling it. |
390 bool apply_rotation_; | 378 bool apply_rotation_; |
391 | 379 |
392 RTC_DISALLOW_COPY_AND_ASSIGN(VideoCapturer); | 380 RTC_DISALLOW_COPY_AND_ASSIGN(VideoCapturer); |
393 }; | 381 }; |
394 | 382 |
395 } // namespace cricket | 383 } // namespace cricket |
396 | 384 |
397 #endif // TALK_MEDIA_BASE_VIDEOCAPTURER_H_ | 385 #endif // TALK_MEDIA_BASE_VIDEOCAPTURER_H_ |
OLD | NEW |