00001 /* 00002 * PGMConverter 00003 * 00004 * Object to convert a MythPlayer frame into a greyscale image. 00005 */ 00006 00007 #ifndef __PGMCONVERTER_H__ 00008 #define __PGMCONVERTER_H__ 00009 00010 extern "C" { 00011 #include "libavcodec/avcodec.h" /* AVPicture */ 00012 } 00013 00014 typedef struct VideoFrame_ VideoFrame; 00015 class MythPlayer; 00016 00017 /* 00018 * PGM_CONVERT_GREYSCALE: 00019 * 00020 * If #define'd, perform a true greyscale conversion of "frame" in 00021 * PGMConverter::getImage . 00022 * 00023 * If #undef'd, just fake up a greyscale data structure. The "frame" data is 00024 * YUV data, and the Y channel is close enough for our purposes, and it's 00025 * faster than a full-blown true greyscale conversion. 00026 */ 00027 #define PGM_CONVERT_GREYSCALE 00028 00029 class PGMConverter 00030 { 00031 public: 00032 /* Ctor/dtor. */ 00033 PGMConverter(void); 00034 ~PGMConverter(void); 00035 00036 int MythPlayerInited(const MythPlayer *player); 00037 const AVPicture *getImage(const VideoFrame *frame, long long frameno, 00038 int *pwidth, int *pheight); 00039 int reportTime(void); 00040 00041 private: 00042 long long frameno; /* frame number */ 00043 int width, height; /* frame dimensions */ 00044 AVPicture pgm; /* grayscale frame */ 00045 #ifdef PGM_CONVERT_GREYSCALE 00046 struct timeval convert_time; 00047 bool time_reported; 00048 #endif /* PGM_CONVERT_GREYSCALE */ 00049 }; 00050 00051 #endif /* !__PGMCONVERTER_H__ */ 00052 00053 /* vim: set expandtab tabstop=4 shiftwidth=4: */
1.6.3