forked from corecode/spdif-loop
-
Notifications
You must be signed in to change notification settings - Fork 4
/
codechandler.h
37 lines (30 loc) · 981 Bytes
/
codechandler.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
/*
* codechandler.h
*
* Created on: 25.04.2015
* Author: sebastian
*/
#ifndef CODECHANDLER_H_
#define CODECHANDLER_H_
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/frame.h>
typedef struct s_codechandler{
AVCodecContext *codecContext;
AVCodec * codec;
enum AVCodecID currentCodecID;
int currentChannelCount;
uint64_t currentChannelLayout;
int currentSampleRate;
SwrContext * swr;
AVFrame * frame;
} CodecHandler;
void CodecHandler_init(CodecHandler* handler);
void CodecHandler_deinit(CodecHandler* handler);
int CodecHandler_loadCodec(CodecHandler * handler, AVFormatContext * formatcontext);
int CodecHandler_hasCodecChangend(CodecHandler * handler, AVFormatContext * formatcontext);
int CodecHandler_decodeCodec(CodecHandler * h, AVPacket * pkt,
uint8_t *outbuffer, uint32_t* bufferfilled);
int CodecHandler_closeCodec(CodecHandler * handler);
#endif /* CODECHANDLER_H_ */