/*
 * PhotoCD Player plugin for VDR
 * pcd_mpeg.h: Generate MPEG still image
 *
 * See the README file for copyright information and how to reach the author.
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 * $Id$
 */

#ifndef __PCD_MPEG_H
#define __PCD_MPEG_H

#include <vdr/tools.h>
extern "C" {
#include <ffmpeg/avcodec.h>
};

#define TMP_WIDTH   768
#define TMP_HEIGHT  576
#define PAL_WIDTH   704
#define PAL_HEIGHT  576
#define NTSC_WIDTH  704
#define NTSC_HEIGHT 480

class cMpegFrame {
private:
  AVCodec *avCodec;
  AVCodecContext *avContext;
  AVFrame *avFrame;
  unsigned char *buffer;
  bool pal;
  int width, height;
  int bufferSize, mpegSize;
public:
  cMpegFrame(bool Pal);
  virtual ~cMpegFrame();
  void Encode(unsigned char *Image);
  unsigned char* Data(void) { return buffer; }
  int Size(void) { return mpegSize; }
  };

#endif //__PCD_MPEG_H
