Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h

Issue 2987413002: ObjC: Implement HW codecs in ObjC instead of C++ (Closed)
Patch Set: Move RTCH264PacketizationMode to RTCVideoCodec.h Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h
diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h
index a5214ea6c88de7614badc48fefbbdea7f3cfb0bc..7f678b97594f5385c3dd65f99ec5e72ee70eb60c 100644
--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h
+++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h
@@ -18,9 +18,16 @@ NS_ASSUME_NONNULL_BEGIN
/** Represents an encoded frame's type. */
typedef NS_ENUM(NSUInteger, RTCFrameType) {
- RTCFrameTypeEmptyFrame,
- RTCFrameTypeVideoFrameKey,
- RTCFrameTypeVideoFrameDelta,
+ RTCFrameTypeEmptyFrame = 0,
+ RTCFrameTypeAudioFrameSpeech = 1,
+ RTCFrameTypeAudioFrameCN = 2,
+ RTCFrameTypeVideoFrameKey = 3,
+ RTCFrameTypeVideoFrameDelta = 4,
+};
+
+typedef NS_ENUM(NSUInteger, RTCVideoContentType) {
+ RTCVideoContentTypeUnspecified,
+ RTCVideoContentTypeScreenshare,
};
/** Represents an encoded frame. Corresponds to webrtc::EncodedImage. */
@@ -40,6 +47,7 @@ RTC_EXPORT
@property(nonatomic, assign) int rotation;
@property(nonatomic, assign) BOOL completeFrame;
@property(nonatomic, strong) NSNumber *qp;
+@property(nonatomic, assign) RTCVideoContentType contentType;
@end
@@ -62,14 +70,32 @@ RTC_EXPORT
@end
+/** Class for H264 specific config. */
+typedef NS_ENUM(NSUInteger, RTCH264PacketizationMode) {
+ RTCH264PacketizationModeNonInterleaved = 0, // Mode 1 - STAP-A, FU-A is allowed
+ RTCH264PacketizationModeSingleNalUnit // Mode 0 - only single NALU allowed
+};
+
+RTC_EXPORT
+@interface RTCCodecSpecificInfoH264 : NSObject<RTCCodecSpecificInfo>
+
+@property(nonatomic, assign) RTCH264PacketizationMode packetizationMode;
+
+@end
+
/** Callback block for encoder. */
-typedef void (^RTCVideoEncoderCallback)(RTCEncodedImage *frame,
+typedef BOOL (^RTCVideoEncoderCallback)(RTCEncodedImage *frame,
id<RTCCodecSpecificInfo> info,
RTCRtpFragmentationHeader *header);
/** Callback block for decoder. */
typedef void (^RTCVideoDecoderCallback)(RTCVideoFrame *frame);
+typedef NS_ENUM(NSUInteger, RTCVideoCodecMode) {
+ RTCVideoCodecModeRealtimeVideo,
+ RTCVideoCodecModeScreensharing,
+};
+
/** Holds information to identify a codec. Corresponds to cricket::VideoCodec. */
RTC_EXPORT
@interface RTCVideoCodecInfo : NSObject
@@ -101,6 +127,7 @@ RTC_EXPORT
@property(nonatomic, assign) uint32_t maxFramerate;
@property(nonatomic, assign) unsigned int qpMax;
+@property(nonatomic, assign) RTCVideoCodecMode mode;
@end
@@ -123,11 +150,10 @@ RTC_EXPORT
- (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores;
- (NSInteger)releaseEncoder;
-- (void)destroy;
- (NSInteger)encode:(RTCVideoFrame *)frame
codecSpecificInfo:(id<RTCCodecSpecificInfo>)info
frameTypes:(NSArray<NSNumber *> *)frameTypes;
-- (BOOL)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate;
+- (int)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate;
- (NSString *)implementationName;
/** Returns QP scaling settings for encoder. The quality scaler adjusts the resolution in order to
@@ -145,7 +171,6 @@ RTC_EXPORT
- (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores;
- (NSInteger)releaseDecoder;
-- (void)destroy;
- (NSInteger)decode:(RTCEncodedImage *)encodedImage
missingFrames:(BOOL)missingFrames
fragmentationHeader:(RTCRtpFragmentationHeader *)fragmentationHeader

Powered by Google App Engine
This is Rietveld 408576698