-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
/
AMLCodec.h
101 lines (87 loc) · 3.06 KB
/
AMLCodec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "DVDVideoCodec.h"
#include "cores/VideoPlayer/DVDStreamInfo.h"
#include "cores/IPlayer.h"
#include "guilib/Geometry.h"
#include "rendering/RenderSystem.h"
#include "threads/Thread.h"
#include <deque>
typedef struct am_private_t am_private_t;
class DllLibAmCodec;
class PosixFile;
typedef std::shared_ptr<PosixFile> PosixFilePtr;
class CAMLCodec : public CThread
{
public:
CAMLCodec();
virtual ~CAMLCodec();
bool OpenDecoder(CDVDStreamInfo &hints);
void CloseDecoder();
void Reset();
int Decode(uint8_t *pData, size_t size, double dts, double pts);
bool GetPicture(DVDVideoPicture* pDvdVideoPicture);
void SetSpeed(int speed);
int GetDataSize();
double GetTimeSize();
void SetVideoRect(const CRect &SrcRect, const CRect &DestRect);
int64_t GetCurPts() const { return m_cur_pts; }
protected:
virtual void Process();
private:
void SetVideoPtsSeconds(double pts);
void ShowMainVideo(const bool show);
void SetVideoZoom(const float zoom);
void SetVideoContrast(const int contrast);
void SetVideoBrightness(const int brightness);
void SetVideoSaturation(const int saturation);
void SetVideo3dMode(const int mode3d);
std::string GetStereoMode();
bool OpenAmlVideo(const CDVDStreamInfo &hints);
void CloseAmlVideo();
std::string GetVfmMap(const std::string &name);
void SetVfmMap(const std::string &name, const std::string &map);
int DequeueBuffer(int &pts);
DllLibAmCodec *m_dll;
bool m_opened;
am_private_t *am_private;
CDVDStreamInfo m_hints;
volatile int m_speed;
volatile int64_t m_1st_pts;
volatile int64_t m_cur_pts;
volatile double m_timesize;
volatile int64_t m_vbufsize;
int64_t m_start_dts;
int64_t m_start_pts;
CEvent m_ready_event;
CRect m_dst_rect;
CRect m_display_rect;
int m_view_mode;
RENDER_STEREO_MODE m_stereo_mode;
RENDER_STEREO_VIEW m_stereo_view;
float m_zoom;
int m_contrast;
int m_brightness;
PosixFilePtr m_amlVideoFile;
std::string m_defaultVfmMap;
std::deque<int> m_ptsQueue;
CCriticalSection m_ptsQueueMutex;
};