Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | * |
| 10 | */ |
| 11 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 12 | #ifndef MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_ |
| 13 | #define MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_ |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 14 | |
Magnus Jedvert | 849b3ae | 2017-09-29 17:54:09 +0200 | [diff] [blame] | 15 | #include <vector> |
| 16 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #include "media/base/codec.h" |
| 18 | #include "modules/video_coding/include/video_codec_interface.h" |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | |
Magnus Jedvert | 849b3ae | 2017-09-29 17:54:09 +0200 | [diff] [blame] | 22 | struct SdpVideoFormat; |
| 23 | |
hbos | 9dc5928 | 2016-02-03 05:09:37 -0800 | [diff] [blame] | 24 | // Set to disable the H.264 encoder/decoder implementations that are provided if |
| 25 | // |rtc_use_h264| build flag is true (if false, this function does nothing). |
| 26 | // This function should only be called before or during WebRTC initialization |
| 27 | // and is not thread-safe. |
| 28 | void DisableRtcUseH264(); |
| 29 | |
Magnus Jedvert | 849b3ae | 2017-09-29 17:54:09 +0200 | [diff] [blame] | 30 | // Returns a vector with all supported internal H264 profiles that we can |
| 31 | // negotiate in SDP, in order of preference. |
| 32 | std::vector<SdpVideoFormat> SupportedH264Codecs(); |
| 33 | |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 34 | class H264Encoder : public VideoEncoder { |
| 35 | public: |
Magnus Jedvert | 34c8e6b | 2017-11-13 13:02:16 +0000 | [diff] [blame] | 36 | static H264Encoder* Create(const cricket::VideoCodec& codec); |
hbos | bab934b | 2016-01-27 01:36:03 -0800 | [diff] [blame] | 37 | // If H.264 is supported (any implementation). |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 38 | static bool IsSupported(); |
| 39 | |
| 40 | ~H264Encoder() override {} |
| 41 | }; |
| 42 | |
| 43 | class H264Decoder : public VideoDecoder { |
| 44 | public: |
Magnus Jedvert | 34c8e6b | 2017-11-13 13:02:16 +0000 | [diff] [blame] | 45 | static H264Decoder* Create(); |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 46 | static bool IsSupported(); |
| 47 | |
| 48 | ~H264Decoder() override {} |
| 49 | }; |
| 50 | |
| 51 | } // namespace webrtc |
| 52 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 53 | #endif // MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_ |