mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Use factory to create encoder/decoder
This commit is contained in:
26
src/media/video/decode/nvcodec/nvidia_video_decoder.h
Normal file
26
src/media/video/decode/nvcodec/nvidia_video_decoder.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _NVIDIA_VIDEO_DECODER_H_
|
||||
#define _NVIDIA_VIDEO_DECODER_H_
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "NvDecoder.h"
|
||||
#include "video_decoder.h"
|
||||
|
||||
class NvidiaVideoDecoder : public VideoDecoder {
|
||||
public:
|
||||
NvidiaVideoDecoder();
|
||||
~NvidiaVideoDecoder();
|
||||
|
||||
public:
|
||||
int Init();
|
||||
int Decode(const uint8_t* data, int size,
|
||||
std::function<void(VideoFrame)> on_receive_decoded_frame);
|
||||
|
||||
private:
|
||||
NvDecoder* decoder = nullptr;
|
||||
bool get_first_keyframe_ = false;
|
||||
bool skip_frame_ = false;
|
||||
FILE* file_ = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user