| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 kResilienceOff, // The stream produced by the encoder requires a | 562 kResilienceOff, // The stream produced by the encoder requires a |
| 563 // recovery frame (typically a key frame) to be | 563 // recovery frame (typically a key frame) to be |
| 564 // decodable after a packet loss. | 564 // decodable after a packet loss. |
| 565 kResilientStream, // A stream produced by the encoder is resilient to | 565 kResilientStream, // A stream produced by the encoder is resilient to |
| 566 // packet losses, but packets within a frame subsequent | 566 // packet losses, but packets within a frame subsequent |
| 567 // to a loss can't be decoded. | 567 // to a loss can't be decoded. |
| 568 kResilientFrames // Same as kResilientStream but with added resilience | 568 kResilientFrames // Same as kResilientStream but with added resilience |
| 569 // within a frame. | 569 // within a frame. |
| 570 }; | 570 }; |
| 571 | 571 |
| 572 class TemporalLayersFactory; |
| 572 // VP8 specific | 573 // VP8 specific |
| 573 struct VideoCodecVP8 { | 574 struct VideoCodecVP8 { |
| 574 bool pictureLossIndicationOn; | 575 bool pictureLossIndicationOn; |
| 575 bool feedbackModeOn; | 576 bool feedbackModeOn; |
| 576 VideoCodecComplexity complexity; | 577 VideoCodecComplexity complexity; |
| 577 VP8ResilienceMode resilience; | 578 VP8ResilienceMode resilience; |
| 578 unsigned char numberOfTemporalLayers; | 579 unsigned char numberOfTemporalLayers; |
| 579 bool denoisingOn; | 580 bool denoisingOn; |
| 580 bool errorConcealmentOn; | 581 bool errorConcealmentOn; |
| 581 bool automaticResizeOn; | 582 bool automaticResizeOn; |
| 582 bool frameDroppingOn; | 583 bool frameDroppingOn; |
| 583 int keyFrameInterval; | 584 int keyFrameInterval; |
| 584 | 585 const TemporalLayersFactory* tl_factory; |
| 585 bool operator==(const VideoCodecVP8& other) const { | |
| 586 return pictureLossIndicationOn == other.pictureLossIndicationOn && | |
| 587 feedbackModeOn == other.feedbackModeOn && | |
| 588 complexity == other.complexity && | |
| 589 resilience == other.resilience && | |
| 590 numberOfTemporalLayers == other.numberOfTemporalLayers && | |
| 591 denoisingOn == other.denoisingOn && | |
| 592 errorConcealmentOn == other.errorConcealmentOn && | |
| 593 automaticResizeOn == other.automaticResizeOn && | |
| 594 frameDroppingOn == other.frameDroppingOn && | |
| 595 keyFrameInterval == other.keyFrameInterval; | |
| 596 } | |
| 597 | |
| 598 bool operator!=(const VideoCodecVP8& other) const { | |
| 599 return !(*this == other); | |
| 600 } | |
| 601 }; | 586 }; |
| 602 | 587 |
| 603 // VP9 specific. | 588 // VP9 specific. |
| 604 struct VideoCodecVP9 { | 589 struct VideoCodecVP9 { |
| 605 VideoCodecComplexity complexity; | 590 VideoCodecComplexity complexity; |
| 606 int resilience; | 591 int resilience; |
| 607 unsigned char numberOfTemporalLayers; | 592 unsigned char numberOfTemporalLayers; |
| 608 bool denoisingOn; | 593 bool denoisingOn; |
| 609 bool frameDroppingOn; | 594 bool frameDroppingOn; |
| 610 int keyFrameInterval; | 595 int keyFrameInterval; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 // Simulcast is when the same stream is encoded multiple times with different | 633 // Simulcast is when the same stream is encoded multiple times with different |
| 649 // settings such as resolution. | 634 // settings such as resolution. |
| 650 struct SimulcastStream { | 635 struct SimulcastStream { |
| 651 unsigned short width; | 636 unsigned short width; |
| 652 unsigned short height; | 637 unsigned short height; |
| 653 unsigned char numberOfTemporalLayers; | 638 unsigned char numberOfTemporalLayers; |
| 654 unsigned int maxBitrate; // kilobits/sec. | 639 unsigned int maxBitrate; // kilobits/sec. |
| 655 unsigned int targetBitrate; // kilobits/sec. | 640 unsigned int targetBitrate; // kilobits/sec. |
| 656 unsigned int minBitrate; // kilobits/sec. | 641 unsigned int minBitrate; // kilobits/sec. |
| 657 unsigned int qpMax; // minimum quality | 642 unsigned int qpMax; // minimum quality |
| 658 | |
| 659 bool operator==(const SimulcastStream& other) const { | |
| 660 return width == other.width && | |
| 661 height == other.height && | |
| 662 numberOfTemporalLayers == other.numberOfTemporalLayers && | |
| 663 maxBitrate == other.maxBitrate && | |
| 664 targetBitrate == other.targetBitrate && | |
| 665 minBitrate == other.minBitrate && | |
| 666 qpMax == other.qpMax; | |
| 667 } | |
| 668 | |
| 669 bool operator!=(const SimulcastStream& other) const { | |
| 670 return !(*this == other); | |
| 671 } | |
| 672 }; | 643 }; |
| 673 | 644 |
| 674 struct SpatialLayer { | 645 struct SpatialLayer { |
| 675 int scaling_factor_num; | 646 int scaling_factor_num; |
| 676 int scaling_factor_den; | 647 int scaling_factor_den; |
| 677 int target_bitrate_bps; | 648 int target_bitrate_bps; |
| 678 // TODO(ivica): Add max_quantizer and min_quantizer? | 649 // TODO(ivica): Add max_quantizer and min_quantizer? |
| 679 }; | 650 }; |
| 680 | 651 |
| 681 enum VideoCodecMode { | 652 enum VideoCodecMode { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 701 | 672 |
| 702 VideoCodecUnion codecSpecific; | 673 VideoCodecUnion codecSpecific; |
| 703 | 674 |
| 704 unsigned int qpMax; | 675 unsigned int qpMax; |
| 705 unsigned char numberOfSimulcastStreams; | 676 unsigned char numberOfSimulcastStreams; |
| 706 SimulcastStream simulcastStream[kMaxSimulcastStreams]; | 677 SimulcastStream simulcastStream[kMaxSimulcastStreams]; |
| 707 SpatialLayer spatialLayers[kMaxSpatialLayers]; | 678 SpatialLayer spatialLayers[kMaxSpatialLayers]; |
| 708 | 679 |
| 709 VideoCodecMode mode; | 680 VideoCodecMode mode; |
| 710 | 681 |
| 711 // When using an external encoder/decoder this allows to pass | 682 bool operator==(const VideoCodec& other) const = delete; |
| 712 // extra options without requiring webrtc to be aware of them. | 683 bool operator!=(const VideoCodec& other) const = delete; |
| 713 Config* extra_options; | |
| 714 | |
| 715 bool operator==(const VideoCodec& other) const { | |
| 716 bool ret = codecType == other.codecType && | |
| 717 (STR_CASE_CMP(plName, other.plName) == 0) && | |
| 718 plType == other.plType && | |
| 719 width == other.width && | |
| 720 height == other.height && | |
| 721 startBitrate == other.startBitrate && | |
| 722 maxBitrate == other.maxBitrate && | |
| 723 minBitrate == other.minBitrate && | |
| 724 targetBitrate == other.targetBitrate && | |
| 725 maxFramerate == other.maxFramerate && | |
| 726 qpMax == other.qpMax && | |
| 727 numberOfSimulcastStreams == other.numberOfSimulcastStreams && | |
| 728 mode == other.mode; | |
| 729 if (ret && codecType == kVideoCodecVP8) { | |
| 730 ret &= (codecSpecific.VP8 == other.codecSpecific.VP8); | |
| 731 } | |
| 732 | |
| 733 for (unsigned char i = 0; i < other.numberOfSimulcastStreams && ret; ++i) { | |
| 734 ret &= (simulcastStream[i] == other.simulcastStream[i]); | |
| 735 } | |
| 736 return ret; | |
| 737 } | |
| 738 | |
| 739 bool operator!=(const VideoCodec& other) const { | |
| 740 return !(*this == other); | |
| 741 } | |
| 742 }; | 684 }; |
| 743 | 685 |
| 744 // Bandwidth over-use detector options. These are used to drive | 686 // Bandwidth over-use detector options. These are used to drive |
| 745 // experimentation with bandwidth estimation parameters. | 687 // experimentation with bandwidth estimation parameters. |
| 746 // See modules/remote_bitrate_estimator/overuse_detector.h | 688 // See modules/remote_bitrate_estimator/overuse_detector.h |
| 747 struct OverUseDetectorOptions { | 689 struct OverUseDetectorOptions { |
| 748 OverUseDetectorOptions() | 690 OverUseDetectorOptions() |
| 749 : initial_slope(8.0/512.0), | 691 : initial_slope(8.0/512.0), |
| 750 initial_offset(0), | 692 initial_offset(0), |
| 751 initial_e(), | 693 initial_e(), |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 uint32_t ssrc) = 0; | 838 uint32_t ssrc) = 0; |
| 897 }; | 839 }; |
| 898 | 840 |
| 899 // RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size | 841 // RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size |
| 900 // RTCP mode is described by RFC 5506. | 842 // RTCP mode is described by RFC 5506. |
| 901 enum class RtcpMode { kOff, kCompound, kReducedSize }; | 843 enum class RtcpMode { kOff, kCompound, kReducedSize }; |
| 902 | 844 |
| 903 } // namespace webrtc | 845 } // namespace webrtc |
| 904 | 846 |
| 905 #endif // WEBRTC_COMMON_TYPES_H_ | 847 #endif // WEBRTC_COMMON_TYPES_H_ |
| OLD | NEW |