添加音频结构, 添加MediaParam, 增加bugList
This commit is contained in:
0
include/audioDecoder.h
Normal file
0
include/audioDecoder.h
Normal file
@@ -1,14 +1,5 @@
|
||||
#ifndef DECODER_H
|
||||
#define DECODER_H
|
||||
extern "C" {
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
}
|
||||
#include <queue>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#ifndef DECODEPARAM_H
|
||||
#define DECODEPARAM_H
|
||||
template<typename T>
|
||||
requires std::is_same_v<T, AVPacket> || std::is_same_v<T, AVFrame>
|
||||
struct MediaQueue
|
||||
@@ -103,7 +94,23 @@ struct VideoParam
|
||||
bool quit = false;
|
||||
};
|
||||
|
||||
void InitDecoder(const char* filepath, VideoParam& param);
|
||||
void RequestPacket(VideoParam& param);
|
||||
void RequestFrame(VideoParam& param);
|
||||
struct AudioParam
|
||||
{
|
||||
MediaQueue<AVPacket> packetQueue;
|
||||
MediaQueue<AVFrame> frameQueue;
|
||||
AVFormatContext* fmtCtx;
|
||||
AVCodecContext* codecCtx;
|
||||
int audioStreamIndex;
|
||||
|
||||
bool eof = false;
|
||||
|
||||
bool pause = false;
|
||||
bool quit = false;
|
||||
};
|
||||
|
||||
struct MediaParam
|
||||
{
|
||||
VideoParam videoParam;
|
||||
AudioParam audioParam;
|
||||
};
|
||||
#endif
|
||||
17
include/mediaDecoder.h
Normal file
17
include/mediaDecoder.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef DECODER_H
|
||||
#define DECODER_H
|
||||
extern "C" {
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
}
|
||||
#include <queue>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
#include "decodeParam.h"
|
||||
|
||||
void InitDecoder(const char* filepath, VideoParam& param);
|
||||
void RequestPacket(MediaParam& param);
|
||||
void RequestVideoFrame(MediaParam& param);
|
||||
#endif
|
||||
Reference in New Issue
Block a user