Merge pull request #5101 from FernetMenta/ffmpeg-threads
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDFileInfo.h
1 /*
2  *      Copyright (C) 2005-2013 Team XBMC
3  *      http://xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #pragma once
22
23 #include "utils/StdString.h"
24
25 class CFileItem;
26 class CDVDDemux;
27 class CStreamDetails;
28 class CStreamDetailSubtitle;
29 class CDVDInputStream;
30 class CTextureDetails;
31
32 class CDVDFileInfo
33 {
34 public:
35   // Extract a thumbnail immage from the media at strPath, optionally populating a streamdetails class with the data
36   static bool ExtractThumb(const CStdString &strPath, CTextureDetails &details, CStreamDetails *pStreamDetails);
37
38   // Probe the files streams and store the info in the VideoInfoTag
39   static bool GetFileStreamDetails(CFileItem *pItem);
40   static bool DemuxerToStreamDetails(CDVDInputStream* pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const CStdString &path = "");
41
42   /** \brief Probe the file's internal and external streams and store the info in the StreamDetails parameter.
43   *   \param[out] details The file's StreamDetails consisting of internal streams and external subtitle streams.
44   */
45   static bool DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> &subs, CStreamDetails &details);
46
47   static bool GetFileDuration(const CStdString &path, int &duration);
48
49   /** \brief Probe the streams of an external subtitle file and store the info in the StreamDetails parameter.
50   *   \param[out] details The external subtitle file's StreamDetails.
51   */
52   static bool AddExternalSubtitleToDetails(const CStdString &path, CStreamDetails &details, const std::string& filename, const std::string& subfilename = "");
53 };