#ifndef _cffmpeg_decoder_hpp_
|
#define _cffmpeg_decoder_hpp_
|
|
#include <stdint.h>
|
#include <memory>
|
#include <list>
|
#include <mutex>
|
|
namespace ffwrapper
|
{
|
class FormatIn;
|
class cvbridge;
|
class CodedData;
|
} // namespace ffwrapper
|
|
namespace cffmpeg_wrap
|
{
|
typedef struct _pic_bgr24{
|
unsigned char *data;
|
int w;
|
int h;
|
|
int64_t id;
|
}BGR24;
|
|
class decoder
|
{
|
private:
|
ffwrapper::cvbridge *conv_;
|
int conv_w_, conv_h_, conv_flag_;
|
|
ffwrapper::FormatIn *decRef_;
|
|
std::list<BGR24> list_pic_;
|
std::mutex mutex_pic_;
|
|
private:
|
int initDecoder();
|
public:
|
int SetFrame(std::shared_ptr<ffwrapper::CodedData> data, int64_t &id);
|
void GetFrame(unsigned char **data, int *w, int *h, int64_t *id);
|
public:
|
decoder(ffwrapper::FormatIn *dec, const int w, const int h, const int f);
|
~decoder();
|
};
|
|
} // namespace cffmpeg_wrap
|
|
|
#endif
|