2019-12-05 16:24:04 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "modules/rtp_rtcp/source/create_video_rtp_depacketizer.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2020-01-15 11:34:28 +01:00
|
|
|
#include "api/video/video_codec_type.h"
|
2019-12-05 16:24:04 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
|
2020-01-10 17:26:53 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
|
2019-12-23 13:14:28 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_generic.h"
|
2020-01-09 18:55:02 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_h264.h"
|
2019-12-11 11:24:37 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_vp8.h"
|
2019-12-16 13:19:28 +01:00
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_vp9.h"
|
2024-01-19 11:32:17 +08:00
|
|
|
#ifdef RTC_ENABLE_H265
|
|
|
|
|
#include "modules/rtp_rtcp/source/video_rtp_depacketizer_h265.h"
|
|
|
|
|
#endif
|
2019-12-05 16:24:04 +01:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<VideoRtpDepacketizer> CreateVideoRtpDepacketizer(
|
|
|
|
|
VideoCodecType codec) {
|
2019-12-11 11:24:37 +01:00
|
|
|
switch (codec) {
|
2019-12-23 13:14:28 +01:00
|
|
|
case kVideoCodecH264:
|
2020-01-15 11:34:28 +01:00
|
|
|
return std::make_unique<VideoRtpDepacketizerH264>();
|
2019-12-11 11:24:37 +01:00
|
|
|
case kVideoCodecVP8:
|
|
|
|
|
return std::make_unique<VideoRtpDepacketizerVp8>();
|
2019-12-16 13:19:28 +01:00
|
|
|
case kVideoCodecVP9:
|
|
|
|
|
return std::make_unique<VideoRtpDepacketizerVp9>();
|
2019-12-23 13:14:28 +01:00
|
|
|
case kVideoCodecAV1:
|
2020-01-10 17:26:53 +01:00
|
|
|
return std::make_unique<VideoRtpDepacketizerAv1>();
|
2023-09-20 13:10:31 +08:00
|
|
|
case kVideoCodecH265:
|
2024-01-19 11:32:17 +08:00
|
|
|
#ifdef RTC_ENABLE_H265
|
|
|
|
|
return std::make_unique<VideoRtpDepacketizerH265>();
|
|
|
|
|
#else
|
2023-09-20 13:10:31 +08:00
|
|
|
return nullptr;
|
2024-01-19 11:32:17 +08:00
|
|
|
#endif
|
2019-12-23 13:14:28 +01:00
|
|
|
case kVideoCodecGeneric:
|
|
|
|
|
return std::make_unique<VideoRtpDepacketizerGeneric>();
|
2019-12-11 11:24:37 +01:00
|
|
|
}
|
2020-11-08 00:49:37 +01:00
|
|
|
RTC_CHECK_NOTREACHED();
|
2019-12-05 16:24:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|