00001 #ifndef NUPPELVIDEOPLAYER
00002 #define NUPPELVIDEOPLAYER
00003
00004 #include <qstring.h>
00005 #include <qmutex.h>
00006 #include <qwaitcondition.h>
00007 #include <qptrqueue.h>
00008 #include <qdatetime.h>
00009 #include <sys/time.h>
00010
00011 #include "RingBuffer.h"
00012 #include "osd.h"
00013 #include "jitterometer.h"
00014 #include "recordingprofile.h"
00015 #include "videooutbase.h"
00016 #include "teletextdecoder.h"
00017 #include "textsubtitleparser.h"
00018 #include "tv_play.h"
00019 #include "yuv2rgb.h"
00020 #include "cc608decoder.h"
00021 #include "cc708decoder.h"
00022 #include "cc708window.h"
00023
00024 #include "mythexp.h"
00025
00026 extern "C" {
00027 #include "filter.h"
00028 }
00029 using namespace std;
00030
00031 #define MAXTBUFFER 60
00032
00033 #ifndef LONG_LONG_MIN
00034 #define LONG_LONG_MIN LLONG_MIN
00035 #endif
00036
00037 class VideoOutput;
00038 class OSDSet;
00039 class RemoteEncoder;
00040 class MythSqlDatabase;
00041 class ProgramInfo;
00042 class DecoderBase;
00043 class AudioOutput;
00044 class FilterManager;
00045 class FilterChain;
00046 class VideoSync;
00047 class LiveTVChain;
00048 class TV;
00049 struct AVSubtitle;
00050 class InteractiveTV;
00051 class NSAutoreleasePool;
00052
00053 struct TextContainer
00054 {
00055 int timecode;
00056 int len;
00057 unsigned char *buffer;
00058 char type;
00059 };
00060
00061 typedef void (*StatusCallback)(int, void*);
00062
00064 enum TCTypes
00065 {
00066 TC_VIDEO = 0,
00067 TC_AUDIO,
00068 TC_SUB,
00069 TC_CC
00070 };
00071 #define TCTYPESMAX 4
00072
00074 enum
00075 {
00076 kTrackTypeAudio = 0,
00077 kTrackTypeSubtitle,
00078 kTrackTypeCC608,
00079 kTrackTypeCC708,
00080 kTrackTypeTeletextCaptions,
00081 kTrackTypeCount,
00082
00083 kTrackTypeTeletextMenu,
00084 };
00085 QString track_type_to_string(uint type);
00086 int type_string_to_track_type(const QString &str);
00087
00088
00089 enum
00090 {
00091 kDisplayNone = 0x00,
00092 kDisplayNUVTeletextCaptions = 0x01,
00093 kDisplayTeletextCaptions = 0x02,
00094 kDisplayAVSubtitle = 0x04,
00095 kDisplayCC608 = 0x08,
00096 kDisplayCC708 = 0x10,
00097 kDisplayNUVCaptions = kDisplayNUVTeletextCaptions | kDisplayCC608,
00098 kDisplayTextSubtitle = 0x20,
00099 kDisplayAllCaptions = 0x3f,
00100 kDisplayTeletextMenu = 0x40,
00101 };
00102
00103 class MPUBLIC NuppelVideoPlayer : public CC608Reader, public CC708Reader
00104 {
00105 public:
00106 NuppelVideoPlayer(QString inUseID = "Unknown",
00107 const ProgramInfo *info = NULL);
00108 ~NuppelVideoPlayer();
00109
00110
00111 bool InitVideo(void);
00112 int OpenFile(bool skipDsp = false, uint retries = 4,
00113 bool allow_libmpeg2 = true);
00114 void OpenDummy(void);
00115
00116
00117 void EmbedInWidget(WId wid, int x, int y, int w, int h);
00118 void StopEmbedding(void);
00119 void ExposeEvent(void);
00120 bool IsEmbedding(void);
00121 void DrawUnusedRects(bool sync);
00122
00123
00124 void SetNoAudio(void) { no_audio_out = true; }
00125 void SetAudioStretchFactor(float factor) { audio_stretchfactor = factor; }
00126 void SetAudioOutput(AudioOutput *ao) { audioOutput = ao; }
00127 void SetAudioInfo(const QString &main, const QString &passthru, uint rate);
00128 void SetAudioParams(int bits, int channels, int samplerate, bool passthru);
00129 void SetEffDsp(int dsprate);
00130 void SetAudioCodec(void *ac);
00131
00132
00133 void SetParentWidget(QWidget *widget) { parentWidget = widget; }
00134 void SetAsPIP(void) { SetNoAudio(); SetNullVideo(); }
00135 void SetNullVideo(void) { using_null_videoout = true; }
00136 void SetFileName(QString lfilename) { filename = lfilename; }
00137 void SetExactSeeks(bool exact) { exactseeks = exact; }
00138 void SetAutoCommercialSkip(int autoskip);
00139 void SetCommBreakMap(QMap<long long, int> &newMap);
00140 void SetRingBuffer(RingBuffer *rbuf) { ringBuffer = rbuf; }
00141 void SetLiveTVChain(LiveTVChain *tvchain) { livetvchain = tvchain; }
00142 void SetLength(int len) { totalLength = len; }
00143 void SetVideoFilters(const QString &override)
00144 { videoFiltersOverride = QDeepCopy<QString>(override); }
00145 void SetFramesPlayed(long long played) { framesPlayed = played; }
00146 void SetEof(void) { eof = true; }
00147 void SetPipPlayer(NuppelVideoPlayer *pip)
00148 { setpipplayer = pip; needsetpipplayer = true; }
00149 void SetRecorder(RemoteEncoder *recorder);
00150 void SetParentPlayer(TV *tv) { m_tv = tv; }
00151
00152 void SetTranscoding(bool value);
00153 void SetWatchingRecording(bool mode);
00154 void SetWatched(bool forceWatched = false);
00155 void SetBookmark(void);
00156 void SetKeyframeDistance(int keyframedistance);
00157 void SetVideoParams(int w, int h, double fps, int keydist,
00158 float a = 1.33333, FrameScanType scan = kScan_Ignore,
00159 bool video_codec_changed = false);
00160 void SetFileLength(int total, int frames);
00161 void Zoom(ZoomDirection direction);
00162 void ClearBookmark(void);
00163 void SetForcedAspectRatio(int mpeg2_aspect_value, int letterbox_permission);
00164
00165 void NextScanType(void)
00166 { SetScanType((FrameScanType)(((int)m_scan + 1) & 0x3)); }
00167 void SetScanType(FrameScanType);
00168 FrameScanType GetScanType(void) const { return m_scan; }
00169 bool IsScanTypeLocked(void) const { return m_scan_locked; }
00170
00171 void SetOSDFontName(const QString osdfonts[22], const QString &prefix);
00172 void SetOSDThemeName(const QString themename);
00173 void SetVideoResize(const QRect &videoRect);
00174
00175
00176 void ToggleAspectOverride(AspectOverrideMode aspectMode = kAspect_Toggle);
00177 void ToggleAdjustFill(AdjustFillMode adjustfillMode = kAdjustFill_Toggle);
00178
00179
00180 QSize GetVideoBufferSize(void) const { return video_dim; }
00181 QSize GetVideoSize(void) const { return video_disp_dim; }
00182 float GetVideoAspect(void) const { return video_aspect; }
00183 float GetFrameRate(void) const { return video_frame_rate; }
00184
00185 int GetSecondsBehind(void) const;
00186 AspectOverrideMode GetAspectOverride(void) const;
00187 AdjustFillMode GetAdjustFill(void) const;
00188 int GetFFRewSkip(void) const { return ffrew_skip; }
00189 float GetAudioStretchFactor(void) const { return audio_stretchfactor; }
00190 float GetNextPlaySpeed(void) const { return next_play_speed; }
00191 int GetLength(void) const { return totalLength; }
00192 long long GetTotalFrameCount(void) const { return totalFrames; }
00193 long long GetFramesPlayed(void) const { return framesPlayed; }
00194 long long GetBookmark(void) const;
00195 QString GetEncodingType(void) const;
00196 QString GetXDS(const QString &key) const;
00197 bool GetAudioBufferStatus(uint &fill, uint &total) const;
00198
00199
00200 bool GetRawAudioState(void) const;
00201 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; }
00202 bool GetEof(void) const { return eof; }
00203 bool PipPlayerSet(void) const { return !needsetpipplayer; }
00204 bool IsErrored(void) const { return errored; }
00205 bool IsPlaying(void) const { return playing; }
00206 bool AtNormalSpeed(void) const { return next_normal_speed; }
00207 bool IsDecoderThreadAlive(void) const { return decoder_thread_alive; }
00208 bool IsReallyNearEnd(void) const;
00209 bool IsNearEnd(long long framesRemaining = -1) const;
00210 bool PlayingSlowForPrebuffer(void) const { return m_playing_slower; }
00211 bool HasAudioIn(void) const { return !no_audio_in; }
00212 bool HasAudioOut(void) const { return !no_audio_out; }
00213
00214
00215 long long CalcMaxFFTime(long long ff, bool setjump = true) const;
00216 long long CalcRWTime(long long rw) const;
00217 void calcSliderPos(struct StatusPosInfo &posInfo,
00218 bool paddedFields = false);
00219
00221 OSD *GetOSD(void) { return osd; }
00222 VideoOutput *getVideoOutput(void) { return videoOutput; }
00223 AudioOutput *getAudioOutput(void) { return audioOutput; }
00224 char *GetScreenGrabAtFrame(long long frameNum, bool absolute,
00225 int &buflen, int &vw, int &vh, float &ar);
00226 char *GetScreenGrab(int secondsin, int &buflen,
00227 int &vw, int &vh, float &ar);
00228 LiveTVChain *GetTVChain(void) { return livetvchain; }
00229 InteractiveTV *GetInteractiveTV(void);
00230
00231
00232 void StartPlaying(void);
00233 void ResetPlaying(void);
00234 void StopPlaying(void) { killplayer = true; decoder_thread_alive = false; }
00235
00236
00237 void PauseDecoder(void);
00238 void Pause(bool waitvideo = true);
00239 bool Play(float speed = 1.0, bool normal = true,
00240 bool unpauseaudio = true);
00241 bool IsPaused(bool *is_pause_still_possible = NULL) const;
00242
00243
00244 bool FastForward(float seconds);
00245 bool Rewind(float seconds);
00246 bool RebuildSeekTable(bool showPercentage = true, StatusCallback cb = NULL,
00247 void* cbData = NULL);
00248 void JumpToFrame(long long frame);
00249
00250
00251 void SkipCommercials(int direction);
00252 int FlagCommercials(bool showPercentage, bool fullSpeed,
00253 bool inJobQueue);
00254
00255
00256 void InitForTranscode(bool copyaudio, bool copyvideo);
00257 bool TranscodeGetNextFrame(QMap<long long, int>::Iterator &dm_iter,
00258 int *did_ff, bool *is_key, bool honorCutList);
00259 void TranscodeWriteText(
00260 void (*func)(void *, unsigned char *, int, int, int), void *ptr);
00261 bool WriteStoredData(
00262 RingBuffer *outRingBuffer, bool writevideo, long timecodeOffset);
00263 long UpdateStoredFrameNum(long curFrameNum);
00264 void SetCutList(QMap<long long, int> newCutList);
00265
00266
00267 bool EnableEdit(void);
00268 bool DoKeypress(QKeyEvent *e);
00269 bool GetEditMode(void) const { return editmode; }
00270
00271
00272 VideoFrame *GetNextVideoFrame(bool allow_unsafe = true);
00273 VideoFrame *GetRawVideoFrame(long long frameNumber = -1);
00274 VideoFrame *GetCurrentFrame(int &w, int &h);
00275 void ReleaseNextVideoFrame(VideoFrame *buffer, long long timecode);
00276 void ReleaseNextVideoFrame(void)
00277 { videoOutput->ReleaseFrame(GetNextVideoFrame(false)); }
00278 void ReleaseCurrentFrame(VideoFrame *frame);
00279 void DiscardVideoFrame(VideoFrame *buffer);
00280 void DiscardVideoFrames(bool next_frame_keyframe);
00281 void DrawSlice(VideoFrame *frame, int x, int y, int w, int h);
00282
00283
00284 const QImage &GetARGBFrame(QSize &size);
00285 const unsigned char *GetScaledFrame(QSize &size);
00286 void ShutdownYUVResize(void);
00287 void SaveScreenshot(void);
00288
00289
00290 void ReinitOSD(void);
00291 void ReinitVideo(void);
00292 QString ReinitAudio(void);
00293
00294
00295 void AddAudioData(char *buffer, int len, long long timecode);
00296 void AddAudioData(short int *lbuffer, short int *rbuffer, int samples,
00297 long long timecode);
00298 void AddTextData(unsigned char *buffer, int len,
00299 long long timecode, char type);
00300 void AddAVSubtitle(const AVSubtitle& subtitle);
00301
00302
00303 uint GetCaptionMode(void) const { return textDisplayMode; }
00304 void ResetCaptions(uint mode_override = 0);
00305 void DisableCaptions(uint mode, bool osd_msg=true);
00306 void EnableCaptions(uint mode, bool osd_msg=true);
00307 bool ToggleCaptions(void);
00308 bool ToggleCaptions(uint mode);
00309 void SetCaptionsEnabled(bool, bool osd_msg=true);
00310 bool LoadExternalSubtitles(const QString &subtitleFileName);
00311
00312
00313 void EnableTeletext(void);
00314 void DisableTeletext(void);
00315 void ResetTeletext(void);
00316 bool HandleTeletextAction(const QString &action);
00317
00318
00319 void SetTeletextPage(uint page);
00320
00321
00322 void FlushTxtBuffers(void) { rtxt = wtxt; }
00323
00324
00325 CC708Window &GetCCWin(uint service_num, uint window_id)
00326 { return CC708services[service_num].windows[window_id]; }
00327 CC708Window &GetCCWin(uint svc_num)
00328 { return GetCCWin(svc_num, CC708services[svc_num].current_window); }
00329
00330 void SetCurrentWindow(uint service_num, int window_id);
00331 void DefineWindow(uint service_num, int window_id,
00332 int priority, int visible,
00333 int anchor_point, int relative_pos,
00334 int anchor_vertical, int anchor_horizontal,
00335 int row_count, int column_count,
00336 int row_lock, int column_lock,
00337 int pen_style, int window_style);
00338 void DeleteWindows( uint service_num, int window_map);
00339 void DisplayWindows(uint service_num, int window_map);
00340 void HideWindows( uint service_num, int window_map);
00341 void ClearWindows( uint service_num, int window_map);
00342 void ToggleWindows( uint service_num, int window_map);
00343 void SetWindowAttributes(uint service_num,
00344 int fill_color, int fill_opacity,
00345 int border_color, int border_type,
00346 int scroll_dir, int print_dir,
00347 int effect_dir,
00348 int display_effect, int effect_speed,
00349 int justify, int word_wrap);
00350 void SetPenAttributes(uint service_num, int pen_size,
00351 int offset, int text_tag, int font_tag,
00352 int edge_type, int underline, int italics);
00353 void SetPenColor(uint service_num,
00354 int fg_color, int fg_opacity,
00355 int bg_color, int bg_opacity,
00356 int edge_color);
00357 void SetPenLocation(uint service_num, int row, int column);
00358
00359 void Delay(uint service_num, int tenths_of_seconds);
00360 void DelayCancel(uint service_num);
00361 void Reset(uint service_num);
00362 void TextWrite(uint service_num, short* unicode_string, short len);
00363
00364
00365 QStringList GetTracks(uint type) const;
00366 int SetTrack(uint type, int trackNo);
00367 int GetTrack(uint type) const;
00368 int ChangeTrack(uint type, int dir);
00369 void ChangeCaptionTrack(int dir);
00370 void TracksChanged(uint trackType);
00371
00372
00373 bool ITVHandleAction(const QString &action);
00374 void ITVRestart(uint chanid, uint cardid, bool isLiveTV);
00375 bool SetAudioByComponentTag(int tag);
00376 bool SetVideoByComponentTag(int tag);
00377
00378
00379 long long AdjustAudioTimecodeOffset(long long v)
00380 { tc_wrap[TC_AUDIO] += v; return tc_wrap[TC_AUDIO]; }
00381 long long ResetAudioTimecodeOffset(void)
00382 { tc_wrap[TC_AUDIO] = 0LL; return tc_wrap[TC_AUDIO]; }
00383 long long ResyncAudioTimecodeOffset(void)
00384 { tc_wrap[TC_AUDIO] = LONG_LONG_MIN; return 0L; }
00385 long long GetAudioTimecodeOffset(void) const
00386 { return tc_wrap[TC_AUDIO]; }
00387 void SaveAudioTimecodeOffset(long long v)
00388 { savedAudioTimecodeOffset = v; }
00389
00390
00391 void CheckTVChain();
00392 void FileChangedCallback();
00393
00394
00395 void ChangeDVDTrack(bool ffw);
00396 void ActivateDVDButton(void);
00397 void GoToDVDMenu(QString str);
00398 void GoToDVDProgram(bool direction);
00399 void HideDVDButton(bool hide)
00400 {
00401 hidedvdbutton = hide;
00402 }
00403
00404 protected:
00405 void DisplayPauseFrame(void);
00406 void DisplayNormalFrame(void);
00407 void OutputVideoLoop(void);
00408 void IvtvVideoLoop(void);
00409
00410 static void *kickoffOutputVideoLoop(void *player);
00411
00412 private:
00413
00414 void InitFilters(void);
00415 FrameScanType detectInterlace(FrameScanType newScan, FrameScanType scan,
00416 float fps, int video_height);
00417 void AutoDeint(VideoFrame*);
00418
00419
00420 void SetPlaybackInfo(ProgramInfo *pginfo);
00421 void SetPrebuffering(bool prebuffer);
00422
00423
00424 int GetStatusbarPos(void) const;
00425 bool IsInDelete(long long testframe) const;
00426 bool IsIVTVDecoder(void) const;
00427
00428
00429 void PauseVideo(bool wait = true);
00430 void UnpauseVideo(bool wait = false);
00431 void SetVideoActuallyPaused(bool val);
00432 bool IsVideoActuallyPaused(void) const;
00433
00434
00435 void SetDecoder(DecoderBase *dec);
00437 DecoderBase *GetDecoder(void) { return decoder; }
00439 const DecoderBase *GetDecoder(void) const { return decoder; }
00440 bool DecodeFrame(struct rtframeheader *frameheader,
00441 unsigned char *strm, unsigned char *outbuf);
00442
00443 bool PrebufferEnoughFrames(void);
00444 void CheckPrebuffering(void);
00445 bool GetFrameNormal(int onlyvideo);
00446 bool GetFrameFFREW(void);
00447 bool GetFrame(int onlyvideo, bool unsafe = false);
00448
00449
00450 void DoPause(void);
00451 void DoPlay(void);
00452 bool DoFastForward(void);
00453 bool DoRewind(void);
00454 void DoChangeDVDTrack(void);
00455
00456
00457 void ClearAfterSeek(bool clearvideobuffers = true);
00458 bool FrameIsInMap(long long frameNumber, QMap<long long, int> &breakMap);
00459 void JumpToNetFrame(long long net) { JumpToFrame(framesPlayed + net); }
00460
00461
00462 void SkipCommercialsByBlanks(void);
00463 bool DoSkipCommercials(int direction);
00464 void AutoCommercialSkip(void);
00465 void MergeShortCommercials(void);
00466
00467
00468 void SaveCutList(void);
00469 void LoadCutList(void);
00470 void LoadCommBreakList(void);
00471 void DisableEdit(void);
00472
00473 void AddMark(long long frames, int type);
00474 void DeleteMark(long long frames);
00475 void ReverseMark(long long frames);
00476
00477 void SetDeleteIter(void);
00478 void SetBlankIter(void);
00479 void SetCommBreakIter(void);
00480
00481 void HandleArbSeek(bool right);
00482 void HandleSelect(bool allowSelectNear = false);
00483 void HandleResponse(void);
00484
00485 void UpdateTimeDisplay(void);
00486 void UpdateSeekAmount(bool up);
00487 void UpdateEditSlider(void);
00488
00489
00490 float WarpFactor(void);
00491 void WrapTimecode(long long &timecode, TCTypes tc_type);
00492 void InitAVSync(void);
00493 void AVSync(void);
00494 void ShutdownAVSync(void);
00495 void FallbackDeint(void);
00496
00497
00498 int tbuffer_numvalid(void);
00499 int tbuffer_numfree(void);
00500 void ShowText(void);
00501 void ResetCC(void);
00502 void UpdateCC(unsigned char *inpos);
00503
00504
00505 void DisplayAVSubtitles(void);
00506 void DisplayTextSubtitles(void);
00507 void ClearSubtitles(void);
00508 void ExpireSubtitles(void);
00509
00510
00511 void SwitchToProgram(void);
00512 void JumpToProgram(void);
00513
00514
00515 void DisplayDVDButton(void);
00516 long long GetDVDBookmark(void) const;
00517 void SetDVDBookmark(long long frames);
00518
00519 private:
00520 DecoderBase *decoder;
00521 QMutex decoder_change_lock;
00522 VideoOutput *videoOutput;
00523 RemoteEncoder *nvr_enc;
00524 ProgramInfo *m_playbackinfo;
00525
00526
00527 QWidget *parentWidget;
00528 WId embedid;
00529 int embx, emby, embw, embh;
00530 FrameScanType embed_saved_scan_type;
00531 bool embed_saved_scan_lock;
00532
00533
00534 QWaitCondition decoderThreadPaused;
00535 QWaitCondition videoThreadPaused;
00536 QWaitCondition videoThreadUnpaused;
00537 mutable QMutex vidExitLock;
00538 mutable QMutex pauseUnpauseLock;
00539 mutable QMutex internalPauseLock;
00540 bool eof;
00541 bool m_double_framerate;
00542 bool m_double_process;
00543 bool m_can_double;
00544 bool m_deint_possible;
00545 bool paused;
00546 bool pausevideo;
00547 bool actuallypaused;
00548 bool video_actually_paused;
00549 bool playing;
00550 bool decoder_thread_alive;
00551 bool killplayer;
00552 bool killvideo;
00553 bool livetv;
00554 bool watchingrecording;
00555 bool editmode;
00556 bool resetvideo;
00557 bool using_null_videoout;
00558 bool no_audio_in;
00559 bool no_audio_out;
00560 bool transcoding;
00561 bool hasFullPositionMap;
00562 mutable bool limitKeyRepeat;
00563 bool errored;
00564
00565
00566 long long bookmarkseek;
00567 bool previewFromBookmark;
00568
00569
00572 long long fftime;
00574 int seekamountpos;
00577 int seekamount;
00580 bool exactseeks;
00581
00582
00584 int videobuf_retries;
00585 long long framesPlayed;
00586 long long totalFrames;
00587 long long totalLength;
00588 long long rewindtime;
00589 QString m_recusage;
00590
00591
00592
00593
00594
00595 QSize video_disp_dim;
00596 QSize video_dim;
00597 double video_frame_rate;
00598 float video_aspect;
00599 float forced_video_aspect;
00601 FrameScanType m_scan;
00603 bool m_scan_locked;
00605 int m_scan_tracker;
00607 int keyframedist;
00608
00609
00610 QString filename;
00611 bool weMadeBuffer;
00612 RingBuffer *ringBuffer;
00613
00614
00615 QWaitCondition prebuffering_wait;
00616 QMutex prebuffering_lock;
00617 bool prebuffering;
00618 int prebuffer_tries;
00619
00620
00621 bool db_prefer708;
00622 uint textDisplayMode;
00623 uint prevTextDisplayMode;
00624
00625
00626
00627 uint vbimode;
00628 int ttPageNum;
00629 int ccmode;
00630
00631 int wtxt;
00632 int rtxt;
00633 QMutex text_buflock;
00634 int text_size;
00635 struct TextContainer txtbuffers[MAXTBUFFER+1];
00636
00637 QString ccline;
00638 int cccol;
00639 int ccrow;
00640
00641
00642 QMutex subtitleLock;
00645 bool textDesired;
00646 bool osdHasSubtitles;
00647 long long osdSubtitlesExpireAt;
00648
00652 MythDeque<AVSubtitle> nonDisplayedAVSubtitles;
00653
00659 TextSubtitles textSubtitles;
00660
00661 CC708Service CC708services[64];
00662 QString osdfontname;
00663 QString osdccfontname;
00664 QString osd708fontnames[20];
00665 QString osdprefix;
00666 QString osdtheme;
00667
00668
00669 bool itvVisible;
00670 InteractiveTV *interactiveTV;
00671 bool itvEnabled;
00672 QMutex itvLock;
00673
00674
00675 OSD *osd;
00676 OSDSet *timedisplay;
00677 QString dialogname;
00678 int dialogtype;
00679
00680
00681 AudioOutput *audioOutput;
00682 QString audio_main_device;
00683 QString audio_passthru_device;
00684 int audio_channels;
00685 int audio_bits;
00686 int audio_samplerate;
00687 float audio_stretchfactor;
00688 void *audio_codec;
00689 bool audio_passthru;
00690
00691
00692 NuppelVideoPlayer *pipplayer;
00693 NuppelVideoPlayer *setpipplayer;
00694 bool needsetpipplayer;
00695
00696
00697 unsigned char *argb_buf;
00698 QSize argb_size;
00699 QImage argb_scaled_img;
00700 yuv2rgb_fun yuv2argb_conv;
00701 bool yuv_need_copy;
00702 QSize yuv_desired_size;
00703 ImgReSampleContext *yuv_scaler;
00704 unsigned char *yuv_frame_scaled;
00705 QSize yuv_scaler_in_size;
00706 QSize yuv_scaler_out_size;
00707 QMutex yuv_lock;
00708 QWaitCondition yuv_wait;
00709
00710
00711 QMutex videofiltersLock;
00712 QString videoFiltersForProgram;
00713 QString videoFiltersOverride;
00714 int postfilt_width;
00715 int postfilt_height;
00716 FilterChain *videoFilters;
00717 FilterManager *FiltMan;
00718
00719
00720 QMutex commBreakMapLock;
00721 int skipcommercials;
00722 int autocommercialskip;
00723 int commrewindamount;
00724 int commnotifyamount;
00725 int lastCommSkipDirection;
00726 time_t lastCommSkipTime;
00727 long long lastCommSkipStart;
00728 time_t lastSkipTime;
00729
00730 long long deleteframe;
00731 bool hasdeletetable;
00732 bool hasblanktable;
00733 bool hascommbreaktable;
00734 QMap<long long, int> deleteMap;
00735 QMap<long long, int> blankMap;
00736 QMap<long long, int> commBreakMap;
00737 QMap<long long, int>::Iterator deleteIter;
00738 QMap<long long, int>::Iterator blankIter;
00739 QMap<long long, int>::Iterator commBreakIter;
00740 QDateTime lastIgnoredManualSkip;
00741 bool forcePositionMapSync;
00742
00743
00745 QMutex decoder_lock;
00746 float next_play_speed;
00747 bool next_normal_speed;
00748
00749 float play_speed;
00750 bool normal_speed;
00751 int frame_interval;
00752
00753 int ffrew_skip;
00754
00755
00756 VideoSync *videosync;
00757 int delay;
00758 int vsynctol;
00759 int avsync_delay;
00760 int avsync_adjustment;
00761 int avsync_avg;
00762 int avsync_oldavg;
00763 int refreshrate;
00764 bool lastsync;
00765 bool m_playing_slower;
00766 bool decode_extra_audio;
00767 float m_stored_audio_stretchfactor;
00768 bool audio_paused;
00769
00770
00771 bool usevideotimebase;
00772 float warpfactor;
00773 float warpfactor_avg;
00774 short int *warplbuff;
00775 short int *warprbuff;
00776 int warpbuffsize;
00777
00778
00779 int prevtc;
00780 int tc_avcheck_framecounter;
00781 long long tc_wrap[TCTYPESMAX];
00782 long long tc_lastval[TCTYPESMAX];
00783 long long tc_diff_estimate;
00784 long long savedAudioTimecodeOffset;
00785
00786
00787 LiveTVChain *livetvchain;
00788 TV *m_tv;
00789 bool isDummy;
00790
00791
00793 bool hidedvdbutton;
00794 int need_change_dvd_track;
00795 bool dvd_stillframe_showing;
00796
00797
00798 Jitterometer *output_jmeter;
00799 };
00800
00801 #endif
00802
00803