blob: d4dbf88f2b66e3a4934a1979b85c1a7259b7e695 [file] [log] [blame]
kthelgasonfb143122017-07-25 07:55:58 -07001/*
2 * Copyright 2017 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#import <Foundation/Foundation.h>
12
13#import <WebRTC/RTCMacros.h>
14#import <WebRTC/RTCVideoCodecFactory.h>
15
Anders Carlsson7e042812017-10-05 16:55:38 +020016/** Class for H264 specific config. */
17typedef NS_ENUM(NSUInteger, RTCH264PacketizationMode) {
18 RTCH264PacketizationModeNonInterleaved = 0, // Mode 1 - STAP-A, FU-A is allowed
19 RTCH264PacketizationModeSingleNalUnit // Mode 0 - only single NALU allowed
20};
21
22RTC_EXPORT
23@interface RTCCodecSpecificInfoH264 : NSObject <RTCCodecSpecificInfo>
24
25@property(nonatomic, assign) RTCH264PacketizationMode packetizationMode;
26
27@end
28
Anders Carlsson79ce8202018-06-01 12:51:09 +020029/** H264 Profiles and levels. */
30typedef NS_ENUM(NSUInteger, RTCH264Profile) {
31 RTCH264ProfileConstrainedBaseline,
32 RTCH264ProfileBaseline,
33 RTCH264ProfileMain,
34 RTCH264ProfileConstrainedHigh,
35 RTCH264ProfileHigh,
36};
37
38typedef NS_ENUM(NSUInteger, RTCH264Level) {
39 RTCH264Level1_b = 0,
40 RTCH264Level1 = 10,
41 RTCH264Level1_1 = 11,
42 RTCH264Level1_2 = 12,
43 RTCH264Level1_3 = 13,
44 RTCH264Level2 = 20,
45 RTCH264Level2_1 = 21,
46 RTCH264Level2_2 = 22,
47 RTCH264Level3 = 30,
48 RTCH264Level3_1 = 31,
49 RTCH264Level3_2 = 32,
50 RTCH264Level4 = 40,
51 RTCH264Level4_1 = 41,
52 RTCH264Level4_2 = 42,
53 RTCH264Level5 = 50,
54 RTCH264Level5_1 = 51,
55 RTCH264Level5_2 = 52
56};
57
58RTC_EXPORT
59@interface RTCH264ProfileLevelId : NSObject
60
61@property(nonatomic, readonly) RTCH264Profile profile;
62@property(nonatomic, readonly) RTCH264Level level;
63@property(nonatomic, readonly) NSString *hexString;
64
65- (instancetype)initWithHexString:(NSString *)hexString;
66- (instancetype)initWithProfile:(RTCH264Profile)profile level:(RTCH264Level)level;
67
68@end
69
kthelgasonfb143122017-07-25 07:55:58 -070070/** Encoder. */
71RTC_EXPORT
Yves Gerey665174f2018-06-19 15:03:05 +020072@interface RTCVideoEncoderH264 : NSObject <RTCVideoEncoder>
magjed73c0eb52017-08-07 06:55:28 -070073
74- (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo;
75
kthelgasonfb143122017-07-25 07:55:58 -070076@end
77
78/** Decoder. */
79RTC_EXPORT
Yves Gerey665174f2018-06-19 15:03:05 +020080@interface RTCVideoDecoderH264 : NSObject <RTCVideoDecoder>
kthelgasonfb143122017-07-25 07:55:58 -070081@end
82
83/** Encoder factory. */
84RTC_EXPORT
Yves Gerey665174f2018-06-19 15:03:05 +020085@interface RTCVideoEncoderFactoryH264 : NSObject <RTCVideoEncoderFactory>
kthelgasonfb143122017-07-25 07:55:58 -070086@end
87
88/** Decoder factory. */
89RTC_EXPORT
Yves Gerey665174f2018-06-19 15:03:05 +020090@interface RTCVideoDecoderFactoryH264 : NSObject <RTCVideoDecoderFactory>
kthelgasonfb143122017-07-25 07:55:58 -070091@end