-
Notifications
You must be signed in to change notification settings - Fork 10
/
DVDVideoCodec.cpp
85 lines (71 loc) · 1.79 KB
/
DVDVideoCodec.cpp
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
/*
* Copyright (C) 2010-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "DVDVideoCodec.h"
#include "cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h"
#include <string>
#include <vector>
//******************************************************************************
// VideoPicture
//******************************************************************************
VideoPicture::VideoPicture() = default;
VideoPicture::~VideoPicture()
{
if (videoBuffer)
{
videoBuffer->Release();
}
}
void VideoPicture::Reset()
{
if (videoBuffer)
videoBuffer->Release();
videoBuffer = nullptr;
pts = DVD_NOPTS_VALUE;
dts = DVD_NOPTS_VALUE;
iFlags = 0;
iRepeatPicture = 0;
iDuration = 0;
iFrameType = 0;
color_space = AVCOL_SPC_UNSPECIFIED;
color_range = 0;
chroma_position = AVCHROMA_LOC_UNSPECIFIED;
color_primaries = AVColorPrimaries::AVCOL_PRI_UNSPECIFIED;
color_transfer = AVCOL_TRC_UNSPECIFIED;
colorBits = 8;
stereoMode.clear();
qp_table = nullptr;
qstride = 0;
qscale_type = 0;
pict_type = 0;
hdrType = StreamHdrType::HDR_TYPE_NONE;
hasDisplayMetadata = false;
hasLightMetadata = false;
iWidth = 0;
iHeight = 0;
iDisplayWidth = 0;
iDisplayHeight = 0;
}
VideoPicture& VideoPicture::CopyRef(const VideoPicture &pic)
{
if (videoBuffer)
videoBuffer->Release();
*this = pic;
if (videoBuffer)
videoBuffer->Acquire();
return *this;
}
VideoPicture& VideoPicture::SetParams(const VideoPicture &pic)
{
if (videoBuffer)
videoBuffer->Release();
*this = pic;
videoBuffer = nullptr;
return *this;
}
VideoPicture::VideoPicture(VideoPicture const&) = default;
VideoPicture& VideoPicture::operator=(VideoPicture const&) = default;