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 |
11 #ifndef WEBRTC_COMMON_TYPES_H_ | 11 #ifndef WEBRTC_COMMON_TYPES_H_ |
12 #define WEBRTC_COMMON_TYPES_H_ | 12 #define WEBRTC_COMMON_TYPES_H_ |
13 | 13 |
14 #include <assert.h> | 14 #include <assert.h> |
15 #include <stddef.h> | 15 #include <stddef.h> |
16 #include <string.h> | 16 #include <string.h> |
17 | 17 |
18 #include <string> | 18 #include <string> |
19 #include <vector> | 19 #include <vector> |
20 | 20 |
21 #include "webrtc/base/optional.h" | |
21 #include "webrtc/common_video/rotation.h" | 22 #include "webrtc/common_video/rotation.h" |
22 #include "webrtc/typedefs.h" | 23 #include "webrtc/typedefs.h" |
23 | 24 |
24 #if defined(_MSC_VER) | 25 #if defined(_MSC_VER) |
25 // Disable "new behavior: elements of array will be default initialized" | 26 // Disable "new behavior: elements of array will be default initialized" |
26 // warning. Affects OverUseDetectorOptions. | 27 // warning. Affects OverUseDetectorOptions. |
27 #pragma warning(disable : 4351) | 28 #pragma warning(disable : 4351) |
28 #endif | 29 #endif |
29 | 30 |
30 #if defined(WEBRTC_EXPORT) | 31 #if defined(WEBRTC_EXPORT) |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 enum { kMaxSpatialLayers = 5 }; | 492 enum { kMaxSpatialLayers = 5 }; |
492 enum { kMaxTemporalStreams = 4 }; | 493 enum { kMaxTemporalStreams = 4 }; |
493 | 494 |
494 enum VideoCodecComplexity { | 495 enum VideoCodecComplexity { |
495 kComplexityNormal = 0, | 496 kComplexityNormal = 0, |
496 kComplexityHigh = 1, | 497 kComplexityHigh = 1, |
497 kComplexityHigher = 2, | 498 kComplexityHigher = 2, |
498 kComplexityMax = 3 | 499 kComplexityMax = 3 |
499 }; | 500 }; |
500 | 501 |
501 enum VideoCodecProfile { kProfileBase = 0x00, kProfileMain = 0x01 }; | 502 enum H264Profile { |
hta-webrtc
2016/10/28 09:55:23
Query: Is it really necessary to pollute webrtc/co
magjed_webrtc
2016/10/28 14:59:27
Good point. I moved everything to webrtc/common_vi
| |
503 kProfileConstrainedBaseline, | |
504 kProfileBaseline, | |
505 kProfileMain, | |
506 kProfileConstrainedHigh, | |
507 kProfileHigh, | |
508 }; | |
509 | |
510 // All values are equal to ten times the level number, except level 1b which is | |
511 // special. | |
512 enum H264Level { | |
513 kH264Level1_b = 0, | |
514 kH264Level1 = 10, | |
515 kH264Level1_1 = 11, | |
516 kH264Level1_2 = 12, | |
517 kH264Level1_3 = 13, | |
518 kH264Level2 = 20, | |
519 kH264Level2_1 = 21, | |
520 kH264Level2_2 = 22, | |
521 kH264Level3 = 30, | |
522 kH264Level3_1 = 31, | |
523 kH264Level3_2 = 32, | |
524 kH264Level4 = 40, | |
525 kH264Level4_1 = 41, | |
526 kH264Level4_2 = 42, | |
527 kH264Level5 = 50, | |
528 kH264Level5_1 = 51, | |
529 kH264Level5_2 = 52 | |
530 }; | |
531 | |
532 struct H264ProfileLevelId { | |
533 H264Profile profile; | |
534 H264Level level; | |
535 }; | |
536 | |
537 // Parse H264 profile level id that is represented as a string of 3 hex bytes. | |
538 // Nothing will be returned if the string is not a recognized H264 | |
539 // profile level id. | |
540 rtc::Optional<H264ProfileLevelId> ParseH264ProfileLevelId(const char* str); | |
502 | 541 |
503 enum VP8ResilienceMode { | 542 enum VP8ResilienceMode { |
504 kResilienceOff, // The stream produced by the encoder requires a | 543 kResilienceOff, // The stream produced by the encoder requires a |
505 // recovery frame (typically a key frame) to be | 544 // recovery frame (typically a key frame) to be |
506 // decodable after a packet loss. | 545 // decodable after a packet loss. |
507 kResilientStream, // A stream produced by the encoder is resilient to | 546 kResilientStream, // A stream produced by the encoder is resilient to |
508 // packet losses, but packets within a frame subsequent | 547 // packet losses, but packets within a frame subsequent |
509 // to a loss can't be decoded. | 548 // to a loss can't be decoded. |
510 kResilientFrames // Same as kResilientStream but with added resilience | 549 kResilientFrames // Same as kResilientStream but with added resilience |
511 // within a frame. | 550 // within a frame. |
(...skipping 24 matching lines...) Expand all Loading... | |
536 bool frameDroppingOn; | 575 bool frameDroppingOn; |
537 int keyFrameInterval; | 576 int keyFrameInterval; |
538 bool adaptiveQpMode; | 577 bool adaptiveQpMode; |
539 bool automaticResizeOn; | 578 bool automaticResizeOn; |
540 unsigned char numberOfSpatialLayers; | 579 unsigned char numberOfSpatialLayers; |
541 bool flexibleMode; | 580 bool flexibleMode; |
542 }; | 581 }; |
543 | 582 |
544 // H264 specific. | 583 // H264 specific. |
545 struct VideoCodecH264 { | 584 struct VideoCodecH264 { |
546 VideoCodecProfile profile; | 585 H264ProfileLevelId profileLevelId; |
547 bool frameDroppingOn; | 586 bool frameDroppingOn; |
548 int keyFrameInterval; | 587 int keyFrameInterval; |
549 // These are NULL/0 if not externally negotiated. | 588 // These are NULL/0 if not externally negotiated. |
550 const uint8_t* spsData; | 589 const uint8_t* spsData; |
551 size_t spsLen; | 590 size_t spsLen; |
552 const uint8_t* ppsData; | 591 const uint8_t* ppsData; |
553 size_t ppsLen; | 592 size_t ppsLen; |
554 }; | 593 }; |
555 | 594 |
556 // Video codec types | 595 // Video codec types |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 enum class RtcpMode { kOff, kCompound, kReducedSize }; | 879 enum class RtcpMode { kOff, kCompound, kReducedSize }; |
841 | 880 |
842 enum NetworkState { | 881 enum NetworkState { |
843 kNetworkUp, | 882 kNetworkUp, |
844 kNetworkDown, | 883 kNetworkDown, |
845 }; | 884 }; |
846 | 885 |
847 } // namespace webrtc | 886 } // namespace webrtc |
848 | 887 |
849 #endif // WEBRTC_COMMON_TYPES_H_ | 888 #endif // WEBRTC_COMMON_TYPES_H_ |
OLD | NEW |