blob: f5cebcfe62122c5ef727f3770503b63f7fd4f1ff [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"
Mirko Bonadei276827c2018-10-16 14:13:50 +020020#include "rtc_base/system/rtc_export.h"
Zeke Chin71f6f442015-06-29 14:34:58 -070021
22namespace webrtc {
23
Magnus Jedvert849b3ae2017-09-29 17:54:09 +020024struct SdpVideoFormat;
25
hbos9dc59282016-02-03 05:09:37 -080026// Set to disable the H.264 encoder/decoder implementations that are provided if
27// |rtc_use_h264| build flag is true (if false, this function does nothing).
28// This function should only be called before or during WebRTC initialization
29// and is not thread-safe.
Mirko Bonadei276827c2018-10-16 14:13:50 +020030RTC_EXPORT void DisableRtcUseH264();
hbos9dc59282016-02-03 05:09:37 -080031
Magnus Jedvert849b3ae2017-09-29 17:54:09 +020032// Returns a vector with all supported internal H264 profiles that we can
33// negotiate in SDP, in order of preference.
34std::vector<SdpVideoFormat> SupportedH264Codecs();
35
Mirko Bonadei276827c2018-10-16 14:13:50 +020036class RTC_EXPORT H264Encoder : public VideoEncoder {
Zeke Chin71f6f442015-06-29 14:34:58 -070037 public:
Magnus Jedvert46a27652017-11-13 14:10:02 +010038 static std::unique_ptr<H264Encoder> Create(const cricket::VideoCodec& codec);
hbosbab934b2016-01-27 01:36:03 -080039 // If H.264 is supported (any implementation).
Zeke Chin71f6f442015-06-29 14:34:58 -070040 static bool IsSupported();
41
42 ~H264Encoder() override {}
43};
44
Mirko Bonadei276827c2018-10-16 14:13:50 +020045class RTC_EXPORT H264Decoder : public VideoDecoder {
Zeke Chin71f6f442015-06-29 14:34:58 -070046 public:
Magnus Jedvert46a27652017-11-13 14:10:02 +010047 static std::unique_ptr<H264Decoder> Create();
Zeke Chin71f6f442015-06-29 14:34:58 -070048 static bool IsSupported();
49
50 ~H264Decoder() override {}
51};
52
53} // namespace webrtc
54
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020055#endif // MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_H_