frame_transformer_factory.cc (1595B)
1 /* 2 * Copyright 2022 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 "api/frame_transformer_factory.h" 12 13 #include <memory> 14 15 #include "api/frame_transformer_interface.h" 16 #include "audio/channel_receive_frame_transformer_delegate.h" 17 #include "audio/channel_send_frame_transformer_delegate.h" 18 #include "modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.h" 19 #include "rtc_base/checks.h" 20 21 namespace webrtc { 22 23 std::unique_ptr<TransformableVideoFrameInterface> CreateVideoSenderFrame() { 24 RTC_CHECK_NOTREACHED(); 25 return nullptr; 26 } 27 28 std::unique_ptr<TransformableVideoFrameInterface> CreateVideoReceiverFrame() { 29 RTC_CHECK_NOTREACHED(); 30 return nullptr; 31 } 32 33 std::unique_ptr<TransformableAudioFrameInterface> CloneAudioFrame( 34 TransformableAudioFrameInterface* original) { 35 if (original->GetDirection() == 36 TransformableAudioFrameInterface::Direction::kReceiver) 37 return CloneReceiverAudioFrame(original); 38 return CloneSenderAudioFrame(original); 39 } 40 41 std::unique_ptr<TransformableVideoFrameInterface> CloneVideoFrame( 42 TransformableVideoFrameInterface* original) { 43 // At the moment, only making sender frames from receiver frames is 44 // supported. 45 return CloneSenderVideoFrame(original); 46 } 47 48 } // namespace webrtc