diff options
author | peak3d <pfau@peak3d.de> | 2018-01-31 09:06:13 +0100 |
---|---|---|
committer | peak3d <pfau@peak3d.de> | 2018-01-31 09:06:13 +0100 |
commit | f92e7035b4348e1f1b876a83e978a7bec785e1bc (patch) | |
tree | d890f7803d4d590f368cc69e8a4b2ea359c00236 | |
parent | ef81fe9ca70855708853a87a16a4897f1a08be96 (diff) |
Revert "[AML] compile fix (#13450)"
This reverts commit df582f47c6a4fc5b77c200ec3d65ab5c0f025eb5.
6 files changed, 29 insertions, 114 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp index d83fbda65b..d5100a6436 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp @@ -55,8 +55,7 @@ // amcodec include extern "C" { -#include <codec.h> -#include <amports/amstream.h> +#include <amcodec/codec.h> } // extern "C" CEvent g_aml_sync_event; @@ -346,44 +345,11 @@ typedef struct vframe_states int buf_avail_num; } vframe_states_t; -static int aml_ioctl_get(CODEC_HANDLE h, int subcmd, unsigned long paramter) -{ - struct am_ioctl_parm parm; - memset(&parm, 0, sizeof(parm)); - parm.cmd = subcmd; - parm.data_32 = *(unsigned int *)paramter; - if (ioctl(h, AMSTREAM_IOC_GET, (unsigned long)&parm) < 0) - { - CLog::Log(LOGERROR, "aml_ioctl_get failed: subcmd=%x, errno=%d", subcmd, errno); - return -1; - } - *(unsigned int *)paramter = parm.data_32; - return 0; -} - - -#ifndef AMSTREAM_IOC_MAGIC -#define AMSTREAM_IOC_MAGIC 'S' -#endif - #ifndef AMSTREAM_IOC_VF_STATUS +#define AMSTREAM_IOC_MAGIC 'S' #define AMSTREAM_IOC_VF_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x60, unsigned long) #endif -#ifndef AMSTREAM_IOC_GET_3D_TYPE -#define AMSTREAM_IOC_GET_3D_TYPE _IOW((AMSTREAM_IOC_MAGIC), 0x3d, unsigned int) -#endif - - -enum -{ - VPP_3D_MODE_NULL = 0, - VPP_3D_MODE_LR, - VPP_3D_MODE_TB, - VPP_3D_MODE_LA, - VPP_3D_MODE_FA -}; - /*************************************************************************/ /*************************************************************************/ void dumpfile_open(am_private_t *para) @@ -1512,8 +1478,8 @@ CAMLCodec::CAMLCodec(CProcessInfo &processInfo) , m_ptsIs64us(false) , m_speed(DVD_PLAYSPEED_NORMAL) , m_cur_pts(INT64_0) - , m_last_pts(0) , m_ptsOverflow(0) + , m_last_pts(0) , m_bufferIndex(-1) , m_state(0) , m_frameSizeSum(0) @@ -2282,45 +2248,18 @@ bool CAMLCodec::SetVideo3dMode(const int mode3d) std::string CAMLCodec::GetStereoMode() { - std::string stereoMode; - - //Get Decoder Stereo mode - int decoder_sm(VPP_3D_MODE_NULL); - aml_ioctl_get(am_private->vcodec.handle, AMSTREAM_IOC_GET_3D_TYPE, (unsigned long)&decoder_sm); - - switch (decoder_sm) - { - case VPP_3D_MODE_LR: - stereoMode = "left_right"; - break; - case VPP_3D_MODE_TB: - stereoMode = "top_bottom"; - break; - case VPP_3D_MODE_LA: - case VPP_3D_MODE_FA: - default: - switch(m_processInfo.GetVideoSettings().m_StereoMode) - { - case RENDER_STEREO_MODE_SPLIT_VERTICAL: - stereoMode = "left_right"; - break; - case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: - stereoMode = "top_bottom"; - break; - default: - stereoMode = m_hints.stereo_mode; - break; - } - } + std::string stereo_mode; - if (m_processInfo.GetVideoSettings().m_StereoInvert) + switch(m_processInfo.GetVideoSettings().m_StereoMode) { - if (stereoMode == "top_bottom") - stereoMode = "bottom_top"; - else if (stereoMode == "left_right") - stereoMode = "right_left"; + case RENDER_STEREO_MODE_SPLIT_VERTICAL: stereo_mode = "left_right"; break; + case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: stereo_mode = "top_bottom"; break; + default: stereo_mode = m_hints.stereo_mode; break; } - return stereoMode; + + if(m_processInfo.GetVideoSettings().m_StereoInvert) + stereo_mode = RenderManager::GetStereoModeInvert(stereo_mode); + return stereo_mode; } void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp index 50c020e69e..e12dc7c869 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp @@ -42,39 +42,6 @@ VideoPicture::~VideoPicture() } } -void VideoPicture::Reset() -{ - if (videoBuffer) - videoBuffer->Reset(); - 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 = 0; - color_primaries = 0; - color_transfer = 0; - colorBits = 8; - stereoMode.clear(); - - qp_table = nullptr; - qstride = 0; - qscale_type = 0; - pict_type = 0; - - hasDisplayMetadata = false; - hasLightMetadata = false; - - iWidth = 0; - iHeight = 0; - iDisplayWidth = 0; - iDisplayHeight = 0; -} - VideoPicture& VideoPicture::CopyRef(const VideoPicture &pic) { if (videoBuffer) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h index 20a13d8c93..e482ea9e73 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h @@ -53,7 +53,6 @@ public: ~VideoPicture(); VideoPicture& CopyRef(const VideoPicture &pic); VideoPicture& SetParams(const VideoPicture &pic); - void Reset(); // reinitialize members, videoBuffer will be released if set! CVideoBuffer *videoBuffer = nullptr; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp index 1e5dd5a164..f84c6573d2 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp @@ -280,10 +280,17 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option } // allocate a dummy VideoPicture buffer. - m_videobuffer.Reset(); - + // first make sure all properties are reset. + memset(&m_videobuffer, 0, sizeof(VideoPicture)); + + m_videobuffer.dts = DVD_NOPTS_VALUE; + m_videobuffer.pts = DVD_NOPTS_VALUE; + m_videobuffer.color_range = 0; + m_videobuffer.color_matrix = 4; + m_videobuffer.iFlags = 0; m_videobuffer.iWidth = m_hints.width; m_videobuffer.iHeight = m_hints.height; + m_videobuffer.videoBuffer = nullptr; m_videobuffer.iDisplayWidth = m_videobuffer.iWidth; m_videobuffer.iDisplayHeight = m_videobuffer.iHeight; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index 8676b292ef..c3fc3e95ff 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -355,7 +355,7 @@ CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec(CProcessInfo &p , m_render_surface(surface_render) , m_mpeg2_sequence(nullptr) { - m_videobuffer.Reset(); + memset(&m_videobuffer, 0x00, sizeof(VideoPicture)); } CDVDVideoCodecAndroidMediaCodec::~CDVDVideoCodecAndroidMediaCodec() @@ -681,8 +681,12 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio // setup a YUV420P VideoPicture buffer. // first make sure all properties are reset. - m_videobuffer.Reset(); + memset(&m_videobuffer, 0x00, sizeof(VideoPicture)); + m_videobuffer.dts = DVD_NOPTS_VALUE; + m_videobuffer.pts = DVD_NOPTS_VALUE; + m_videobuffer.color_range = 0; + m_videobuffer.color_space = 4; m_videobuffer.iWidth = m_hints.width; m_videobuffer.iHeight = m_hints.height; // these will get reset to crop values later diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp index 726424fc7e..cbfb32fd09 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp @@ -27,8 +27,7 @@ #include "utils/ScreenshotAML.h" #include "settings/MediaSettings.h" #include "cores/VideoPlayer/VideoRenderers/RenderCapture.h" -#include "cores/VideoPlayer/VideoRenderers/RenderFactory.h" -#include "cores/VideoPlayer/VideoRenderers/RenderFlags.h" +#include "../RenderFactory.h" #include "settings/AdvancedSettings.h" CRendererAML::CRendererAML() @@ -63,7 +62,7 @@ bool CRendererAML::Configure(const VideoPicture &picture, float fps, unsigned in m_renderOrientation = orientation; m_iFlags = GetFlagsChromaPosition(picture.chroma_position) | - GetFlagsColorMatrix(picture.color_space, picture.iWidth, picture.iHeight) | + GetFlagsColorMatrix(picture.color_matrix, picture.iWidth, picture.iHeight) | GetFlagsColorPrimaries(picture.color_primaries) | GetFlagsStereoMode(picture.stereoMode); |