VTB: release CVBuffer after it actually has been rendered
[xbmc.git] / xbmc / storage / DetectDVDType.h
blobe49f2b51adf7fdc5665ed52ac413952166c15dc2
1 #pragma once
3 /*
4 * Copyright (C) 2005-2015 Team XBMC
5 * http://kodi.tv/
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 // CDetectDVDMedia
24 // Thread running in the background to detect a CD change and the filesystem
26 // by Bobbin007 in 2003
28 #include "system.h"
30 #ifdef HAS_DVD_DRIVE
32 #include "threads/CriticalSection.h"
34 #include "threads/Thread.h"
35 #include <memory>
36 #include <string>
38 namespace MEDIA_DETECT
40 class CCdInfo;
41 class CLibcdio;
43 class CDetectDVDMedia : public CThread
45 public:
46 CDetectDVDMedia();
47 virtual ~CDetectDVDMedia();
49 virtual void OnStartup();
50 virtual void OnExit();
51 virtual void Process();
53 static void WaitMediaReady();
54 static bool IsDiscInDrive();
55 static int DriveReady();
56 static CCdInfo* GetCdInfo();
57 static CEvent m_evAutorun;
59 static const std::string &GetDVDLabel();
60 static const std::string &GetDVDPath();
62 static void UpdateState();
63 protected:
64 void UpdateDvdrom();
65 DWORD GetTrayState();
68 void DetectMediaType();
69 void SetNewDVDShareUrl( const std::string& strNewUrl, bool bCDDA, const std::string& strDiscLabel );
71 private:
72 static CCriticalSection m_muReadingMedia;
74 static int m_DriveState;
75 static time_t m_LastPoll;
76 static CDetectDVDMedia* m_pInstance;
78 static CCdInfo* m_pCdInfo;
80 bool m_bStartup;
81 bool m_bAutorun;
82 DWORD m_dwTrayState;
83 DWORD m_dwLastTrayState;
85 static std::string m_diskLabel;
86 static std::string m_diskPath;
88 std::shared_ptr<CLibcdio> m_cdio;
91 #endif