-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathFFTDecoder.h
More file actions
56 lines (45 loc) · 1.54 KB
/
FFTDecoder.h
File metadata and controls
56 lines (45 loc) · 1.54 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// FFTDecoder.h
// FFmpegTutorial-macOS
//
// Created by qianlongxu on 2022/7/27.
// Copyright © 2022 Matt Reach's Awesome FFmpeg Tutotial. All rights reserved.
//
// 自定义解码器类
// 通过代理衔接输入输出
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef struct AVStream AVStream;
typedef struct AVFormatContext AVFormatContext;
typedef struct AVPacket AVPacket;
typedef struct AVFrame AVFrame;
typedef struct AVRational AVRational;
@class FFTDecoder;
@protocol FFTDecoderDelegate <NSObject>
@required
///将解码后的 AVFrame 给 delegater
- (void)decoder:(FFTDecoder *)decoder reveivedAFrame:(AVFrame *)frame;
@optional
- (void)decoderEof:(FFTDecoder *)decoder;
@end
@interface FFTDecoder : NSObject
@property (nonatomic, assign) AVFormatContext *ic;
@property (nonatomic, assign) int streamIdx;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, weak) id <FFTDecoderDelegate> delegate;
@property (nonatomic, assign, readonly) AVStream * stream;
//for video is enum AVPixelFormat,for audio is enum AVSampleFormat,
@property (nonatomic, assign, readonly) int format;
@property (nonatomic, assign, readonly) int picWidth;
@property (nonatomic, assign, readonly) int picHeight;
@property (nonatomic, assign, readonly) AVRational frameRate;
@property (nonatomic, assign, readonly) int sampleRate;
@property (nonatomic, assign, readonly) int channelLayout;
/**
打开解码器,创建解码线程;
return 0;(没有错误)
*/
- (int)open;
- (int)sendPacket:(AVPacket *)pkt;
@end
NS_ASSUME_NONNULL_END