2a010792e9be45d9d2a97bfe2e319f36418d36a9
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / Video / AMLCodec.h
1 #pragma once
2 /*
3  *      Copyright (C) 2005-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include "DVDVideoCodec.h"
23 #include "cores/dvdplayer/DVDStreamInfo.h"
24 #include "cores/VideoRenderers/RenderFeatures.h"
25 #include "guilib/Geometry.h"
26 #include "threads/Thread.h"
27
28 typedef struct am_private_t am_private_t;
29
30 class DllLibAmCodec;
31
32 class CAMLCodec : public CThread
33 {
34 public:
35   CAMLCodec();
36   virtual ~CAMLCodec();
37
38   bool          OpenDecoder(CDVDStreamInfo &hints);
39   void          CloseDecoder();
40   void          Reset();
41
42   int           Decode(uint8_t *pData, size_t size, double dts, double pts);
43
44   bool          GetPicture(DVDVideoPicture* pDvdVideoPicture);
45   void          SetSpeed(int speed);
46   int           GetDataSize();
47   double        GetTimeSize();
48
49 protected:
50   virtual void  Process();
51
52 private:
53   double        GetPlayerPtsSeconds();
54   void          SetVideoPtsSeconds(double pts);
55   void          ShowMainVideo(const bool show);
56   void          SetVideoZoom(const float zoom);
57   void          SetVideoContrast(const int contrast);
58   void          SetVideoBrightness(const int brightness);
59   void          SetVideoSaturation(const int saturation);
60   void          GetRenderFeatures(Features &renderFeatures);
61   static void   RenderFeaturesCallBack(const void *ctx, Features &renderFeatures);
62   void          SetVideoRect(const CRect &SrcRect, const CRect &DestRect);
63   static void   RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, const CRect &DestRect);
64
65   DllLibAmCodec   *m_dll;
66   bool             m_opened;
67   am_private_t    *am_private;
68   CDVDStreamInfo   m_hints;
69   volatile int     m_speed;
70   volatile int64_t m_1st_pts;
71   volatile int64_t m_cur_pts;
72   volatile int64_t m_cur_pictcnt;
73   volatile int64_t m_old_pictcnt;
74   volatile double  m_timesize;
75   volatile int64_t m_vbufsize;
76   int64_t          m_start_dts;
77   int64_t          m_start_pts;
78   CEvent           m_ready_event;
79
80   CRect            m_dst_rect;
81   int              m_view_mode;
82   float            m_zoom;
83   int              m_contrast;
84   int              m_brightness;
85 };