Blame view

src/FFNvDecoder.h 1.17 KB
aac5773f   hucm   功能基本完成,接口待打磨
1
2
3
4
5
  #include<string>
  #include <pthread.h>
  
  #include "FrameQueue.h"
  
3d2ab595   Hu Chunming   支持gb28181
6
  #include "AbstractDecoder.h"
aac5773f   hucm   功能基本完成,接口待打磨
7
8
9
  
  using namespace std;
  
3d2ab595   Hu Chunming   支持gb28181
10
  class FFNvDecoder : public AbstractDecoder{
aac5773f   hucm   功能基本完成,接口待打磨
11
12
13
  public:
      FFNvDecoder();
      ~FFNvDecoder();
e96e6489   Hu Chunming   优化代码;添加isRunning函数
14
      bool init(FFDecConfig& cfg);
aac5773f   hucm   功能基本完成,接口待打磨
15
      void close();
3d2ab595   Hu Chunming   支持gb28181
16
      bool start();
aac5773f   hucm   功能基本完成,接口待打磨
17
18
19
      void pause();
      void resume();
  
bc52e542   Hu Chunming   添加关键帧解码功能
20
21
      void setDecKeyframe(bool bKeyframe);
  
aac5773f   hucm   功能基本完成,接口待打磨
22
      bool isRunning();
48330793   Hu Chunming   修正解码线程自然结束时解码器内存没...
23
      bool isFinished();
3c7e3e11   Hu Chunming   1.修改日志
24
      bool isPausing();
aac5773f   hucm   功能基本完成,接口待打磨
25
26
      bool getResolution( int &width, int &height );
  
0573bd98   Hu Chunming   优化代码;添加注释
27
28
      bool isSurport(FFDecConfig& cfg);
  
3c7e3e11   Hu Chunming   1.修改日志
29
30
      int getCachedQueueLength();
  
3d2ab595   Hu Chunming   支持gb28181
31
      float fps();
3c7e3e11   Hu Chunming   1.修改日志
32
  
3d2ab595   Hu Chunming   支持gb28181
33
      DECODER_TYPE getDecoderType(){ return DECODER_TYPE_FFMPEG; }
3c7e3e11   Hu Chunming   1.修改日志
34
  
aac5773f   hucm   功能基本完成,接口待打磨
35
36
37
38
39
40
  public:
      AVPixelFormat getHwPixFmt();
  
  private:
      void decode_thread();
      void post_decode_thread();
e96e6489   Hu Chunming   优化代码;添加isRunning函数
41
      bool init(const char* uri, const char* gpuid, bool force_tcp);
48330793   Hu Chunming   修正解码线程自然结束时解码器内存没...
42
      void decode_finished();
aac5773f   hucm   功能基本完成,接口待打磨
43
  
aac5773f   hucm   功能基本完成,接口待打磨
44
45
46
47
48
49
50
51
52
53
54
  private:
      AVStream* stream;
      AVCodecContext *avctx;
      int stream_index;
      AVFormatContext *fmt_ctx;
      AVPixelFormat hw_pix_fmt;
  
      pthread_t m_decode_thread;
      pthread_t m_post_decode_thread;
      
      bool m_bRunning;
48330793   Hu Chunming   修正解码线程自然结束时解码器内存没...
55
      bool m_bFinished;
aac5773f   hucm   功能基本完成,接口待打磨
56
57
58
  
      bool m_bPause;
      FrameQueue mFrameQueue;
8c180bab   hucm   添加是否实时流判断
59
60
  
      bool m_bReal; // 是否实时流
bc52e542   Hu Chunming   添加关键帧解码功能
61
  
3d2ab595   Hu Chunming   支持gb28181
62
      float m_fps;
aac5773f   hucm   功能基本完成,接口待打磨
63
  };