mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
31 lines
635 B
C++
31 lines
635 B
C++
#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();
|
|
virtual ~NvidiaVideoDecoder();
|
|
|
|
public:
|
|
int Init();
|
|
|
|
int Decode(const uint8_t* data, size_t size,
|
|
std::function<void(VideoFrame)> on_receive_decoded_frame);
|
|
|
|
std::string GetDecoderName() { return "NvidiaH264"; }
|
|
|
|
private:
|
|
NvDecoder* decoder = nullptr;
|
|
bool get_first_keyframe_ = false;
|
|
bool skip_frame_ = false;
|
|
|
|
FILE* file_h264_ = nullptr;
|
|
FILE* file_nv12_ = nullptr;
|
|
};
|
|
|
|
#endif |