• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2019 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 #include "modules/rtp_rtcp/source/create_video_rtp_depacketizer.h"
12 
13 #include <memory>
14 
15 #include "api/video/video_codec_type.h"
16 #include "modules/rtp_rtcp/source/video_rtp_depacketizer.h"
17 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_av1.h"
18 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_generic.h"
19 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_h264.h"
20 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_vp8.h"
21 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_vp9.h"
22 
23 namespace webrtc {
24 
CreateVideoRtpDepacketizer(VideoCodecType codec)25 std::unique_ptr<VideoRtpDepacketizer> CreateVideoRtpDepacketizer(
26     VideoCodecType codec) {
27   switch (codec) {
28     case kVideoCodecH264:
29       return std::make_unique<VideoRtpDepacketizerH264>();
30     case kVideoCodecVP8:
31       return std::make_unique<VideoRtpDepacketizerVp8>();
32     case kVideoCodecVP9:
33       return std::make_unique<VideoRtpDepacketizerVp9>();
34     case kVideoCodecAV1:
35       return std::make_unique<VideoRtpDepacketizerAv1>();
36     case kVideoCodecGeneric:
37     case kVideoCodecMultiplex:
38       return std::make_unique<VideoRtpDepacketizerGeneric>();
39   }
40 }
41 
42 }  // namespace webrtc
43