00001 #ifndef MYTHPLAYER_H
00002 #define MYTHPLAYER_H
00003
00004 #include <stdint.h>
00005
00006 #include <sys/time.h>
00007
00008 #include <QObject>
00009 #include <QEvent>
00010
00011 #include "playercontext.h"
00012 #include "volumebase.h"
00013 #include "audiooutputsettings.h"
00014 #include "ringbuffer.h"
00015 #include "osd.h"
00016 #include "jitterometer.h"
00017 #include "videooutbase.h"
00018 #include "teletextreader.h"
00019 #include "subtitlereader.h"
00020 #include "tv_play.h"
00021 #include "yuv2rgb.h"
00022 #include "cc608reader.h"
00023 #include "cc608decoder.h"
00024 #include "cc708reader.h"
00025 #include "cc708decoder.h"
00026 #include "cc708window.h"
00027 #include "decoderbase.h"
00028 #include "deletemap.h"
00029 #include "commbreakmap.h"
00030 #include "audioplayer.h"
00031
00032 #include "mythtvexp.h"
00033
00034 extern "C" {
00035 #include "filter.h"
00036 }
00037 using namespace std;
00038
00039 class VideoOutput;
00040 class RemoteEncoder;
00041 class MythSqlDatabase;
00042 class ProgramInfo;
00043 class DecoderBase;
00044 class FilterManager;
00045 class FilterChain;
00046 class VideoSync;
00047 class LiveTVChain;
00048 class TV;
00049 struct SwsContext;
00050 class InteractiveTV;
00051 class NSAutoreleasePool;
00052 class DetectLetterbox;
00053 class MythPlayer;
00054
00055 typedef void (*StatusCallback)(int, void*);
00056
00058 enum TCTypes
00059 {
00060 TC_VIDEO = 0,
00061 TC_AUDIO,
00062 TC_SUB,
00063 TC_CC
00064 };
00065 #define TCTYPESMAX 4
00066
00067
00068 enum
00069 {
00070 kDisplayNone = 0x000,
00071 kDisplayNUVTeletextCaptions = 0x001,
00072 kDisplayTeletextCaptions = 0x002,
00073 kDisplayAVSubtitle = 0x004,
00074 kDisplayCC608 = 0x008,
00075 kDisplayCC708 = 0x010,
00076 kDisplayTextSubtitle = 0x020,
00077 kDisplayDVDButton = 0x040,
00078 kDisplayRawTextSubtitle = 0x080,
00079 kDisplayAllCaptions = 0x0FF,
00080 kDisplayTeletextMenu = 0x100,
00081 };
00082
00083 enum PlayerFlags
00084 {
00085 kNoFlags = 0x000000,
00086 kDecodeLowRes = 0x000001,
00087 kDecodeSingleThreaded = 0x000002,
00088 kDecodeFewBlocks = 0x000004,
00089 kDecodeNoLoopFilter = 0x000008,
00090 kDecodeNoDecode = 0x000010,
00091 kDecodeDisallowCPU = 0x000020,
00092 kDecodeAllowGPU = 0x000040,
00093 kDecodeAllowEXT = 0x000080,
00094 kVideoIsNull = 0x000100,
00095 kAudioMuted = 0x010000,
00096 };
00097
00098 #define FlagIsSet(arg) (playerFlags & arg)
00099
00100 class DecoderThread : public MThread
00101 {
00102 public:
00103 DecoderThread(MythPlayer *mp, bool start_paused)
00104 : MThread("Decoder"), m_mp(mp), m_start_paused(start_paused) { }
00105 ~DecoderThread() { wait(); }
00106
00107 protected:
00108 virtual void run(void);
00109
00110 private:
00111 MythPlayer *m_mp;
00112 bool m_start_paused;
00113 };
00114
00115 class MTV_PUBLIC MythPlayer
00116 {
00117
00118 friend class PlayerContext;
00119 friend class CC708Reader;
00120 friend class CC608Reader;
00121 friend class DecoderThread;
00122 friend class DetectLetterbox;
00123 friend class TeletextScreen;
00124 friend class SubtitleScreen;
00125 friend class InteractiveScreen;
00126 friend class BDOverlayScreen;
00127 friend class VideoPerformanceTest;
00128
00129 friend class TV;
00130 friend class Transcode;
00131
00132 public:
00133 MythPlayer(PlayerFlags flags = kNoFlags);
00134 virtual ~MythPlayer();
00135
00136
00137 virtual int OpenFile(uint retries = 4);
00138 bool InitVideo(void);
00139
00140
00141 void SetPlayerInfo(TV *tv, QWidget *widget, PlayerContext *ctx);
00142 void SetLength(int len) { totalLength = len; }
00143 void SetFramesPlayed(uint64_t played);
00144 void SetVideoFilters(const QString &override);
00145 void SetEof(bool eof);
00146 void SetPIPActive(bool is_active) { pip_active = is_active; }
00147 void SetPIPVisible(bool is_visible) { pip_visible = is_visible; }
00148
00149 void SetTranscoding(bool value);
00150 void SetWatchingRecording(bool mode);
00151 void SetWatched(bool forceWatched = false);
00152 void SetKeyframeDistance(int keyframedistance);
00153 void SetVideoParams(int w, int h, double fps,
00154 FrameScanType scan = kScan_Ignore);
00155 void SetFileLength(int total, int frames);
00156 void SetDuration(int duration);
00157 void SetVideoResize(const QRect &videoRect);
00158 void EnableFrameRateMonitor(bool enable = false);
00159 void ForceDeinterlacer(const QString &override = QString());
00160
00161
00162 QSize GetVideoBufferSize(void) const { return video_dim; }
00163 QSize GetVideoSize(void) const { return video_disp_dim; }
00164 float GetVideoAspect(void) const { return video_aspect; }
00165 float GetFrameRate(void) const { return video_frame_rate; }
00166 void GetPlaybackData(InfoMap &infoMap);
00167 bool IsAudioNeeded(void)
00168 { return !(FlagIsSet(kVideoIsNull)) && player_ctx->IsAudioNeeded(); }
00169 uint GetVolume(void) { return audio.GetVolume(); }
00170 int GetSecondsBehind(void) const;
00171 int GetFreeVideoFrames(void) const;
00172 AspectOverrideMode GetAspectOverride(void) const;
00173 AdjustFillMode GetAdjustFill(void) const;
00174 MuteState GetMuteState(void) { return audio.GetMuteState(); }
00175
00176 int GetFFRewSkip(void) const { return ffrew_skip; }
00177 float GetPlaySpeed(void) const { return play_speed; }
00178 AudioPlayer* GetAudio(void) { return &audio; }
00179 float GetAudioStretchFactor(void) { return audio.GetStretchFactor(); }
00180 float GetNextPlaySpeed(void) const { return next_play_speed; }
00181 int GetLength(void) const { return totalLength; }
00182 uint64_t GetTotalFrameCount(void) const { return totalFrames; }
00183 uint64_t GetFramesPlayed(void) const { return framesPlayed; }
00184 virtual int64_t GetSecondsPlayed(void);
00185 virtual int64_t GetTotalSeconds(void) const;
00186 virtual uint64_t GetBookmark(void);
00187 QString GetError(void) const;
00188 bool IsErrorRecoverable(void) const
00189 { return (errorType & kError_Switch_Renderer); }
00190 bool IsDecoderErrored(void) const
00191 { return (errorType & kError_Decode); }
00192 QString GetEncodingType(void) const;
00193 void GetCodecDescription(InfoMap &infoMap);
00194 QString GetXDS(const QString &key) const;
00195 PIPLocation GetNextPIPLocation(void) const;
00196
00197
00198 bool IsPaused(void) const { return allpaused; }
00199 bool GetRawAudioState(void) const;
00200 bool GetLimitKeyRepeat(void) const { return limitKeyRepeat; }
00201 bool GetEof(void);
00202 bool IsErrored(void) const;
00203 bool IsPlaying(uint wait_ms = 0, bool wait_for = true) const;
00204 bool AtNormalSpeed(void) const { return next_normal_speed; }
00205 bool IsReallyNearEnd(void) const;
00206 bool IsNearEnd(void);
00207 bool HasAudioOut(void) const { return audio.HasAudioOut(); }
00208 bool IsPIPActive(void) const { return pip_active; }
00209 bool IsPIPVisible(void) const { return pip_visible; }
00210 bool IsMuted(void) { return audio.IsMuted(); }
00211 bool PlayerControlsVolume(void) const { return audio.ControlsVolume(); }
00212 bool UsingNullVideo(void) const { return FlagIsSet(kVideoIsNull); }
00213 bool HasTVChainNext(void) const;
00214 bool CanSupportDoubleRate(void);
00215 bool GetScreenShot(int width = 0, int height = 0, QString filename = "");
00216 bool IsWatchingInprogress(void) const;
00217
00218
00219 virtual char *GetScreenGrabAtFrame(uint64_t frameNum, bool absolute,
00220 int &buflen, int &vw, int &vh, float &ar);
00221 virtual char *GetScreenGrab(int secondsin, int &buflen,
00222 int &vw, int &vh, float &ar);
00223 InteractiveTV *GetInteractiveTV(void);
00224
00225
00226 virtual bool SwitchTitle(int title) { return false; }
00227 virtual bool NextTitle(void) { return false; }
00228 virtual bool PrevTitle(void) { return false; }
00229
00230
00231 virtual bool SwitchAngle(int title) { return false; }
00232 virtual bool NextAngle(void) { return false; }
00233 virtual bool PrevAngle(void) { return false; }
00234
00235
00236 void InitForTranscode(bool copyaudio, bool copyvideo);
00237 bool TranscodeGetNextFrame(frm_dir_map_t::iterator &dm_iter,
00238 int &did_ff, bool &is_key, bool honorCutList);
00239 bool WriteStoredData(
00240 RingBuffer *outRingBuffer, bool writevideo, long timecodeOffset);
00241 long UpdateStoredFrameNum(long curFrameNum);
00242 void SetCutList(const frm_dir_map_t &newCutList);
00243
00244
00245 VideoFrame *GetNextVideoFrame(void);
00246 VideoFrame *GetRawVideoFrame(long long frameNumber = -1);
00247 VideoFrame *GetCurrentFrame(int &w, int &h);
00248 void DeLimboFrame(VideoFrame *frame);
00249 virtual void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode,
00250 bool wrap = true);
00251 void ReleaseCurrentFrame(VideoFrame *frame);
00252 void ClearDummyVideoFrame(VideoFrame *frame);
00253 void DiscardVideoFrame(VideoFrame *buffer);
00254 void DiscardVideoFrames(bool next_frame_keyframe);
00255 void DrawSlice(VideoFrame *frame, int x, int y, int w, int h);
00257 DecoderBase *GetDecoder(void) { return decoder; }
00258 void *GetDecoderContext(unsigned char* buf, uint8_t*& id);
00259
00260
00261 void SaveScreenshot(void);
00262
00263
00264 void ReinitVideo(void);
00265
00266
00267 virtual bool PrepareAudioSample(int64_t &timecode);
00268
00269
00270 uint GetCaptionMode(void) const { return textDisplayMode; }
00271 virtual CC708Reader *GetCC708Reader(uint id=0) { return &cc708; }
00272 virtual CC608Reader *GetCC608Reader(uint id=0) { return &cc608; }
00273 virtual SubtitleReader *GetSubReader(uint id=0) { return &subReader; }
00274 virtual TeletextReader *GetTeletextReader(uint id=0) { return &ttxReader; }
00275
00276
00277 void TracksChanged(uint trackType);
00278 void EnableSubtitles(bool enable);
00279 void EnableForcedSubtitles(bool enable);
00280
00281
00282
00283
00284 void SetAllowForcedSubtitles(bool allow);
00285 bool GetAllowForcedSubtitles(void) const { return allowForcedSubtitles; }
00286
00287
00288 bool SetAudioByComponentTag(int tag);
00289 bool SetVideoByComponentTag(int tag);
00290
00291
00292 void CheckTVChain();
00293 void FileChangedCallback();
00294
00295
00296 virtual int GetNumChapters(void);
00297 virtual int GetCurrentChapter(void);
00298 virtual void GetChapterTimes(QList<long long> ×);
00299
00300
00301 virtual int GetNumTitles(void) const { return 0; }
00302 virtual int GetCurrentTitle(void) const { return 0; }
00303 virtual int GetTitleDuration(int title) const { return 0; }
00304 virtual QString GetTitleName(int title) const { return QString(); }
00305
00306
00307 virtual int GetNumAngles(void) const { return 0; }
00308 virtual int GetCurrentAngle(void) const { return 0; }
00309 virtual QString GetAngleName(int title) const { return QString(); }
00310
00311
00312 virtual bool GoToMenu(QString str) { return false; }
00313 virtual void GoToDVDProgram(bool direction) { (void) direction; }
00314
00315
00316 bool PosMapFromEnc(unsigned long long start,
00317 QMap<long long, long long> &posMap);
00318
00319
00320 bool TryLockOSD(void) { return osdLock.tryLock(50); }
00321 void LockOSD(void) { osdLock.lock(); }
00322 void UnlockOSD(void) { osdLock.unlock(); }
00323
00324
00325 void ToggleStudioLevels(void);
00326 void ToggleNightMode(void);
00327
00328
00329 bool CanVisualise(void);
00330 bool IsVisualising(void);
00331 QString GetVisualiserName(void);
00332 QStringList GetVisualiserList(void);
00333 bool EnableVisualisation(bool enable, const QString &name = QString(""));
00334
00335 void SaveTotalDuration(void);
00336 void ResetTotalDuration(void);
00337
00338 static const int kNightModeBrightenssAdjustment;
00339 static const int kNightModeContrastAdjustment;
00340 static const double kInaccuracyNone;
00341 static const double kInaccuracyDefault;
00342 static const double kInaccuracyEditor;
00343 static const double kInaccuracyFull;
00344
00345 void SaveTotalFrames(void);
00346
00347 protected:
00348
00349 void OpenDummy(void);
00350
00351
00352 virtual void SetBookmark(bool clear = false);
00353 bool AddPIPPlayer(MythPlayer *pip, PIPLocation loc, uint timeout);
00354 bool RemovePIPPlayer(MythPlayer *pip, uint timeout);
00355 void NextScanType(void)
00356 { SetScanType((FrameScanType)(((int)m_scan + 1) & 0x3)); }
00357 void SetScanType(FrameScanType);
00358 FrameScanType GetScanType(void) const { return m_scan; }
00359 bool IsScanTypeLocked(void) const { return m_scan_locked; }
00360 void Zoom(ZoomDirection direction);
00361
00362
00363 void EmbedInWidget(QRect rect);
00364 void StopEmbedding(void);
00365 void ExposeEvent(void);
00366 bool IsEmbedding(void);
00367 void WindowResized(const QSize &new_size);
00368
00369
00370 uint AdjustVolume(int change) { return audio.AdjustVolume(change); }
00371 uint SetVolume(int newvolume) { return audio.SetVolume(newvolume); }
00372 bool SetMuted(bool mute) { return audio.SetMuted(mute); }
00373 MuteState SetMuteState(MuteState state) { return audio.SetMuteState(state); }
00374 MuteState IncrMuteState(void) { return audio.IncrMuteState(); }
00375
00376
00377 VideoOutput *GetVideoOutput(void) { return videoOutput; }
00378 OSD *GetOSD(void) { return osd; }
00379 virtual void SeekForScreenGrab(uint64_t &number, uint64_t frameNum,
00380 bool absolute);
00381
00382
00383 virtual long long CalcMaxFFTime(long long ff, bool setjump = true) const;
00384 long long CalcRWTime(long long rw) const;
00385 virtual void calcSliderPos(osdInfo &info, bool paddedFields = false);
00386 uint64_t TranslatePositionAbsToRel(uint64_t absPosition) const {
00387 return deleteMap.TranslatePositionAbsToRel(absPosition);
00388 }
00389 uint64_t TranslatePositionRelToAbs(uint64_t relPosition) const {
00390 return deleteMap.TranslatePositionRelToAbs(relPosition);
00391 }
00392
00393
00394 void SetAutoCommercialSkip(CommSkipMode autoskip)
00395 { commBreakMap.SetAutoCommercialSkip(autoskip, framesPlayed); }
00396 void SkipCommercials(int direction)
00397 { commBreakMap.SkipCommercials(direction); }
00398 void SetCommBreakMap(frm_dir_map_t &newMap);
00399 CommSkipMode GetAutoCommercialSkip(void)
00400 { return commBreakMap.GetAutoCommercialSkip(); }
00401
00402
00403 void ToggleAspectOverride(AspectOverrideMode aspectMode = kAspect_Toggle);
00404 void ToggleAdjustFill(AdjustFillMode adjustfillMode = kAdjustFill_Toggle);
00405
00406
00407 virtual bool StartPlaying(void);
00408 virtual void ResetPlaying(bool resetframes = true);
00409 virtual void EndPlaying(void) { }
00410 virtual void StopPlaying(void);
00411
00412
00413 bool PauseDecoder(void);
00414 void UnpauseDecoder(void);
00415 bool Pause(void);
00416 bool Play(float speed = 1.0, bool normal = true, bool unpauseaudio = true);
00417
00418
00419 virtual bool FastForward(float seconds);
00420 virtual bool Rewind(float seconds);
00421 virtual bool JumpToFrame(uint64_t frame);
00422
00423
00424 void JumpChapter(int chapter);
00425
00426
00427 virtual bool PrebufferEnoughFrames(int min_buffers = 0);
00428 void SetBuffering(bool new_buffering);
00429 void RefreshPauseFrame(void);
00430 void CheckAspectRatio(VideoFrame* frame);
00431 virtual void DisplayPauseFrame(void);
00432 virtual void DisplayNormalFrame(bool check_prebuffer = true);
00433 virtual void PreProcessNormalFrame(void);
00434 virtual void VideoStart(void);
00435 virtual bool VideoLoop(void);
00436 virtual void VideoEnd(void);
00437 virtual void DecoderStart(bool start_paused);
00438 virtual void DecoderLoop(bool pause);
00439 virtual void DecoderEnd(void);
00440 virtual void DecoderPauseCheck(void);
00441 virtual void AudioEnd(void);
00442 virtual void EventStart(void);
00443 virtual void EventLoop(void);
00444 virtual void InitialSeek(void);
00445
00446
00447 bool ITVHandleAction(const QString &action);
00448 void ITVRestart(uint chanid, uint cardid, bool isLiveTV);
00449
00450
00451 bool EnableEdit(void);
00452 bool HandleProgramEditorActions(QStringList &actions, long long frame = -1);
00453 bool GetEditMode(void) { return deleteMap.IsEditing(); }
00454 void DisableEdit(int howToSave);
00455 bool IsInDelete(uint64_t frame);
00456 uint64_t GetNearestMark(uint64_t frame, bool right);
00457 bool IsTemporaryMark(uint64_t frame);
00458 bool HasTemporaryMark(void);
00459 bool IsCutListSaved(void) { return deleteMap.IsSaved(); }
00460 bool DeleteMapHasUndo(void) { return deleteMap.HasUndo(); }
00461 bool DeleteMapHasRedo(void) { return deleteMap.HasRedo(); }
00462 QString DeleteMapGetUndoMessage(void) { return deleteMap.GetUndoMessage(); }
00463 QString DeleteMapGetRedoMessage(void) { return deleteMap.GetRedoMessage(); }
00464
00465
00466 void ReinitOSD(void);
00467
00468
00469 void SetOSDMessage(const QString &msg, OSDTimeout timeout);
00470 void SetOSDStatus(const QString &title, OSDTimeout timeout);
00471
00472
00473 void ResetCaptions(void);
00474 bool ToggleCaptions(void);
00475 bool ToggleCaptions(uint mode);
00476 bool HasTextSubtitles(void) { return subReader.HasTextSubtitles(); }
00477 void SetCaptionsEnabled(bool, bool osd_msg=true);
00478 bool GetCaptionsEnabled(void);
00479 virtual void DisableCaptions(uint mode, bool osd_msg=true);
00480 virtual void EnableCaptions(uint mode, bool osd_msg=true);
00481
00482
00483 QStringList GetTracks(uint type);
00484 uint GetTrackCount(uint type);
00485 virtual int SetTrack(uint type, int trackNo);
00486 int GetTrack(uint type);
00487 int ChangeTrack(uint type, int dir);
00488 void ChangeCaptionTrack(int dir);
00489 bool HasCaptionTrack(int mode);
00490 int NextCaptionTrack(int mode);
00491 void DoDisableForcedSubtitles(void);
00492 void DoEnableForcedSubtitles(void);
00493
00494
00495 void EnableTeletext(int page = 0x100);
00496 void DisableTeletext(void);
00497 void ResetTeletext(void);
00498 bool HandleTeletextAction(const QString &action);
00499
00500
00501 void SetTeletextPage(uint page);
00502
00503
00504 int64_t AdjustAudioTimecodeOffset(int64_t v, int newsync = -9999);
00505 int64_t GetAudioTimecodeOffset(void) const
00506 { return tc_wrap[TC_AUDIO]; }
00507
00508
00509 DetectLetterbox *detect_letter_box;
00510
00511 protected:
00512
00513 void InitFilters(void);
00514 FrameScanType detectInterlace(FrameScanType newScan, FrameScanType scan,
00515 float fps, int video_height);
00516 virtual void AutoDeint(VideoFrame* frame, bool allow_lock = true);
00517
00518
00519 void SetPlayingInfo(const ProgramInfo &pginfo);
00520 void SetPlaying(bool is_playing);
00521 void SetErrored(const QString &reason) const;
00522
00523
00524 int GetStatusbarPos(void) const;
00525
00526
00527 void PauseVideo(void);
00528 void UnpauseVideo(void);
00529 void PauseBuffer(void);
00530 void UnpauseBuffer(void);
00531
00532
00533 virtual void CreateDecoder(char *testbuf, int testreadsize);
00534 void SetDecoder(DecoderBase *dec);
00536 const DecoderBase *GetDecoder(void) const { return decoder; }
00537 bool DecodeFrame(struct rtframeheader *frameheader,
00538 unsigned char *strm, unsigned char *outbuf);
00539
00540 virtual bool DecoderGetFrameFFREW(void);
00541 virtual bool DecoderGetFrameREW(void);
00542 bool DecoderGetFrame(DecodeType, bool unsafe = false);
00543
00544
00545 bool UpdateFFRewSkip(void);
00546 virtual void ChangeSpeed(void);
00547
00548 bool DoFastForward(uint64_t frames, double inaccuracy);
00549 bool DoRewind(uint64_t frames, double inaccuracy);
00550 void DoJumpToFrame(uint64_t frame, double inaccuracy);
00551
00552
00553 void WaitForSeek(uint64_t frame, uint64_t seeksnap_wanted);
00554 void ClearAfterSeek(bool clearvideobuffers = true);
00555
00556
00557 virtual bool DoJumpChapter(int chapter);
00558 virtual int64_t GetChapter(int chapter);
00559
00560
00561 void HandleArbSeek(bool right);
00562
00563
00564 void WrapTimecode(int64_t &timecode, TCTypes tc_type);
00565 void InitAVSync(void);
00566 virtual void AVSync(VideoFrame *buffer, bool limit_delay = false);
00567 void ResetAVSync(void);
00568 int64_t AVSyncGetAudiotime(void);
00569 void SetFrameInterval(FrameScanType scan, double speed);
00570 void FallbackDeint(void);
00571 void CheckExtraAudioDecode(void);
00572
00573
00574 void SwitchToProgram(void);
00575 void JumpToProgram(void);
00576
00577 protected:
00578 PlayerFlags playerFlags;
00579 DecoderBase *decoder;
00580 QMutex decoder_change_lock;
00581 VideoOutput *videoOutput;
00582 PlayerContext *player_ctx;
00583 DecoderThread *decoderThread;
00584 QThread *playerThread;
00585
00586
00587 QWidget *parentWidget;
00588 bool embedding;
00589 QRect embedRect;
00590 float defaultDisplayAspect;
00591
00592
00593 QWaitCondition decoderThreadPause;
00594 QWaitCondition decoderThreadUnpause;
00595 mutable QMutex decoderPauseLock;
00596 mutable QMutex decoderSeekLock;
00597 bool totalDecoderPause;
00598 bool decoderPaused;
00599 bool inJumpToProgramPause;
00600 bool pauseDecoder;
00601 bool unpauseDecoder;
00602 bool volatile killdecoder;
00603 int64_t decoderSeek;
00604 bool decodeOneFrame;
00605 bool needNewPauseFrame;
00606 mutable QMutex bufferPauseLock;
00607 mutable QMutex videoPauseLock;
00608 mutable QMutex pauseLock;
00609 bool bufferPaused;
00610 bool videoPaused;
00611 bool allpaused;
00612 bool playing;
00613
00614 mutable QWaitCondition playingWaitCond;
00615 mutable QMutex vidExitLock;
00616 mutable QMutex playingLock;
00617 bool m_double_framerate;
00618 bool m_double_process;
00619 bool m_deint_possible;
00620 bool livetv;
00621 bool watchingrecording;
00622 bool transcoding;
00623 bool hasFullPositionMap;
00624 mutable bool limitKeyRepeat;
00625 mutable QMutex errorLock;
00626 mutable QString errorMsg;
00627 mutable int errorType;
00628
00629
00630 int jumpchapter;
00631
00632
00633 uint64_t bookmarkseek;
00634 int clearSavedPosition;
00635 int endExitPrompt;
00636
00637
00640 long long fftime;
00641
00642
00644 int videobuf_retries;
00645 uint64_t framesPlayed;
00646 uint64_t totalFrames;
00647 long long totalLength;
00648 int64_t totalDuration;
00649 long long rewindtime;
00650
00651
00652
00653
00654 QSize video_disp_dim;
00655 QSize video_dim;
00656 double video_frame_rate;
00657 float video_aspect;
00658 float forced_video_aspect;
00660 FrameScanType resetScan;
00662 FrameScanType m_scan;
00664 bool m_scan_locked;
00666 int m_scan_tracker;
00668 bool m_scan_initialized;
00670 uint keyframedist;
00671
00672
00673 bool buffering;
00674 QTime buffering_start;
00675 QTime buffering_last_msg;
00676
00677
00678 uint textDisplayMode;
00679 uint prevTextDisplayMode;
00680 uint prevNonzeroTextDisplayMode;
00681
00682
00683
00684 uint vbimode;
00685 int ttPageNum;
00686
00687
00688 SubtitleReader subReader;
00689 TeletextReader ttxReader;
00692 bool captionsEnabledbyDefault;
00693 bool textDesired;
00694 bool enableCaptions;
00695 bool disableCaptions;
00696 bool enableForcedSubtitles;
00697 bool disableForcedSubtitles;
00698 bool allowForcedSubtitles;
00699
00700
00701 CC608Reader cc608;
00702 CC708Reader cc708;
00703
00704
00705 bool itvVisible;
00706 InteractiveTV *interactiveTV;
00707 bool itvEnabled;
00708 QMutex itvLock;
00709
00710
00711 OSD *osd;
00712 bool reinit_osd;
00713 QMutex osdLock;
00714
00715
00716 AudioPlayer audio;
00717
00718
00719 PIPMap pip_players;
00720 volatile bool pip_active;
00721 volatile bool pip_visible;
00722 PIPLocation pip_default_loc;
00723
00724
00725 QMutex videofiltersLock;
00726 QString videoFiltersForProgram;
00727 QString videoFiltersOverride;
00728 int postfilt_width;
00729 int postfilt_height;
00730 FilterChain *videoFilters;
00731 FilterManager *FiltMan;
00732
00733
00734 CommBreakMap commBreakMap;
00735 bool forcePositionMapSync;
00736
00737 DeleteMap deleteMap;
00738 bool pausedBeforeEdit;
00739 QTime editUpdateTimer;
00740 float speedBeforeEdit;
00741
00742
00744 QMutex decoder_lock;
00745 float next_play_speed;
00746 bool next_normal_speed;
00747
00748 float play_speed;
00749 bool normal_speed;
00750 int frame_interval;
00751 int m_frame_interval;
00752
00753 int ffrew_skip;
00754 int ffrew_adjust;
00755
00756
00757 VideoSync *videosync;
00758 int avsync_delay;
00759 int avsync_adjustment;
00760 int avsync_avg;
00761 int avsync_predictor;
00762 bool avsync_predictor_enabled;
00763 int refreshrate;
00764 bool lastsync;
00765 bool decode_extra_audio;
00766 int repeat_delay;
00767 int64_t disp_timecode;
00768 bool avsync_audiopaused;
00769
00770
00771 int prevtc;
00772 int prevrp;
00773 int64_t tc_wrap[TCTYPESMAX];
00774 int64_t tc_lastval[TCTYPESMAX];
00775
00776
00777 TV *m_tv;
00778 bool isDummy;
00779
00780
00781 Jitterometer *output_jmeter;
00782
00783 private:
00784 void syncWithAudioStretch();
00785 };
00786
00787 #endif
00788
00789