houxiao
2017-08-17 0c3bba1a4d7b652807dfb74e1a31012802bd2987
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
38
39
40
41
42
43
44
45
46
47
#ifndef _PL_H264FILEFRAMER_H_
#define _PL_H264FILEFRAMER_H_
 
#include "PipeLine.h"
 
struct PL_H264FileFramer_Config
{
    char  sz_path[256];
    bool  b_loop_play;
 
    PL_H264FileFramer_Config() :
            b_loop_play(false)
    {
        memset(sz_path,0,256);
    }
};
 
class PL_H264FileFramer : public PipeLineElem
{
public:
    PL_H264FileFramer();
    virtual ~PL_H264FileFramer();
 
    virtual bool init(void* args);
    virtual void finit();
 
    virtual bool pay(const PipeMaterial& pm);
    virtual bool gain(PipeMaterial& pm);
    
private:
    void* internal;
    bool  m_b_loop_play;//#todo move to config
    std::string m_str_context;
    std::string m_str_old_context;
    std::string m_str_buf;
    int m_begin;
    long long m_current_time;
 
private:
    int write_file(const char*,const char*,int);
    int read_file(const char*);
    int analyse_context();
};
 
PipeLineElem* create_PL_H264FileFramer();
 
#endif