MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
PGMConverter.h
Go to the documentation of this file.
1 /*
2  * PGMConverter
3  *
4  * Object to convert a MythPlayer frame into a greyscale image.
5  */
6 
7 #ifndef __PGMCONVERTER_H__
8 #define __PGMCONVERTER_H__
9 
10 extern "C" {
11 #include "libavcodec/avcodec.h" /* AVPicture */
12 }
13 
14 typedef struct VideoFrame_ VideoFrame;
15 class MythPlayer;
16 
17 /*
18  * PGM_CONVERT_GREYSCALE:
19  *
20  * If #define'd, perform a true greyscale conversion of "frame" in
21  * PGMConverter::getImage .
22  *
23  * If #undef'd, just fake up a greyscale data structure. The "frame" data is
24  * YUV data, and the Y channel is close enough for our purposes, and it's
25  * faster than a full-blown true greyscale conversion.
26  */
27 #define PGM_CONVERT_GREYSCALE
28 
30 {
31 public:
32  /* Ctor/dtor. */
33  PGMConverter(void);
34  ~PGMConverter(void);
35 
36  int MythPlayerInited(const MythPlayer *player);
37  const AVPicture *getImage(const VideoFrame *frame, long long frameno,
38  int *pwidth, int *pheight);
39  int reportTime(void);
40 
41 private:
42  long long frameno; /* frame number */
43  int width, height; /* frame dimensions */
44  AVPicture pgm; /* grayscale frame */
45 #ifdef PGM_CONVERT_GREYSCALE
46  struct timeval convert_time;
48 #endif /* PGM_CONVERT_GREYSCALE */
49 };
50 
51 #endif /* !__PGMCONVERTER_H__ */
52 
53 /* vim: set expandtab tabstop=4 shiftwidth=4: */