blob: e23818b756b86f3033eb6b953a3688ba3c806a32 [file] [log] [blame]
Zeke Chin71f6f442015-06-29 14:34:58 -07001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020012#ifndef MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_
13#define MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_
Zeke Chin71f6f442015-06-29 14:34:58 -070014
Magnus Jedvert46a27652017-11-13 14:10:02 +010015#include <memory>
Magnus Jedvert849b3ae2017-09-29 17:54:09 +020016#include <vector>
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "media/base/codec.h"
19#include "modules/video_coding/include/video_codec_interface.h"
Zeke Chin71f6f442015-06-29 14:34:58 -070020
21namespace webrtc {
22
Magnus Jedvert849b3ae2017-09-29 17:54:09 +020023struct SdpVideoFormat;
24
hbos9dc59282016-02-03 05:09:37 -080025// Set to disable the H.264 encoder/decoder implementations that are provided if
26// |rtc_use_h264| build flag is true (if false, this function does nothing).
27// This function should only be called before or during WebRTC initialization
28// and is not thread-safe.
29void DisableRtcUseH264();
30
Magnus Jedvert849b3ae2017-09-29 17:54:09 +020031// Returns a vector with all supported internal H264 profiles that we can
32// negotiate in SDP, in order of preference.
33std::vector<SdpVideoFormat> SupportedH264Codecs();
34
Zeke Chin71f6f442015-06-29 14:34:58 -070035class H264Encoder : public VideoEncoder {
36 public:
Magnus Jedvert46a27652017-11-13 14:10:02 +010037 static std::unique_ptr<H264Encoder> Create(const cricket::VideoCodec& codec);
hbosbab934b2016-01-27 01:36:03 -080038 // If H.264 is supported (any implementation).
Zeke Chin71f6f442015-06-29 14:34:58 -070039 static bool IsSupported();
40
41 ~H264Encoder() override {}
42};
43
44class H264Decoder : public VideoDecoder {
45 public:
Magnus Jedvert46a27652017-11-13 14:10:02 +010046 static std::unique_ptr<H264Decoder> Create();
Zeke Chin71f6f442015-06-29 14:34:58 -070047 static bool IsSupported();
48
49 ~H264Decoder() override {}
50};
51
52} // namespace webrtc
53
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020054#endif // MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_