VideoOutputIvtv Class Reference

#include <videoout_ivtv.h>

Inheritance diagram for VideoOutputIvtv:

VideoOutput

List of all members.


Detailed Description

Implementation of video output for the Hauppage PVR 350 cards.

Definition at line 12 of file videoout_ivtv.h.


Public Member Functions

 VideoOutputIvtv ()
 ~VideoOutputIvtv ()
bool Init (int width, int height, float aspect, WId winid, int winx, int winy, int winw, int winh, WId embedid=0)
 Performs most of the initialization for VideoOutput.
void PrepareFrame (VideoFrame *buffer, FrameScanType)
void Show (FrameScanType)
bool InputChanged (const QSize &input_size, float aspect, MythCodecID av_codec_id, void *codec_private)
 Tells video output to discard decoded frames and wait for new ones.
int GetRefreshRate (void)
 Returns current display's frame refresh period in microseconds.
void DrawUnusedRects (bool sync=true)
 Draws non-video portions of the screen.
void UpdatePauseFrame (void)
 Updates frame displayed when video is paused.
void ProcessFrame (VideoFrame *frame, OSD *osd, FilterChain *filterList, NuppelVideoPlayer *pipPlayer)
uint WriteBuffer (unsigned char *buf, int count)
 Writes data to the decoder device.
int Poll (int delay)
 Waits for decoder to be ready for more data.
void Pause (void)
 Pauses decoding.
void Start (int skip, int mute)
 Start decoding.
void Stop (bool hide)
 Stops decoding.
void Open (void)
 Opens decoder device.
void Close (void)
 Closes decoder device.
void SetFPS (float lfps)
void ClearOSD (void)
bool Play (float speed, bool normal, int mask)
 Initializes decoder parameters.
bool Play (void)
void NextPlay (float speed, bool normal, int mask)
void Flush (void)
 Flushes out data already sent to decoder.
void Step (void)
 Step through video one frame at a time.
long long GetFramesPlayed (void)
 Returns number of frames played since last reset.
VideoFrameGetNextFreeFrame (bool with_lock=false, bool allow_unsafe=false)
 Blocks until it is possible to return a frame for decoding onto.
int ValidVideoFrames (void) const
 Returns number of frames that are fully decoded.

Static Public Member Functions

static QStringList GetAllowedRenderers (MythCodecID myth_codec_id, const QSize &video_dim)

Private Types

enum  eAlphaState { kAlpha_Solid, kAlpha_Local, kAlpha_Clear, kAlpha_Embedded }

Private Member Functions

void ShowPip (VideoFrame *frame, NuppelVideoPlayer *pipplayer)
 Composites PiP image onto a video frame.
void SetAlpha (eAlphaState newAlpha)
void SetColorKey (int state, int color)
long long GetFirmwareFramesPlayed (void)
 Returns number of frames decoded as reported by decoder.

Private Attributes

int videofd
int fbfd
float fps
QString videoDevice
unsigned int driver_version
bool has_v4l2_api
bool has_pause_bug
QMutex lock
int mapped_offset
int mapped_memlen
char * mapped_mem
char * pixels
int stride
bool lastcleared
bool pipon
bool osdon
char * osdbuffer
char * osdbuf_aligned
int osdbufsize
int osdbuf_revision
float last_speed
int internal_offset
int frame_at_speed_change
bool last_normal
int last_mask
eAlphaState alphaState
bool old_fb_ioctl
int fb_dma_ioctl
bool color_key
bool decoder_flush
bool paused
VideoOutputIvtvPrivpriv

Member Enumeration Documentation

Enumerator:
kAlpha_Solid 
kAlpha_Local 
kAlpha_Clear 
kAlpha_Embedded 

Definition at line 72 of file videoout_ivtv.h.


Constructor & Destructor Documentation

VideoOutputIvtv::VideoOutputIvtv ( void   ) 

Definition at line 117 of file videoout_ivtv.cpp.

VideoOutputIvtv::~VideoOutputIvtv (  ) 

Definition at line 146 of file videoout_ivtv.cpp.


Member Function Documentation

bool VideoOutputIvtv::Init ( int  width,
int  height,
float  aspect,
WId  winid,
int  winx,
int  winy,
int  winw,
int  winh,
WId  embedid = 0 
) [virtual]

Performs most of the initialization for VideoOutput.

Returns:
true if successful, false otherwise.

Reimplemented from VideoOutput.

Definition at line 406 of file videoout_ivtv.cpp.

void VideoOutputIvtv::PrepareFrame ( VideoFrame buffer,
FrameScanType  t 
) [virtual]

Implements VideoOutput.

Definition at line 674 of file videoout_ivtv.cpp.

void VideoOutputIvtv::Show ( FrameScanType   )  [virtual]

Implements VideoOutput.

Definition at line 680 of file videoout_ivtv.cpp.

bool VideoOutputIvtv::InputChanged ( const QSize &  input_size,
float  aspect,
MythCodecID  myth_codec_id,
void *  codec_private 
) [virtual]

Tells video output to discard decoded frames and wait for new ones.

Bug:
We set the new width height and aspect ratio here, but we should do this based on the new video frames in Show().

Reimplemented from VideoOutput.

Definition at line 384 of file videoout_ivtv.cpp.

int VideoOutputIvtv::GetRefreshRate ( void   )  [virtual]

Returns current display's frame refresh period in microseconds.

e.g. 1000000 / frame_rate_in_Hz

Implements VideoOutput.

Definition at line 396 of file videoout_ivtv.cpp.

void VideoOutputIvtv::DrawUnusedRects ( bool  sync = true  )  [virtual]

Draws non-video portions of the screen.

Parameters:
sync if set any queued up draws are sent immediately to the graphics context and we block until they have completed.

Implements VideoOutput.

Definition at line 684 of file videoout_ivtv.cpp.

void VideoOutputIvtv::UpdatePauseFrame ( void   )  [virtual]

Updates frame displayed when video is paused.

Implements VideoOutput.

Definition at line 688 of file videoout_ivtv.cpp.

void VideoOutputIvtv::ProcessFrame ( VideoFrame frame,
OSD osd,
FilterChain filterList,
NuppelVideoPlayer pipPlayer 
) [virtual]

Implements VideoOutput.

Definition at line 779 of file videoout_ivtv.cpp.

uint VideoOutputIvtv::WriteBuffer ( unsigned char *  buf,
int  count 
)

Writes data to the decoder device.

Parameters:
buf buffer to write to the decoder
len number of bytes to write
Returns:
actual number of bytes written

Definition at line 1053 of file videoout_ivtv.cpp.

Referenced by IvtvDecoder::ReadWrite().

int VideoOutputIvtv::Poll ( int  delay  ) 

Waits for decoder to be ready for more data.

Parameters:
delay milliseconds to wait before timing out.
Returns:
value returned by POSIX poll() function

Definition at line 1030 of file videoout_ivtv.cpp.

Referenced by IvtvDecoder::ReadWrite().

void VideoOutputIvtv::Pause ( void   ) 

Pauses decoding.

Definition at line 999 of file videoout_ivtv.cpp.

Referenced by NuppelVideoPlayer::DoPause(), IvtvDecoder::SeekReset(), and IvtvDecoder::StepFrames().

void VideoOutputIvtv::Start ( int  skip,
int  mute 
)

Start decoding.

Parameters:
skip Sets GOP offset
mute If true mutes audio

Definition at line 922 of file videoout_ivtv.cpp.

Referenced by IvtvDecoder::ReadWrite(), and IvtvDecoder::SeekReset().

void VideoOutputIvtv::Stop ( bool  hide  ) 

Stops decoding.

Parameters:
hide If true we hide the last video decoded frame.

Definition at line 960 of file videoout_ivtv.cpp.

Referenced by Close(), IvtvDecoder::ReadWrite(), and IvtvDecoder::SeekReset().

void VideoOutputIvtv::Open ( void   ) 

Opens decoder device.

Definition at line 632 of file videoout_ivtv.cpp.

Referenced by Init().

void VideoOutputIvtv::Close ( void   ) 

Closes decoder device.

Definition at line 594 of file videoout_ivtv.cpp.

Referenced by ~VideoOutputIvtv().

void VideoOutputIvtv::SetFPS ( float  lfps  )  [inline]

Definition at line 46 of file videoout_ivtv.h.

Referenced by NuppelVideoPlayer::IvtvVideoLoop().

void VideoOutputIvtv::ClearOSD ( void   ) 

Definition at line 163 of file videoout_ivtv.cpp.

Referenced by Close(), and Init().

bool VideoOutputIvtv::Play ( float  speed,
bool  normal,
int  mask 
)

Initializes decoder parameters.

Definition at line 1115 of file videoout_ivtv.cpp.

Referenced by NuppelVideoPlayer::DoPlay(), IvtvDecoder::ReadWrite(), and IvtvDecoder::SeekReset().

bool VideoOutputIvtv::Play ( void   )  [inline]

Definition at line 51 of file videoout_ivtv.h.

void VideoOutputIvtv::NextPlay ( float  speed,
bool  normal,
int  mask 
) [inline]

Definition at line 52 of file videoout_ivtv.h.

Referenced by NuppelVideoPlayer::DoPlay().

void VideoOutputIvtv::Flush ( void   ) 

Flushes out data already sent to decoder.

Definition at line 1179 of file videoout_ivtv.cpp.

Referenced by IvtvDecoder::ReadWrite(), and IvtvDecoder::SeekReset().

void VideoOutputIvtv::Step ( void   ) 

Step through video one frame at a time.

Definition at line 1193 of file videoout_ivtv.cpp.

Referenced by IvtvDecoder::StepFrames().

long long VideoOutputIvtv::GetFramesPlayed ( void   )  [virtual]

Returns number of frames played since last reset.

This adjust the value returned by GetFirmwareFramesPlayed(void) to report the number of frames played since playback started irrespective of current and past playback speeds.

Reimplemented from VideoOutput.

Definition at line 1105 of file videoout_ivtv.cpp.

Referenced by Play(), IvtvDecoder::SeekReset(), IvtvDecoder::StepFrames(), and IvtvDecoder::UpdateFramesPlayed().

VideoFrame* VideoOutputIvtv::GetNextFreeFrame ( bool  with_lock = false,
bool  allow_unsafe = false 
) [inline, virtual]

Blocks until it is possible to return a frame for decoding onto.

Parameters:
with_lock if true frames are properly locked, but this means you must unlock them when you are done, so this is disabled by default.
allow_unsafe if true then that are queued for display can be returned as frames to decode onto, this defaults to false.

Reimplemented from VideoOutput.

Definition at line 58 of file videoout_ivtv.h.

int VideoOutputIvtv::ValidVideoFrames ( void   )  const [virtual]

Returns number of frames that are fully decoded.

Reimplemented from VideoOutput.

Definition at line 401 of file videoout_ivtv.cpp.

QStringList VideoOutputIvtv::GetAllowedRenderers ( MythCodecID  myth_codec_id,
const QSize &  video_dim 
) [static]

Definition at line 1221 of file videoout_ivtv.cpp.

Referenced by VideoOutput::Create().

void VideoOutputIvtv::ShowPip ( VideoFrame frame,
NuppelVideoPlayer pipplayer 
) [private, virtual]

Composites PiP image onto a video frame.

Note: This only works with memory backed VideoFrames, that is not XvMC.

Parameters:
frame Frame to composite PiP onto.
pipplayer Picture-in-Picture NVP.

Reimplemented from VideoOutput.

Definition at line 692 of file videoout_ivtv.cpp.

Referenced by ProcessFrame().

void VideoOutputIvtv::SetAlpha ( eAlphaState  newAlpha  )  [private]

Definition at line 249 of file videoout_ivtv.cpp.

Referenced by Close(), Init(), and ProcessFrame().

void VideoOutputIvtv::SetColorKey ( int  state,
int  color 
) [private]

Definition at line 215 of file videoout_ivtv.cpp.

Referenced by Close(), and Init().

long long VideoOutputIvtv::GetFirmwareFramesPlayed ( void   )  [private]

Returns number of frames decoded as reported by decoder.

Definition at line 1073 of file videoout_ivtv.cpp.

Referenced by GetFramesPlayed(), and Play().


Member Data Documentation

int VideoOutputIvtv::videofd [private]

int VideoOutputIvtv::fbfd [private]

Definition at line 86 of file videoout_ivtv.h.

Referenced by ClearOSD(), Close(), Init(), ProcessFrame(), SetAlpha(), and SetColorKey().

float VideoOutputIvtv::fps [private]

Definition at line 88 of file videoout_ivtv.h.

Referenced by SetFPS().

QString VideoOutputIvtv::videoDevice [private]

Definition at line 89 of file videoout_ivtv.h.

Referenced by Init(), and Open().

unsigned int VideoOutputIvtv::driver_version [private]

Definition at line 90 of file videoout_ivtv.h.

Referenced by Open().

Definition at line 92 of file videoout_ivtv.h.

Referenced by Open(), and Play().

QMutex VideoOutputIvtv::lock [private]

Definition at line 94 of file videoout_ivtv.h.

Definition at line 96 of file videoout_ivtv.h.

Definition at line 97 of file videoout_ivtv.h.

char* VideoOutputIvtv::mapped_mem [private]

Definition at line 98 of file videoout_ivtv.h.

char* VideoOutputIvtv::pixels [private]

Definition at line 99 of file videoout_ivtv.h.

int VideoOutputIvtv::stride [private]

Definition at line 101 of file videoout_ivtv.h.

Referenced by Init(), and ProcessFrame().

Definition at line 103 of file videoout_ivtv.h.

Referenced by ProcessFrame().

Definition at line 104 of file videoout_ivtv.h.

Referenced by ProcessFrame().

Definition at line 105 of file videoout_ivtv.h.

Referenced by ProcessFrame().

char* VideoOutputIvtv::osdbuffer [private]

Definition at line 107 of file videoout_ivtv.h.

Referenced by Init(), and ~VideoOutputIvtv().

Definition at line 108 of file videoout_ivtv.h.

Referenced by ClearOSD(), Init(), and ProcessFrame().

Definition at line 109 of file videoout_ivtv.h.

Referenced by ClearOSD(), Init(), and ProcessFrame().

Definition at line 110 of file videoout_ivtv.h.

Referenced by ProcessFrame().

float VideoOutputIvtv::last_speed [private]

Definition at line 112 of file videoout_ivtv.h.

Referenced by GetFramesPlayed(), NextPlay(), and Play().

Definition at line 113 of file videoout_ivtv.h.

Referenced by GetFramesPlayed(), Play(), and Stop().

Definition at line 114 of file videoout_ivtv.h.

Referenced by GetFramesPlayed(), Play(), and Stop().

Definition at line 116 of file videoout_ivtv.h.

Referenced by NextPlay(), and Play().

Definition at line 117 of file videoout_ivtv.h.

Referenced by NextPlay(), and Play().

Definition at line 118 of file videoout_ivtv.h.

Referenced by ProcessFrame(), and SetAlpha().

Definition at line 120 of file videoout_ivtv.h.

Referenced by ClearOSD(), Close(), Init(), ProcessFrame(), and SetAlpha().

Definition at line 121 of file videoout_ivtv.h.

Referenced by ClearOSD(), and ProcessFrame().

Definition at line 122 of file videoout_ivtv.h.

Referenced by Open(), ProcessFrame(), and SetColorKey().

Definition at line 123 of file videoout_ivtv.h.

Referenced by Flush(), and Open().

Definition at line 125 of file videoout_ivtv.h.

Referenced by Pause(), Play(), and Start().


The documentation for this class was generated from the following files:

Generated on Sat Dec 18 05:16:14 2010 for MythTV by  doxygen 1.5.5