123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // FURecordEncoder.h
- // FULive
- //
- // Created by L on 2018/1/15.
- // Copyright © 2018年 L. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <AVFoundation/AVFoundation.h>
- /**
- * 写入并编码视频的的类
- */
- @interface FURecordEncoder : NSObject
- @property (nonatomic, readonly) NSString *path;
- /**
- * WCLRecordEncoder遍历构造器的
- *
- * @param path 媒体存发路径
- * @param cy 视频分辨率的高
- * @param cx 视频分辨率的宽
- * @param ch 音频通道
- * @param rate 音频的采样比率
- *
- * @return WCLRecordEncoder的实体
- */
- + (FURecordEncoder*)encoderForPath:(NSString*)path Height:(NSInteger)cy width:(NSInteger)cx channels: (int)ch samples:(Float64)rate;
- /**
- * 初始化方法
- *
- * @param path 媒体存发路径
- * @param cy 视频分辨率的高
- * @param cx 视频分辨率的宽
- * @param ch 音频通道
- * @param rate 音频的采样率
- *
- * @return WCLRecordEncoder的实体
- */
- - (instancetype)initPath:(NSString*)path Height:(NSInteger)cy width:(NSInteger)cx channels: (int)ch samples:(Float64)rate;
- /**
- * 完成视频录制时调用
- *
- * @param handler 完成的回掉block
- */
- - (void)finishWithCompletionHandler:(void (^)(void))handler;
- /**
- * 通过这个方法写入数据
- *
- * @param sampleBuffer 写入的数据
- * @param isVideo 是否写入的是视频
- *
- * @return 写入是否成功
- */
- - (BOOL)encodeFrame:(CMSampleBufferRef)sampleBuffer isVideo:(BOOL)isVideo;
- @end
|