Skip to content
Permalink
Browse files

Merge pull request #14192 from Rechi/cleanup/warnings

[cleanup] silence casts away qualifiers warnings
  • Loading branch information...
Rechi committed Jul 21, 2018
2 parents 472e96e + 9e0fc73 commit 0b8f23abe8b9e637071107f3c0c8dac8e89b7b9a
Showing with 279 additions and 280 deletions.
  1. +1 −1 xbmc/Util.cpp
  2. +2 −1 xbmc/addons/AddonManager.cpp
  3. +1 −1 xbmc/addons/binary-addons/AddonDll.cpp
  4. +1 −1 xbmc/addons/interfaces/AddonInterfaces.cpp
  5. +5 −5 xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
  6. +10 −10 xbmc/addons/test/TestAddonFactory.cpp
  7. +1 −1 xbmc/cdrip/Encoder.cpp
  8. +2 −1 xbmc/cdrip/EncoderFFmpeg.cpp
  9. +2 −1 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
  10. +2 −2 xbmc/cores/AudioEngine/Utils/AEELDParser.cpp
  11. +2 −2 xbmc/cores/DllLoader/DllLoader.cpp
  12. +1 −1 xbmc/cores/DllLoader/exports/emu_dummy.cpp
  13. +3 −3 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
  14. +1 −1 xbmc/cores/DllLoader/exports/emu_msvcrt.h
  15. +1 −1 xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
  16. +1 −1 xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder.c
  17. +1 −1 xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder.h
  18. +3 −3 xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder708.cpp
  19. +3 −2 xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoPPFFmpeg.cpp
  20. +6 −3 xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
  21. +1 −1 xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleParserSSA.cpp
  22. +3 −2 xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.cpp
  23. +1 −1 xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitlesLibass.h
  24. +10 −10 xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VdpauGL.cpp
  25. +2 −2 xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp
  26. +2 −2 xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGL.cpp
  27. +5 −5 xbmc/dbwrappers/mysqldataset.cpp
  28. +9 −9 xbmc/filesystem/CurlFile.cpp
  29. +1 −1 xbmc/filesystem/ISO9660Directory.cpp
  30. +3 −3 xbmc/filesystem/ISOFile.cpp
  31. +2 −1 xbmc/filesystem/NFSFile.cpp
  32. +2 −2 xbmc/filesystem/PipesManager.cpp
  33. +3 −3 xbmc/filesystem/ZipFile.cpp
  34. +24 −24 xbmc/filesystem/ZipManager.cpp
  35. +3 −3 xbmc/filesystem/iso9660.cpp
  36. +2 −2 xbmc/filesystem/iso9660.h
  37. +1 −1 xbmc/guilib/GUIEditControl.cpp
  38. +1 −1 xbmc/guilib/GUIVisualisationControl.cpp
  39. +3 −3 xbmc/interfaces/legacy/AddonClass.h
  40. +1 −1 xbmc/interfaces/legacy/AddonUtils.cpp
  41. +1 −1 xbmc/interfaces/legacy/AddonUtils.h
  42. +24 −24 xbmc/interfaces/legacy/Control.cpp
  43. +2 −1 xbmc/interfaces/python/ContextItemAddonInvoker.cpp
  44. +3 −3 xbmc/interfaces/python/LanguageHook.cpp
  45. +10 −8 xbmc/interfaces/python/PythonInvoker.cpp
  46. +20 −19 xbmc/interfaces/python/PythonSwig.cpp.template
  47. +3 −2 xbmc/interfaces/python/XBPython.cpp
  48. +1 −1 xbmc/interfaces/python/swig.cpp
  49. +3 −3 xbmc/network/AirTunesServer.cpp
  50. +1 −1 xbmc/network/EventPacket.cpp
  51. +1 −1 xbmc/network/Network.cpp
  52. +6 −5 xbmc/network/WebServer.cpp
  53. +3 −3 xbmc/network/cddb.cpp
  54. +1 −1 xbmc/network/httprequesthandler/HTTPFileHandler.cpp
  55. +3 −2 xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
  56. +6 −6 xbmc/network/websocket/WebSocket.cpp
  57. +2 −6 xbmc/network/websocket/WebSocketManager.cpp
  58. +1 −3 xbmc/network/websocket/WebSocketV13.cpp
  59. +1 −3 xbmc/network/websocket/WebSocketV8.cpp
  60. +17 −17 xbmc/pictures/ExifParse.cpp
  61. +3 −3 xbmc/pictures/IptcParse.cpp
  62. +2 −2 xbmc/pictures/PictureInfoTag.cpp
  63. +1 −1 xbmc/platform/linux/storage/UDevProvider.cpp
  64. +5 −3 xbmc/platform/posix/filesystem/SMBFile.cpp
  65. +2 −8 xbmc/threads/test/TestHelpers.h
  66. +2 −3 xbmc/utils/HttpResponse.cpp
  67. +1 −1 xbmc/utils/HttpResponse.h
  68. +8 −8 xbmc/utils/StringUtils.cpp
  69. +2 −6 xbmc/utils/test/TestHttpResponse.cpp
  70. +4 −4 xbmc/video/Teletext.cpp
  71. +1 −1 xbmc/video/Teletext.h
  72. +8 −8 xbmc/video/VideoDatabase.cpp
  73. +3 −3 xbmc/windowing/X11/WinSystemX11.cpp
@@ -1654,7 +1654,7 @@ bool CUtil::Command(const std::vector<std::string>& arrArgs, bool waitExit)
char **args = (char **)alloca(sizeof(char *) * (arrArgs.size() + 3));
memset(args, 0, (sizeof(char *) * (arrArgs.size() + 3)));
for (size_t i=0; i<arrArgs.size(); i++)
args[i] = (char *)arrArgs[i].c_str();
args[i] = const_cast<char *>(arrArgs[i].c_str());
execvp(args[0], args);
}
}
@@ -985,7 +985,8 @@ std::string CAddonMgr::GetTranslatedString(const cp_cfg_element_t *root, const c
if (strcmp(tag, child.name) == 0)
{
// see if we have a "lang" attribute
const char *lang = cp_lookup_cfg_value((cp_cfg_element_t*)&child, "@lang");
//! @bug libcpluff isn't const correct
const char *lang = cp_lookup_cfg_value(const_cast<cp_cfg_element_t*>(&child), "@lang");
if (lang != NULL && g_langInfo.GetLocale().Matches(lang))
translatedValues.insert(std::make_pair(lang, child.value != NULL ? child.value : ""));
else if (lang == NULL || strcmp(lang, "en") == 0 || strcmp(lang, "en_GB") == 0)
@@ -577,7 +577,7 @@ void CAddonDll::DeInitInterface()
Interface_General::DeInit(&m_interface);

if (m_interface.libBasePath)
free((char*)m_interface.libBasePath);
free(const_cast<char*>(m_interface.libBasePath));
if (m_interface.toKodi)
free((char*)m_interface.toKodi);
if (m_interface.toAddon)
@@ -64,7 +64,7 @@ CAddonInterfaces::~CAddonInterfaces()
delete static_cast<KodiAPI::AddOn::CAddonCallbacksAddon*>(m_helperAddOn);
delete static_cast<KodiAPI::GUI::CAddonCallbacksGUI*>(m_helperGUI);

free((char*)m_callbacks->libBasePath);
free(const_cast<char*>(m_callbacks->libBasePath));
delete m_callbacks;
}

@@ -264,11 +264,11 @@ class CSettingValue
explicit CSettingValue(const void *settingValue) : m_settingValue(settingValue) {}

bool empty() const { return (m_settingValue == nullptr) ? true : false; }
std::string GetString() const { return (char*)m_settingValue; }
int GetInt() const { return *(int*)m_settingValue; }
unsigned int GetUInt() const { return *(unsigned int*)m_settingValue; }
bool GetBoolean() const { return *(bool*)m_settingValue; }
float GetFloat() const { return *(float*)m_settingValue; }
std::string GetString() const { return (const char*)m_settingValue; }
int GetInt() const { return *(const int*)m_settingValue; }
unsigned int GetUInt() const { return *(const unsigned int*)m_settingValue; }
bool GetBoolean() const { return *(const bool*)m_settingValue; }
float GetFloat() const { return *(const float*)m_settingValue; }

private:
const void *m_settingValue;
@@ -60,8 +60,8 @@ TEST_F(TestAddonFactory, ShouldFailWhenAddonDoesNotHaveRequestedType)
TEST_F(TestAddonFactory, ShouldPickFirstExtensionWhenNotRequestingSpecificType)
{
cp_extension_t extensions[2] = {
{&plugin, (char*)"xbmc.python.script", nullptr, nullptr, nullptr, nullptr},
{&plugin, (char*)"xbmc.python.service", nullptr, nullptr, nullptr, nullptr},
{&plugin, const_cast<char*>("xbmc.python.script"), nullptr, nullptr, nullptr, nullptr},
{&plugin, const_cast<char*>("xbmc.python.service"), nullptr, nullptr, nullptr, nullptr},
};
plugin.extensions = extensions;
plugin.num_extensions = 2;
@@ -74,7 +74,7 @@ TEST_F(TestAddonFactory, ShouldPickFirstExtensionWhenNotRequestingSpecificType)
TEST_F(TestAddonFactory, ShouldIgnoreMetadataExtension)
{
cp_extension_t extensions[2] = {
{&plugin, (char*)"kodi.addon.metadata", nullptr, nullptr, nullptr, nullptr},
{&plugin, const_cast<char*>("kodi.addon.metadata"), nullptr, nullptr, nullptr, nullptr},
scriptExtension,
};
plugin.extensions = extensions;
@@ -88,7 +88,7 @@ TEST_F(TestAddonFactory, ShouldIgnoreMetadataExtension)

TEST_F(TestAddonFactory, ShouldReturnDependencyInfoWhenNoExtensions)
{
cp_plugin_import_t import{(char*)"a.b", (char*)"1.2.3", 0};
cp_plugin_import_t import{const_cast<char*>("a.b"), const_cast<char*>("1.2.3"), 0};
plugin.extensions = nullptr;
plugin.num_extensions = 0;
plugin.num_imports = 1;
@@ -102,7 +102,7 @@ TEST_F(TestAddonFactory, ShouldReturnDependencyInfoWhenNoExtensions)

TEST_F(TestAddonFactory, ShouldAcceptUnversionedDependencies)
{
cp_plugin_import_t import{(char*)"a.b", nullptr, 0};
cp_plugin_import_t import{const_cast<char*>("a.b"), nullptr, 0};
plugin.extensions = nullptr;
plugin.num_extensions = 0;
plugin.num_imports = 1;
@@ -127,22 +127,22 @@ TEST_F(TestAddonFactory, IconPathShouldBeBuiltFromPluginPath)
TEST_F(TestAddonFactory, AssetsElementShouldOverrideImplicitArt)
{
cp_cfg_element_t icon{0};
icon.name = (char*)"icon";
icon.value = (char*)"foo/bar.jpg";
icon.name = const_cast<char*>("icon");
icon.value = const_cast<char*>("foo/bar.jpg");

cp_cfg_element_t assets{0};
assets.name = (char*)"assets";
assets.name = const_cast<char*>("assets");
assets.num_children = 1;
assets.children = &icon;

cp_cfg_element_t root{0};
root.name = (char*)"kodi.addon.metadata";
root.name = const_cast<char*>("kodi.addon.metadata");
root.num_children = 1;
root.children = &assets;
assets.parent = &root;
icon.parent = &assets;

cp_extension_t metadata = {&plugin, (char*)"kodi.addon.metadata", nullptr, nullptr, nullptr, &root};
cp_extension_t metadata = {&plugin, const_cast<char*>("kodi.addon.metadata"), nullptr, nullptr, nullptr, &root};

cp_extension_t extensions[1] = {metadata};
plugin.extensions = extensions;
@@ -147,7 +147,7 @@ int CEncoder::WriteStream(const void *pBuffer, uint32_t iBytes)
m_dwWriteBufferPointer = 0;

// pbtRemaining = pBuffer + bytesWritten
uint8_t* pbtRemaining = (uint8_t *)pBuffer + (iBytes - dwBytesRemaining);
const uint8_t* pbtRemaining = (const uint8_t *)pBuffer + (iBytes - dwBytesRemaining);
if (dwBytesRemaining > WRITEBUFFER_SIZE)
{
// data is not going to fit in our buffer, just write it to disk
@@ -294,7 +294,8 @@ bool CEncoderFFmpeg::WriteFrame()

if(m_NeedConversion)
{
if (swr_convert(m_SwrCtx, m_ResampledFrame->extended_data, m_NeededFrames, (const uint8_t**)m_BufferFrame->extended_data, m_NeededFrames) < 0)
//! @bug libavresample isn't const correct
if (swr_convert(m_SwrCtx, m_ResampledFrame->extended_data, m_NeededFrames, const_cast<const uint8_t**>(m_BufferFrame->extended_data), m_NeededFrames) < 0)
{
CLog::Log(LOGERROR, "CEncoderFFmpeg::WriteFrame - Error resampling audio");
return false;
@@ -198,7 +198,8 @@ int CActiveAEResampleFFMPEG::Resample(uint8_t **dst_buffer, int dst_samples, uin
}
}

int ret = swr_convert(m_pContext, dst_buffer, dst_samples, (const uint8_t**)src_buffer, src_samples);
//! @bug libavresample isn't const correct
int ret = swr_convert(m_pContext, dst_buffer, dst_samples, const_cast<const uint8_t**>(src_buffer), src_samples);
if (ret < 0)
{
CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Resample - resample failed");
@@ -107,12 +107,12 @@ void CAEELDParser::Parse(const uint8_t *data, size_t length, CAEDeviceInfo& info
header.fc = (data[7 ] & 0x04) == 0x04;
header.lfe = (data[7 ] & 0x02) == 0x02;
header.flr = (data[7 ] & 0x01) == 0x01;
header.port_id = Endian_SwapLE64(*((uint64_t*)(data + 8)));
header.port_id = Endian_SwapLE64(*((const uint64_t*)(data + 8)));
header.mfg_name[0] = 'A' + ((data[16] >> 2) & 0x1F) - 1;
header.mfg_name[1] = 'A' + (((data[16] << 3) | (data[17] >> 5)) & 0x1F) - 1;
header.mfg_name[2] = 'A' + (data[17] & 0x1F) - 1;
header.mfg_name[3] = '\0';
header.product_code = Endian_SwapLE16(*((uint16_t*)(data + 18)));
header.product_code = Endian_SwapLE16(*((const uint16_t*)(data + 18)));

switch (header.conn_type)
{
@@ -565,7 +565,7 @@ void DllLoader::AddExport(char* sFunctionName, unsigned long ordinal, void* func
entry->exp.ordinal = ordinal;
entry->exp.track_function = track_function;
entry->exp.name = ((char*)(entry)) + len;
strcpy((char*)entry->exp.name, sFunctionName);
strcpy(const_cast<char*>(entry->exp.name), sFunctionName);

entry->next = m_pExportHead;
m_pExportHead = entry;
@@ -582,7 +582,7 @@ void DllLoader::AddExport(char* sFunctionName, void* function, void* track_funct
entry->exp.ordinal = -1;
entry->exp.track_function = track_function;
entry->exp.name = ((char*)(entry)) + len;
strcpy((char*)entry->exp.name, sFunctionName);
strcpy(const_cast<char*>(entry->exp.name), sFunctionName);

entry->next = m_pExportHead;
m_pExportHead = entry;
@@ -25,7 +25,7 @@ extern "C" void not_implement( const char* debuginfo)
{
if (debuginfo)
{
CLog::Log(LOGDEBUG, "%s", (char*)debuginfo);
CLog::Log(LOGDEBUG, "%s", debuginfo);
}
}

@@ -1367,7 +1367,7 @@ extern "C"
const size_t bufSize = size * count;
do // fwrite() must write all data until whole buffer is written or error occurs
{
const ssize_t w = pFile->Write(((int8_t*)buffer) + written, bufSize - written);
const ssize_t w = pFile->Write(((const int8_t*)buffer) + written, bufSize - written);
if (w <= 0)
break;
written += w;
@@ -1811,10 +1811,10 @@ extern "C"
#endif
}

char* dll_getcwd(char *buffer, int maxlen)
const char* dll_getcwd(char *buffer, int maxlen)
{
not_implement("msvcrt.dll fake function dll_getcwd() called\n");
return (char*)"special://xbmc/";
return "special://xbmc/";
}

int dll_putenv(const char* envstring)
@@ -143,7 +143,7 @@ extern "C"
void dllperror(const char* s);
char* dllstrerror(int iErr);
int dll_mkdir(const char* dir);
char* dll_getcwd(char *buffer, int maxlen);
const char* dll_getcwd(char *buffer, int maxlen);
int dll_putenv(const char* envstring);
int dll_ctype(int i);
int dll_system(const char *command);
@@ -108,7 +108,7 @@ int CDVDOverlayCodecSSA::Decode(DemuxPacket *pPacket)

line2 = StringUtils::Format("%d,%s,%s", m_order++, layer.get(), line.substr(pos+1).c_str());

m_libass->DecodeDemuxPkt((char*)line2.c_str(), line2.length(), beg, end - beg);
m_libass->DecodeDemuxPkt(line2.c_str(), line2.length(), beg, end - beg);

/* setup time spanning all dialogs */
if(pts == DVD_NOPTS_VALUE || beg < pts)
@@ -570,7 +570,7 @@ static void cc_decode_EIA608(cc_decoder_t *dec, uint16_t data)
}


void decode_cc(cc_decoder_t *dec, uint8_t *buffer, uint32_t buf_len)
void decode_cc(cc_decoder_t *dec, const uint8_t *buffer, uint32_t buf_len)
{
uint32_t i;
for (i = 0; i<buf_len; i += 3)
@@ -114,4 +114,4 @@ cc_decoder_t *cc_decoder_open();
void cc_decoder_close(cc_decoder_t *this_obj);
void cc_decoder_init(void);

void decode_cc(cc_decoder_t *dec, uint8_t *buffer, uint32_t buf_len);
void decode_cc(cc_decoder_t *dec, const uint8_t *buffer, uint32_t buf_len);
@@ -165,8 +165,8 @@ void cc708_reset(cc708_service_decoder *decoders)

int compWindowsPriorities (const void *a, const void *b)
{
e708Window *w1=*(e708Window **)a;
e708Window *w2=*(e708Window **)b;
const e708Window *w1=*(e708Window * const*)a;
const e708Window *w2=*(e708Window * const*)b;
return w1->priority-w2->priority;
}

@@ -1093,7 +1093,7 @@ void decode_708 (const unsigned char *data, int datalength, cc708_service_decode
case 0:
// only use 608 as fallback
if (!decoders[0].parent->m_seen708)
decode_cc(decoders[0].parent->m_cc608decoder, (uint8_t*)data+i, 3);
decode_cc(decoders[0].parent->m_cc608decoder, (const uint8_t*)data+i, 3);
break;
case 2:
if (cc_valid==0) // This ends the previous packet if complete
@@ -71,7 +71,7 @@ bool CDVDVideoPPFFmpeg::CheckInit(int iWidth, int iHeight)
m_iInitWidth = iWidth;
m_iInitHeight = iHeight;

m_pMode = pp_get_mode_by_name_and_quality((char *)m_sType.c_str(), PP_QUALITY_MAX);
m_pMode = pp_get_mode_by_name_and_quality(m_sType.c_str(), PP_QUALITY_MAX);
}

if (m_pMode)
@@ -122,7 +122,8 @@ void CDVDVideoPPFFmpeg::Process(VideoPicture* pPicture)

videoBuffer->SetDimensions(pPicture->iWidth, pPicture->iHeight, srcStrides);
videoBuffer->GetPlanes(dstPlanes);
pp_postprocess((const uint8_t **)srcPlanes, srcStrides,
//! @bug libpostproc isn't const correct
pp_postprocess(const_cast<const uint8_t **>(srcPlanes), srcStrides,
dstPlanes, srcStrides,
pSource->iWidth, pSource->iHeight,
pSource->qp_table, pSource->qstride,
@@ -175,21 +175,24 @@ bool CDVDInputStreamNavigator::Open()
{
CLog::Log(LOGERROR, "Error on setting default menu language: %s\n", m_dll.dvdnav_err_to_string(m_dvdnav));
CLog::Log(LOGERROR, "Defaulting to \"en\"");
m_dll.dvdnav_menu_language_select(m_dvdnav, (char*)"en");
//! @bug libdvdnav isn't const correct
m_dll.dvdnav_menu_language_select(m_dvdnav, const_cast<char*>("en"));
}

if (m_dll.dvdnav_audio_language_select(m_dvdnav, (char*)language_audio) != DVDNAV_STATUS_OK)
{
CLog::Log(LOGERROR, "Error on setting default audio language: %s\n", m_dll.dvdnav_err_to_string(m_dvdnav));
CLog::Log(LOGERROR, "Defaulting to \"en\"");
m_dll.dvdnav_audio_language_select(m_dvdnav, (char*)"en");
//! @bug libdvdnav isn't const correct
m_dll.dvdnav_audio_language_select(m_dvdnav, const_cast<char*>("en"));
}

if (m_dll.dvdnav_spu_language_select(m_dvdnav, (char*)language_subtitle) != DVDNAV_STATUS_OK)
{
CLog::Log(LOGERROR, "Error on setting default subtitle language: %s\n", m_dll.dvdnav_err_to_string(m_dvdnav));
CLog::Log(LOGERROR, "Defaulting to \"en\"");
m_dll.dvdnav_spu_language_select(m_dvdnav, (char*)"en");
//! @bug libdvdnav isn't const correct
m_dll.dvdnav_spu_language_select(m_dvdnav, const_cast<char*>("en"));
}

// set read ahead cache usage
@@ -41,7 +41,7 @@ bool CDVDSubtitleParserSSA::Open(CDVDStreamInfo &hints)
return false;

std::string buffer = m_pStream->m_stringstream.str();
if(!m_libass->CreateTrack((char*) buffer.c_str(), buffer.length()))
if(!m_libass->CreateTrack(const_cast<char*>(buffer.c_str()), buffer.length()))
return false;

//Creating the overlays by going through the list of ass_events
@@ -106,7 +106,7 @@ bool CDVDSubtitlesLibass::DecodeHeader(char* data, int size)
return true;
}

bool CDVDSubtitlesLibass::DecodeDemuxPkt(char* data, int size, double start, double duration)
bool CDVDSubtitlesLibass::DecodeDemuxPkt(const char* data, int size, double start, double duration)
{
CSingleLock lock(m_section);
if(!m_track)
@@ -115,7 +115,8 @@ bool CDVDSubtitlesLibass::DecodeDemuxPkt(char* data, int size, double start, dou
return false;
}

ass_process_chunk(m_track, data, size, DVD_TIME_TO_MSEC(start), DVD_TIME_TO_MSEC(duration));
//! @bug libass isn't const correct
ass_process_chunk(m_track, const_cast<char*>(data), size, DVD_TIME_TO_MSEC(start), DVD_TIME_TO_MSEC(duration));
return true;
}

@@ -39,7 +39,7 @@ class CDVDSubtitlesLibass : public IDVDResourceCounted<CDVDSubtitlesLibass>
int GetNrOfEvents();

bool DecodeHeader(char* data, int size);
bool DecodeDemuxPkt(char* data, int size, double start, double duration);
bool DecodeDemuxPkt(const char* data, int size, double start, double duration);
bool CreateTrack(char* buf, size_t size);

private:
@@ -35,16 +35,16 @@ bool CInteropState::Init(void *device, void *procFunc, int64_t ident)
m_procFunc = procFunc;
m_ident = ident;

m_interop.glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glXGetProcAddress((GLubyte *) "glVDPAUInitNV");
m_interop.glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glXGetProcAddress((GLubyte *) "glVDPAUFiniNV");
m_interop.glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glXGetProcAddress((GLubyte *) "glVDPAURegisterOutputSurfaceNV");
m_interop.glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glXGetProcAddress((GLubyte *) "glVDPAURegisterVideoSurfaceNV");
m_interop.glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glXGetProcAddress((GLubyte *) "glVDPAUIsSurfaceNV");
m_interop.glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glXGetProcAddress((GLubyte *) "glVDPAUUnregisterSurfaceNV");
m_interop.glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glXGetProcAddress((GLubyte *) "glVDPAUSurfaceAccessNV");
m_interop.glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glXGetProcAddress((GLubyte *) "glVDPAUMapSurfacesNV");
m_interop.glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glXGetProcAddress((GLubyte *) "glVDPAUUnmapSurfacesNV");
m_interop.glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glXGetProcAddress((GLubyte *) "glVDPAUGetSurfaceivNV");
m_interop.glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUInitNV");
m_interop.glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUFiniNV");
m_interop.glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glXGetProcAddress((const GLubyte *) "glVDPAURegisterOutputSurfaceNV");
m_interop.glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glXGetProcAddress((const GLubyte *) "glVDPAURegisterVideoSurfaceNV");
m_interop.glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUIsSurfaceNV");
m_interop.glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUUnregisterSurfaceNV");
m_interop.glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUSurfaceAccessNV");
m_interop.glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUMapSurfacesNV");
m_interop.glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUUnmapSurfacesNV");
m_interop.glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glXGetProcAddress((const GLubyte *) "glVDPAUGetSurfaceivNV");

while (glGetError() != GL_NO_ERROR);
m_interop.glVDPAUInitNV(m_device, m_procFunc);
@@ -336,13 +336,13 @@ void CLinuxRendererGLES::LoadPlane(YUVPLANE& plane, int type,
glTexSubImage2D( m_textureTarget, 0
, 0, height, width, 1
, type, datatype
, (unsigned char*)pixelData + stride * (height-1));
, (const unsigned char*)pixelData + stride * (height-1));

if (width < plane.texwidth)
glTexSubImage2D( m_textureTarget, 0
, width, 0, 1, height
, type, datatype
, (unsigned char*)pixelData + bps * (width-1));
, (const unsigned char*)pixelData + bps * (width-1));

glBindTexture(m_textureTarget, 0);
}

0 comments on commit 0b8f23a

Please sign in to comment.
You can’t perform that action at this time.