BlueGit

ict rusty-teams

Files

rusty-teams / vendor / webrtc-sys / src / objc_video_factory.mm

objc_video_factory.mm

objc_video_factory.mm 1.6 KiB Download Raw
1/*
2 * Copyright 2025 LiveKit, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "livekit/objc_video_factory.h"
18
19#import <sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h>
20#import <sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h>
21#import <sdk/objc/components/video_codec/RTCVideoEncoderFactorySimulcast.h>
22#include "sdk/objc/native/api/video_decoder_factory.h"
23#include "sdk/objc/native/api/video_encoder_factory.h"
24
25namespace livekit_ffi {
26
27std::unique_ptr<webrtc::VideoEncoderFactory> CreateObjCVideoEncoderFactory() {
28 RTC_OBJC_TYPE(RTCDefaultVideoEncoderFactory)* encoderFactory = [[RTC_OBJC_TYPE(RTCDefaultVideoEncoderFactory) alloc] init];
29 RTC_OBJC_TYPE(RTCVideoEncoderFactorySimulcast)* simulcastFactory =
30 [[RTC_OBJC_TYPE(RTCVideoEncoderFactorySimulcast) alloc] initWithPrimary:encoderFactory fallback:encoderFactory];
31 return webrtc::ObjCToNativeVideoEncoderFactory(simulcastFactory);
32}
33
34std::unique_ptr<webrtc::VideoDecoderFactory> CreateObjCVideoDecoderFactory() {
35 return webrtc::ObjCToNativeVideoDecoderFactory([[RTC_OBJC_TYPE(RTCDefaultVideoDecoderFactory) alloc] init]);
36}
37
38} // namespace livekit_ffi