Audacity
3.2.0
modules
import-export
mod-ffmpeg
lib-ffmpeg-support
wrappers
AVPacketWrapper.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
3
Audacity: A Digital Audio Editor
4
5
AVPacketWrapper.cpp
6
7
Dmitry Vedenko
8
9
**********************************************************************/
10
11
#include "
AVPacketWrapper.h
"
12
13
#include "
FFmpegFunctions.h
"
14
15
AVPacketWrapper::AVPacketWrapper
(
const
FFmpegFunctions
& ffmpeg) noexcept
16
: mFFmpeg(ffmpeg)
17
{
18
}
19
20
AVPacket
*
AVPacketWrapper::GetWrappedValue
() noexcept
21
{
22
return
mAVPacket
;
23
}
24
25
const
AVPacket
*
AVPacketWrapper::GetWrappedValue
() const noexcept
26
{
27
return
mAVPacket
;
28
}
29
30
AVPacketWrapper::~AVPacketWrapper
()
31
{
32
if
(
mAVPacket
!=
nullptr
)
33
{
34
if
(!
mUseAVFree
)
35
{
36
mFFmpeg
.
av_packet_free
(&
mAVPacket
);
37
}
38
else
39
{
40
mFFmpeg
.
av_packet_unref
(
mAVPacket
);
41
mFFmpeg
.
av_free
(
mAVPacket
);
42
}
43
}
44
}
AVPacketWrapper.h
FFmpegFunctions.h
AVPacketWrapper::mFFmpeg
const FFmpegFunctions & mFFmpeg
Definition:
AVPacketWrapper.h:65
AVPacketWrapper::~AVPacketWrapper
virtual ~AVPacketWrapper()
Definition:
AVPacketWrapper.cpp:30
AVPacketWrapper::GetWrappedValue
AVPacket * GetWrappedValue() noexcept
Definition:
AVPacketWrapper.cpp:20
AVPacketWrapper::mAVPacket
AVPacket * mAVPacket
Definition:
AVPacketWrapper.h:66
AVPacketWrapper::AVPacketWrapper
AVPacketWrapper(const AVPacketWrapper &)=delete
AVPacketWrapper::mUseAVFree
bool mUseAVFree
Definition:
AVPacketWrapper.h:68
AVCodecFunctions::av_packet_unref
void(* av_packet_unref)(AVPacket *pkt)
Definition:
AVCodecFunctions.h:24
AVCodecFunctions::av_packet_free
void(* av_packet_free)(AVPacket **pkt)
Definition:
AVCodecFunctions.h:39
AVPacket
Definition:
ffmpeg-2.3.6-single-header.h:2801
AVUtilFunctions::av_free
void(* av_free)(void *ptr)
Definition:
AVUtilFunctions.h:23
FFmpegFunctions
Definition:
FFmpegFunctions.h:85
Generated by
1.9.3