forked from AgoraIO/API-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMediaUtils.h
More file actions
27 lines (18 loc) · 752 Bytes
/
MediaUtils.h
File metadata and controls
27 lines (18 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// MediaUtils.h
// APIExample
//
// Created by Arlin on 2022/4/12.
// Copyright © 2022 Agora Corp. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MediaUtils : NSObject
+ (CVPixelBufferRef)i420ToPixelBuffer:(void *)srcY srcU:(void *)srcU srcV:(void *)srcV width:(int)width height:(int)height;
+ (NSData *)dataFromPixelBuffer:(CVPixelBufferRef)pixelBuffer;
+ (nullable UIImage *)i420ToImage:(nullable void *)srcY srcU:(nullable void *)srcU srcV:(nullable void *)srcV width:(int)width height:(int)height;
+ (nullable UIImage *)pixelBufferToImage:(CVPixelBufferRef)pixelBuffer;
+ (CVPixelBufferRef)CVPixelBufferRefFromUiImage:(UIImage *)img;
@end
NS_ASSUME_NONNULL_END