-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstream_decoder.h
49 lines (35 loc) · 995 Bytes
/
stream_decoder.h
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
//
// Created by jun on 17-1-7.
//
#ifndef STREAMDECODER_STREAM_DECODER_H
#define STREAMDECODER_STREAM_DECODER_H
#include <stdint.h>
typedef struct StreamDecoder_T StreamDecoder;
typedef struct {
uint32_t size;
uint8_t *data;
} ENCFrame;
typedef struct {
int32_t width;
int32_t height;
uint32_t size;
uint8_t *data;
} RGBFrame;
enum STREAM_TYPE {
STREAM_TYPE_NONE,
STREAM_TYPE_H264,
STREAM_TYPE_HEVC,
#define STREAM_TYPE_H265 STREAM_TYPE_HEVC
STREAM_TYPE_END,
};
enum PIXEL_FORMAT {
PIXEL_FORMAT_NONE,
PIXEL_FORMAT_BGR24,
PIXEL_FORMAT_RGB24,
PIXEL_FORMAT_END,
};
int stream_decoder_alloc(StreamDecoder **decoder, int stream_type, int pixel_fmt);
void stream_decoder_free(StreamDecoder *decoder);
/* maybe return a upside down picture, you should rotate yourself */
int stream_decoder_process_frame(StreamDecoder *decoder, ENCFrame* enc_frame, RGBFrame* dec_frame, int is_first_frame);
#endif //STREAMDECODER_STREAM_DECODER_H