aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2024-06-18 07:27:28 -0700
committerRechi <Rechi@users.noreply.github.com>2024-06-18 07:27:28 -0700
commit13ba7adac93e3431ad3edc35c00eb6d8d993638e (patch)
treed3fea699602e6b9f6c2dbcef5395650d6a77d893
parent008c70a2fad8650d7553151280e4fe128cfb29e9 (diff)
[clang-tidy] modernize-make-shared
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp10
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp9
2 files changed, 9 insertions, 10 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp
index 5766e1d2b1..c420db32ea 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp
@@ -27,6 +27,7 @@
#include "utils/log.h"
#include <cassert>
+#include <memory>
#include <stdexcept>
#include <androidjni/ByteBuffer.h>
@@ -208,7 +209,7 @@ bool CDVDAudioCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
mimeTypes = codec_info.getSupportedTypes();
if (std::find(mimeTypes.begin(), mimeTypes.end(), m_mime) != mimeTypes.end())
{
- m_codec = std::shared_ptr<CJNIMediaCodec>(new CJNIMediaCodec(CJNIMediaCodec::createByCodecName(codecName)));
+ m_codec = std::make_shared<CJNIMediaCodec>(CJNIMediaCodec::createByCodecName(codecName));
if (xbmc_jnienv()->ExceptionCheck())
{
xbmc_jnienv()->ExceptionDescribe();
@@ -288,16 +289,15 @@ PROCESSDECODER:
{
CLog::Log(LOGDEBUG, "CDVDAudioCodecAndroidMediaCodec::Open Prefer the Google raw decoder "
"over the MediaTek one");
- m_codec = std::shared_ptr<CJNIMediaCodec>(
- new CJNIMediaCodec(CJNIMediaCodec::createByCodecName("OMX.google.raw.decoder")));
+ m_codec = std::make_shared<CJNIMediaCodec>(
+ CJNIMediaCodec::createByCodecName("OMX.google.raw.decoder"));
}
else
{
CLog::Log(
LOGDEBUG,
"CDVDAudioCodecAndroidMediaCodec::Open Use the raw decoder proposed by the platform");
- m_codec = std::shared_ptr<CJNIMediaCodec>(
- new CJNIMediaCodec(CJNIMediaCodec::createDecoderByType(m_mime)));
+ m_codec = std::make_shared<CJNIMediaCodec>(CJNIMediaCodec::createDecoderByType(m_mime));
}
if (xbmc_jnienv()->ExceptionCheck())
{
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
index 573f4acd18..4844bf0734 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
@@ -840,8 +840,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
{
if (types[j] == m_mime)
{
- m_codec = std::shared_ptr<CJNIMediaCodec>(
- new CJNIMediaCodec(CJNIMediaCodec::createByCodecName(m_codecname)));
+ m_codec = std::make_shared<CJNIMediaCodec>(CJNIMediaCodec::createByCodecName(m_codecname));
if (xbmc_jnienv()->ExceptionCheck())
{
xbmc_jnienv()->ExceptionDescribe();
@@ -921,7 +920,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
m_processInfo.SetVideoDeintMethod("hardware");
m_processInfo.SetVideoDAR(m_hints.aspect);
- m_videoBufferPool = std::shared_ptr<CMediaCodecVideoBufferPool>(new CMediaCodecVideoBufferPool(m_codec));
+ m_videoBufferPool = std::make_shared<CMediaCodecVideoBufferPool>(m_codec);
UpdateFpsDuration();
@@ -1832,9 +1831,9 @@ void CDVDVideoCodecAndroidMediaCodec::InitSurfaceTexture(void)
glBindTexture( GL_TEXTURE_EXTERNAL_OES, 0);
m_textureId = texture_id;
- m_surfaceTexture = std::shared_ptr<CJNISurfaceTexture>(new CJNISurfaceTexture(m_textureId));
+ m_surfaceTexture = std::make_shared<CJNISurfaceTexture>(m_textureId);
// hook the surfaceTexture OnFrameAvailable callback
- m_frameAvailable = std::shared_ptr<CDVDMediaCodecOnFrameAvailable>(new CDVDMediaCodecOnFrameAvailable(m_surfaceTexture));
+ m_frameAvailable = std::make_shared<CDVDMediaCodecOnFrameAvailable>(m_surfaceTexture);
m_jnivideosurface = CJNISurface(*m_surfaceTexture);
}
else