[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDStreamInfo.h
1 /*
2  *      Copyright (C) 2005-2013 Team XBMC
3  *      http://www.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 #if (defined HAVE_CONFIG_H) && (!defined WIN32)
24   #include "config.h"
25 #endif
26 #ifndef _LINUX
27 enum StreamType;
28 enum CodecID;
29 #else
30 #include "DVDDemuxers/DVDDemux.h"
31 extern "C" {
32 #if (defined USE_EXTERNAL_FFMPEG)
33   #if (defined HAVE_LIBAVCODEC_AVCODEC_H)
34     #include <libavcodec/avcodec.h>
35   #elif (defined HAVE_FFMPEG_AVCODEC_H)
36     #include <ffmpeg/avcodec.h>
37   #endif
38 #else
39   #include "libavcodec/avcodec.h"
40 #endif
41 }
42 #endif
43
44 class CDemuxStream;
45
46 class CDVDStreamInfo
47 {
48 public:
49   CDVDStreamInfo();
50   CDVDStreamInfo(const CDVDStreamInfo &right, bool withextradata = true);
51   CDVDStreamInfo(const CDemuxStream &right, bool withextradata = true);
52
53   ~CDVDStreamInfo();
54
55   void Clear(); // clears current information
56   bool Equal(const CDVDStreamInfo &right, bool withextradata);
57   bool Equal(const CDemuxStream &right, bool withextradata);
58
59   void Assign(const CDVDStreamInfo &right, bool withextradata);
60   void Assign(const CDemuxStream &right, bool withextradata);
61
62   CodecID codec;
63   StreamType type;
64   bool software;  //force software decoding
65
66
67   // VIDEO
68   int fpsscale; // scale of 1000 and a rate of 29970 will result in 29.97 fps
69   int fpsrate;
70   int height; // height of the stream reported by the demuxer
71   int width; // width of the stream reported by the demuxer
72   float aspect; // display aspect as reported by demuxer
73   bool vfr; // variable framerate
74   bool stills; // there may be odd still frames in video
75   int level; // encoder level of the stream reported by the decoder. used to qualify hw decoders.
76   int profile; // encoder profile of the stream reported by the decoder. used to qualify hw decoders.
77   bool ptsinvalid;  // pts cannot be trusted (avi's).
78   bool forced_aspect; // aspect is forced from container
79   int orientation; // orientation of the video in degress counter clockwise
80   int bitsperpixel;
81
82   // AUDIO
83   int channels;
84   int samplerate;
85   int bitrate;
86   int blockalign;
87   int bitspersample;
88
89   // SUBTITLE
90   int identifier;
91
92   // CODEC EXTRADATA
93   void*        extradata; // extra data for codec to use
94   unsigned int extrasize; // size of extra data
95   unsigned int codec_tag; // extra identifier hints for decoding
96
97   bool operator==(const CDVDStreamInfo& right)      { return Equal(right, true);}
98   bool operator!=(const CDVDStreamInfo& right)      { return !Equal(right, true);}
99   void operator=(const CDVDStreamInfo& right)       { Assign(right, true); }
100
101   bool operator==(const CDemuxStream& right)      { return Equal( CDVDStreamInfo(right, true), true);}
102   bool operator!=(const CDemuxStream& right)      { return !Equal( CDVDStreamInfo(right, true), true);}
103   void operator=(const CDemuxStream& right)      { Assign(right, true); }
104
105 };