tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

create_video_rtp_depacketizer.cc (1808B)


      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 #include "rtc_base/checks.h"
     23 #ifdef RTC_ENABLE_H265
     24 #include "modules/rtp_rtcp/source/video_rtp_depacketizer_h265.h"
     25 #endif
     26 
     27 namespace webrtc {
     28 
     29 std::unique_ptr<VideoRtpDepacketizer> CreateVideoRtpDepacketizer(
     30    VideoCodecType codec) {
     31  switch (codec) {
     32    case kVideoCodecH264:
     33      return std::make_unique<VideoRtpDepacketizerH264>();
     34    case kVideoCodecVP8:
     35      return std::make_unique<VideoRtpDepacketizerVp8>();
     36    case kVideoCodecVP9:
     37      return std::make_unique<VideoRtpDepacketizerVp9>();
     38    case kVideoCodecAV1:
     39      return std::make_unique<VideoRtpDepacketizerAv1>();
     40    case kVideoCodecH265:
     41 #ifdef RTC_ENABLE_H265
     42      return std::make_unique<VideoRtpDepacketizerH265>();
     43 #else
     44      return nullptr;
     45 #endif
     46    case kVideoCodecGeneric:
     47      return std::make_unique<VideoRtpDepacketizerGeneric>();
     48  }
     49  RTC_CHECK_NOTREACHED();
     50 }
     51 
     52 }  // namespace webrtc