00001 #ifndef VIDEOOUT_IVTV_H_
00002 #define VIDEOOUT_IVTV_H_
00003
00004 #include <qstring.h>
00005 #include <qmutex.h>
00006
00007 #include "videooutbase.h"
00008
00009 class NuppelVideoPlayer;
00010 class VideoOutputIvtvPriv;
00011
00012 class VideoOutputIvtv: public VideoOutput
00013 {
00014 public:
00015 VideoOutputIvtv();
00016 ~VideoOutputIvtv();
00017
00018 bool Init(int width, int height, float aspect, WId winid,
00019 int winx, int winy, int winw, int winh, WId embedid = 0);
00020 void PrepareFrame(VideoFrame *buffer, FrameScanType);
00021 void Show(FrameScanType );
00022
00023 bool InputChanged(const QSize &input_size,
00024 float aspect,
00025 MythCodecID av_codec_id,
00026 void *codec_private);
00027
00028 int GetRefreshRate(void);
00029
00030 void DrawUnusedRects(bool sync = true);
00031
00032 void UpdatePauseFrame(void);
00033 void ProcessFrame(VideoFrame *frame, OSD *osd,
00034 FilterChain *filterList,
00035 NuppelVideoPlayer *pipPlayer);
00036
00037 uint WriteBuffer(unsigned char *buf, int count);
00038 int Poll(int delay);
00039 void Pause(void);
00040 void Start(int skip, int mute);
00041 void Stop(bool hide);
00042
00043 void Open(void);
00044 void Close(void);
00045
00046 void SetFPS(float lfps) { fps = lfps; }
00047
00048 void ClearOSD(void);
00049
00050 bool Play(float speed, bool normal, int mask);
00051 bool Play(void) { return Play(last_speed, last_normal, last_mask); };
00052 void NextPlay(float speed, bool normal, int mask)
00053 { last_speed = speed; last_normal = normal; last_mask = mask; };
00054 void Flush(void);
00055 void Step(void);
00056 long long GetFramesPlayed(void);
00057
00058 VideoFrame *GetNextFreeFrame(bool with_lock = false,
00059 bool allow_unsafe = false)
00060 {
00061 (void) with_lock;
00062 (void) allow_unsafe;
00063 return NULL;
00064 }
00065
00066 int ValidVideoFrames(void) const;
00067
00068 static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
00069 const QSize &video_dim);
00070
00071 private:
00072 typedef enum
00073 {
00074 kAlpha_Solid,
00075 kAlpha_Local,
00076 kAlpha_Clear,
00077 kAlpha_Embedded
00078 } eAlphaState;
00079
00080 void ShowPip(VideoFrame *frame, NuppelVideoPlayer *pipplayer);
00081 void SetAlpha(eAlphaState newAlpha);
00082 void SetColorKey(int state, int color);
00083 long long GetFirmwareFramesPlayed(void);
00084
00085 int videofd;
00086 int fbfd;
00087
00088 float fps;
00089 QString videoDevice;
00090 unsigned int driver_version;
00091 bool has_v4l2_api;
00092 bool has_pause_bug;
00093
00094 QMutex lock;
00095
00096 int mapped_offset;
00097 int mapped_memlen;
00098 char *mapped_mem;
00099 char *pixels;
00100
00101 int stride;
00102
00103 bool lastcleared;
00104 bool pipon;
00105 bool osdon;
00106
00107 char *osdbuffer;
00108 char *osdbuf_aligned;
00109 int osdbufsize;
00110 int osdbuf_revision;
00111
00112 float last_speed;
00113 int internal_offset;
00114 int frame_at_speed_change;
00115
00116 bool last_normal;
00117 int last_mask;
00118 eAlphaState alphaState;
00119
00120 bool old_fb_ioctl;
00121 int fb_dma_ioctl;
00122 bool color_key;
00123 bool decoder_flush;
00124
00125 bool paused;
00126
00127 VideoOutputIvtvPriv *priv;
00128 };
00129
00130 #endif