shithub: openh264

ref: 8247eef9bb0962608f70ec217c3891d2018d8714
dir: /test/BaseDecoderTest.h/

View raw version
#ifndef __BASEDECODERTEST_H__
#define __BASEDECODERTEST_H__

#include <stdint.h>
#include <limits.h>
#include "codec_api.h"

class BaseDecoderTest {
 public:
  struct Plane {
    const uint8_t* data;
    int width;
    int height;
    int stride;
  };

  struct Frame {
    Plane y;
    Plane u;
    Plane v;
  };

  struct Callback {
    virtual void onDecodeFrame(const Frame& frame) = 0;
  };

  BaseDecoderTest();
  void SetUp();
  void TearDown();
  void DecodeFile(const char* fileName, Callback* cbk);

 private:
  void DecodeFrame(const uint8_t* src, int sliceSize, Callback* cbk);

  ISVCDecoder* decoder_;
};

#endif //__BASEDECODERTEST_H__