diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index ce040da7e0ad1..72b0062f4bc34 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -13796,7 +13796,13 @@ msgctxt "#20473" msgid "Premiered" msgstr "" -#empty strings from id 20474 to 21329 +#. Used in smart playlists to select items based on the HDR type (HDR10, HLG, Dolbyvision) +#: xbmc/playlists/SmartPlayList.cpp +msgctxt "#20474" +msgid "HDR type" +msgstr "" + +#empty strings from id 20475 to 21329 #up to 21329 is reserved for the video db !! ! #: system/settings/settings.xml diff --git a/addons/skin.estuary/media/flags/videohdr/dolbyvision.png b/addons/skin.estuary/media/flags/videohdr/dolbyvision.png new file mode 100644 index 0000000000000..be72883ca7a85 Binary files /dev/null and b/addons/skin.estuary/media/flags/videohdr/dolbyvision.png differ diff --git a/addons/skin.estuary/media/flags/videohdr/hdr10.png b/addons/skin.estuary/media/flags/videohdr/hdr10.png new file mode 100644 index 0000000000000..e4b671fe1238c Binary files /dev/null and b/addons/skin.estuary/media/flags/videohdr/hdr10.png differ diff --git a/addons/skin.estuary/media/flags/videohdr/hlg.png b/addons/skin.estuary/media/flags/videohdr/hlg.png new file mode 100644 index 0000000000000..a8bc078d70d37 Binary files /dev/null and b/addons/skin.estuary/media/flags/videohdr/hlg.png differ diff --git a/addons/skin.estuary/xml/DialogSeekBar.xml b/addons/skin.estuary/xml/DialogSeekBar.xml index 82be30e3bd8c0..c9bb588dce9df 100644 --- a/addons/skin.estuary/xml/DialogSeekBar.xml +++ b/addons/skin.estuary/xml/DialogSeekBar.xml @@ -57,7 +57,7 @@ right Animation_BottomSlide horizontal - 10 + 5 [Player.ShowInfo | Window.IsActive(fullscreeninfo)] + !Player.ChannelPreviewActive + Window.IsActive(fullscreenvideo) Visible @@ -66,6 +66,10 @@ + + + + diff --git a/addons/skin.estuary/xml/Includes.xml b/addons/skin.estuary/xml/Includes.xml index 22427c82fabd4..58a3a08dfb6ae 100644 --- a/addons/skin.estuary/xml/Includes.xml +++ b/addons/skin.estuary/xml/Includes.xml @@ -402,6 +402,10 @@ + + + + diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 40845c49a5986..a7d16c72fa30f 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -3759,6 +3759,13 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// @skinning_v20 **[New Infolabel]** \link VideoPlayer_AudioStreamCount `VideoPlayer.AudioStreamCount`\endlink ///

/// } +///   \table_row3{   `VideoPlayer.HdrType`, +///                  \anchor VideoPlayer_HdrType +///                  _string_, +///     @return String containing the name of the detected HDR type or empty if not HDR. See \ref StreamHdrType for the list of possible values. +///    


+///     @skinning_v20 **[New Infolabel]** \link ListItem_HdrType `ListItem.HdrType`\endlink +///   } /// \table_end /// /// ----------------------------------------------------------------------------- @@ -3832,6 +3839,7 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE }, { "uniqueid", VIDEOPLAYER_UNIQUEID }, { "tvshowdbid", VIDEOPLAYER_TVSHOWDBID }, { "audiostreamcount", VIDEOPLAYER_AUDIOSTREAMCOUNT }, + { "hdrtype", VIDEOPLAYER_HDR_TYPE }, }; /// \page modules__infolabels_boolean_conditions @@ -6700,6 +6708,13 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, ///


/// @skinning_v19 **[New Infolabel]** \link ListItem_AlbumStatus `ListItem.AlbumStatus`\endlink /// } +///   \table_row3{   `ListItem.HdrType`, +///                  \anchor ListItem_HdrType +///                  _string_, +///     @return String containing the name of the detected HDR type or empty if not HDR. See \ref StreamHdrType for the list of possible values. +///    


+///     @skinning_v20 **[New Infolabel]** \link ListItem_HdrType `ListItem.HdrType`\endlink +///   } /// \table_end /// /// ----------------------------------------------------------------------------- @@ -6911,6 +6926,7 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB }, { "tvshowdbid", LISTITEM_TVSHOWDBID }, { "albumstatus", LISTITEM_ALBUMSTATUS }, { "isautoupdateable", LISTITEM_ISAUTOUPDATEABLE }, + { "hdrtype", LISTITEM_VIDEO_HDR_TYPE }, }; /// \page modules__infolabels_boolean_conditions diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h index 04c0adb62c33c..031b2cfe35c07 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h @@ -148,6 +148,7 @@ class CDemuxStreamVideo : public CDemuxStream std::shared_ptr contentLightMetaData; std::string stereo_mode; // expected stereo mode + StreamHdrType hdr_type = StreamHdrType::HDR_TYPE_NONE; // type of HDR for this stream (hdr10, etc) }; class CDemuxStreamAudio : public CDemuxStream diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp index d1c3b14b899e6..c9dc971f69698 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -511,13 +511,17 @@ bool CDVDDemuxFFmpeg::Open(const std::shared_ptr& pInput, bool bool skipCreateStreams = false; bool isBluray = pInput->IsStreamType(DVDSTREAM_TYPE_BLURAY); - if (iformat && (strcmp(iformat->name, "mpegts") == 0) && !fileinfo && !isBluray) + // don't re-open mpegts streams with hevc encoding as the params are not correctly detected again + if (iformat && (strcmp(iformat->name, "mpegts") == 0) && !fileinfo && !isBluray && + m_pFormatContext->streams[0]->codecpar->codec_id != AV_CODEC_ID_HEVC) { av_opt_set_int(m_pFormatContext, "analyzeduration", 500000, 0); m_checkTransportStream = true; skipCreateStreams = true; } - else if (!iformat || (strcmp(iformat->name, "mpegts") != 0)) + else if (!iformat || ((strcmp(iformat->name, "mpegts") != 0) || + ((strcmp(iformat->name, "mpegts") == 0) && + m_pFormatContext->streams[0]->codecpar->codec_id == AV_CODEC_ID_HEVC))) { m_streaminfo = true; } @@ -1643,11 +1647,26 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) int size = 0; uint8_t* side_data = nullptr; + side_data = av_stream_get_side_data(pStream, AV_PKT_DATA_DOVI_CONF, &size); + if (side_data && size) + st->hdr_type = StreamHdrType::HDR_TYPE_DOLBYVISION; + else if (st->colorPrimaries == AVCOL_PRI_BT2020) + { + if (st->colorTransferCharacteristic == AVCOL_TRC_SMPTE2084) // hdr10 + st->hdr_type = StreamHdrType::HDR_TYPE_HDR10; + else if (st->colorTransferCharacteristic == AVCOL_TRC_ARIB_STD_B67) // hlg + st->hdr_type = StreamHdrType::HDR_TYPE_HLG; + } + side_data = av_stream_get_side_data(pStream, AV_PKT_DATA_MASTERING_DISPLAY_METADATA, &size); if (side_data && size) { st->masteringMetaData = std::make_shared( *reinterpret_cast(side_data)); + // file could be SMPTE2086 which FFmpeg currently returns as unknown so use the presence + // of static metadata to detect it + if (st->masteringMetaData->has_primaries && st->masteringMetaData->has_luminance) + st->hdr_type = StreamHdrType::HDR_TYPE_HDR10; } side_data = av_stream_get_side_data(pStream, AV_PKT_DATA_CONTENT_LIGHT_LEVEL, &size); diff --git a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp index cfe28c7728f11..6e8f67329806e 100644 --- a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp +++ b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp @@ -396,6 +396,7 @@ bool CDVDFileInfo::DemuxerToStreamDetails(const std::shared_ptr p->m_iDuration = pDemux->GetStreamLength(); p->m_strStereoMode = vstream->stereo_mode; p->m_strLanguage = vstream->language; + p->m_strHdrType = CStreamDetails::HdrTypeToString(vstream->hdr_type); // stack handling if (URIUtils::IsStack(path)) diff --git a/xbmc/cores/VideoPlayer/Interface/StreamInfo.h b/xbmc/cores/VideoPlayer/Interface/StreamInfo.h index 3ebefb4615eca..a7a935ac21e08 100644 --- a/xbmc/cores/VideoPlayer/Interface/StreamInfo.h +++ b/xbmc/cores/VideoPlayer/Interface/StreamInfo.h @@ -30,6 +30,14 @@ enum StreamFlags FLAG_STILL_IMAGES = 0x100000 }; +enum class StreamHdrType +{ + HDR_TYPE_NONE, /// < will return an empty string + HDR_TYPE_HDR10, /// < returns "hdr10" when converted to a string + HDR_TYPE_DOLBYVISION, /// < returns "dolbyvision" + HDR_TYPE_HLG /// < returns "hlg" +}; + struct StreamInfo { bool valid = false; @@ -64,6 +72,7 @@ struct VideoStreamInfo : StreamInfo CRect VideoRect; std::string stereoMode; int angles = 0; + StreamHdrType hdrType = StreamHdrType::HDR_TYPE_NONE; }; struct ProgramInfo diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index 217d0290a9676..6f8e7c943141b 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -523,6 +523,7 @@ void CSelectionStreams::Update(const std::shared_ptr& input, s.aspect_ratio = vstream->fAspect; s.stereo_mode = vstream->stereo_mode; s.bitrate = vstream->iBitRate; + s.hdrType = vstream->hdr_type; } if(stream->type == STREAM_AUDIO) { @@ -5122,6 +5123,7 @@ void CVideoPlayer::GetVideoStreamInfo(int streamId, VideoStreamInfo &info) info.videoAspectRatio = s.aspect_ratio; info.stereoMode = s.stereo_mode; info.flags = s.flags; + info.hdrType = s.hdrType; } int CVideoPlayer::GetVideoStreamCount() const diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.h b/xbmc/cores/VideoPlayer/VideoPlayer.h index f470b9c38dc8f..46dfa33622a8f 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.h +++ b/xbmc/cores/VideoPlayer/VideoPlayer.h @@ -196,6 +196,7 @@ struct SelectionStream CRect VideoRect; std::string stereo_mode; float aspect_ratio = 0.0f; + StreamHdrType hdrType = StreamHdrType::HDR_TYPE_NONE; }; class CSelectionStreams diff --git a/xbmc/guilib/guiinfo/GUIInfoLabels.h b/xbmc/guilib/guiinfo/GUIInfoLabels.h index f1d61bc172178..98b6fa275660f 100644 --- a/xbmc/guilib/guiinfo/GUIInfoLabels.h +++ b/xbmc/guilib/guiinfo/GUIInfoLabels.h @@ -253,6 +253,7 @@ #define VIDEOPLAYER_USER_RATING 277 #define VIDEOPLAYER_DBID 278 #define VIDEOPLAYER_TVSHOWDBID 279 +#define VIDEOPLAYER_HDR_TYPE 280 // Range of videoplayer infolabels that work with offset and position #define VIDEOPLAYER_OFFSET_POSITION_FIRST VIDEOPLAYER_TITLE @@ -948,6 +949,7 @@ #define LISTITEM_TVSHOWDBID (LISTITEM_START + 205) #define LISTITEM_ALBUMSTATUS (LISTITEM_START + 206) #define LISTITEM_ISAUTOUPDATEABLE (LISTITEM_START + 207) +#define LISTITEM_VIDEO_HDR_TYPE (LISTITEM_START + 208) #define LISTITEM_END (LISTITEM_START + 2500) diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp index 55cbf18d3fe51..e0ffd02feecf0 100644 --- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp @@ -492,6 +492,9 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont value = CURL(value).GetWithoutUserDetails(); return true; + case LISTITEM_VIDEO_HDR_TYPE: + value = tag->m_streamDetails.GetVideoHdrType(); + return true; } } @@ -553,6 +556,9 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont case VIDEOPLAYER_VIDEO_RESOLUTION: value = CStreamDetails::VideoDimsToResolutionDescription(m_videoInfo.width, m_videoInfo.height); return true; + case VIDEOPLAYER_HDR_TYPE: + value = CStreamDetails::HdrTypeToString(m_videoInfo.hdrType); + return true; case VIDEOPLAYER_AUDIO_CODEC: value = m_audioInfo.codecName; return true; diff --git a/xbmc/interfaces/json-rpc/schema/types.json b/xbmc/interfaces/json-rpc/schema/types.json index 903339b35d502..d63577dd7f1a1 100644 --- a/xbmc/interfaces/json-rpc/schema/types.json +++ b/xbmc/interfaces/json-rpc/schema/types.json @@ -812,7 +812,8 @@ "aspect": { "type": "number" }, "width": { "type": "integer" }, "height": { "type": "integer" }, - "duration": { "type": "integer" } + "duration": { "type": "integer" }, + "hdrtype": { "type": "string"} }, "additionalProperties": false } diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt index 30a0348f9cc8b..a60c61c0162d6 100644 --- a/xbmc/interfaces/json-rpc/schema/version.txt +++ b/xbmc/interfaces/json-rpc/schema/version.txt @@ -1 +1 @@ -JSONRPC_VERSION 12.7.0 +JSONRPC_VERSION 12.8.0 \ No newline at end of file diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp index 40164eccd9f91..8b764bac45867 100644 --- a/xbmc/playlists/SmartPlayList.cpp +++ b/xbmc/playlists/SmartPlayList.cpp @@ -130,6 +130,7 @@ static const translateField fields[] = { { "channels", FieldNoOfChannels, CDatabaseQueryRule::NUMERIC_FIELD, StringValidation::IsPositiveInteger, false, 253 }, { "albumstatus", FieldAlbumStatus, CDatabaseQueryRule::TEXT_FIELD, NULL, false, 38081 }, { "albumduration", FieldAlbumDuration, CDatabaseQueryRule::SECONDS_FIELD, StringValidation::IsTime, false, 180 }, + { "hdrtype", FieldHdrType, CDatabaseQueryRule::TEXTIN_FIELD, NULL, false, 20474 }, }; // clang-format on @@ -507,6 +508,7 @@ std::vector CSmartPlaylistRule::GetFields(const std::string &type) fields.push_back(FieldAudioLanguage); fields.push_back(FieldSubtitleLanguage); fields.push_back(FieldVideoAspectRatio); + fields.push_back(FieldHdrType); } fields.push_back(FieldPlaylist); fields.push_back(FieldVirtualFolder); @@ -1047,6 +1049,8 @@ std::string CSmartPlaylistRule::FormatWhereClause(const std::string &negate, con query = db.PrepareSQL(negate + " EXISTS (SELECT 1 FROM streamdetails WHERE streamdetails.idFile = " + table + ".idFile AND streamdetails.iStreamtype = %i GROUP BY streamdetails.idFile HAVING COUNT(streamdetails.iStreamType) " + parameter + ")",CStreamDetail::AUDIO); else if (m_field == FieldSubtitleCount) query = db.PrepareSQL(negate + " EXISTS (SELECT 1 FROM streamdetails WHERE streamdetails.idFile = " + table + ".idFile AND streamdetails.iStreamType = %i GROUP BY streamdetails.idFile HAVING COUNT(streamdetails.iStreamType) " + parameter + ")",CStreamDetail::SUBTITLE); + else if (m_field == FieldHdrType) + query = negate + " EXISTS (SELECT 1 FROM streamdetails WHERE streamdetails.idFile = " + table + ".idFile AND strHdrType " + parameter + ")"; if (m_field == FieldPlaycount && strType != "songs" && strType != "albums" && strType != "tvshows") { // playcount IS stored as NULL OR number IN video db if ((m_operator == OPERATOR_EQUALS && param == "0") || diff --git a/xbmc/utils/DatabaseUtils.h b/xbmc/utils/DatabaseUtils.h index 2e43effdb0777..dbe5e4a7e64b1 100644 --- a/xbmc/utils/DatabaseUtils.h +++ b/xbmc/utils/DatabaseUtils.h @@ -145,6 +145,7 @@ typedef enum { FieldNoOfChannels, FieldAlbumStatus, FieldAlbumDuration, + FieldHdrType, FieldMax } Field; diff --git a/xbmc/utils/StreamDetails.cpp b/xbmc/utils/StreamDetails.cpp index acc644e1099c9..662f68371b89b 100644 --- a/xbmc/utils/StreamDetails.cpp +++ b/xbmc/utils/StreamDetails.cpp @@ -10,7 +10,6 @@ #include "LangInfo.h" #include "StreamUtils.h" -#include "cores/VideoPlayer/Interface/StreamInfo.h" #include "utils/Archive.h" #include "utils/LangCodeExpander.h" #include "utils/Variant.h" @@ -32,7 +31,8 @@ CStreamDetailVideo::CStreamDetailVideo(const VideoStreamInfo &info, int duration m_iDuration(duration), m_strCodec(info.codecName), m_strStereoMode(info.stereoMode), - m_strLanguage(info.language) + m_strLanguage(info.language), + m_strHdrType(CStreamDetails::HdrTypeToString(info.hdrType)) { } @@ -47,6 +47,7 @@ void CStreamDetailVideo::Archive(CArchive& ar) ar << m_iDuration; ar << m_strStereoMode; ar << m_strLanguage; + ar << m_strHdrType; } else { @@ -57,6 +58,7 @@ void CStreamDetailVideo::Archive(CArchive& ar) ar >> m_iDuration; ar >> m_strStereoMode; ar >> m_strLanguage; + ar >> m_strHdrType; } } void CStreamDetailVideo::Serialize(CVariant& value) const @@ -68,6 +70,7 @@ void CStreamDetailVideo::Serialize(CVariant& value) const value["duration"] = m_iDuration; value["stereomode"] = m_strStereoMode; value["language"] = m_strLanguage; + value["hdrtype"] = m_strHdrType; } bool CStreamDetailVideo::IsWorseThan(const CStreamDetail &that) const @@ -398,6 +401,16 @@ int CStreamDetails::GetVideoHeight(int idx) const return 0; } +std::string CStreamDetails::GetVideoHdrType( int idx) const +{ + const CStreamDetailVideo* item = + static_cast(GetNthStream(CStreamDetail::VIDEO, idx)); + if (item) + return item->m_strHdrType; + else + return ""; +} + int CStreamDetails::GetVideoDuration(int idx) const { const CStreamDetailVideo *item = static_cast(GetNthStream(CStreamDetail::VIDEO, idx)); @@ -625,3 +638,19 @@ bool CStreamDetails::SetStreams(const VideoStreamInfo& videoInfo, int videoDurat DetermineBestStreams(); return true; } + +std::string CStreamDetails::HdrTypeToString(StreamHdrType hdrType) +{ + switch (hdrType) + { + case StreamHdrType::HDR_TYPE_DOLBYVISION: + return "dolbyvision"; + case StreamHdrType::HDR_TYPE_HDR10: + return "hdr10"; + case StreamHdrType::HDR_TYPE_HLG: + return "hlg"; + case StreamHdrType::HDR_TYPE_NONE: + default: + return ""; + } +} diff --git a/xbmc/utils/StreamDetails.h b/xbmc/utils/StreamDetails.h index 80ba65903423c..f897900899a9a 100644 --- a/xbmc/utils/StreamDetails.h +++ b/xbmc/utils/StreamDetails.h @@ -9,6 +9,7 @@ #pragma once #include "ISerializable.h" +#include "cores/VideoPlayer/Interface/StreamInfo.h" #include "utils/IArchivable.h" #include @@ -57,6 +58,7 @@ class CStreamDetailVideo final : public CStreamDetail std::string m_strCodec; std::string m_strStereoMode; std::string m_strLanguage; + std::string m_strHdrType; }; class CStreamDetailAudio final : public CStreamDetail @@ -103,12 +105,14 @@ class CStreamDetails final : public IArchivable, public ISerializable int GetVideoStreamCount(void) const; int GetAudioStreamCount(void) const; int GetSubtitleStreamCount(void) const; + static std::string HdrTypeToString(StreamHdrType hdrType); const CStreamDetail* GetNthStream(CStreamDetail::StreamType type, int idx) const; std::string GetVideoCodec(int idx = 0) const; float GetVideoAspect(int idx = 0) const; int GetVideoWidth(int idx = 0) const; int GetVideoHeight(int idx = 0) const; + std::string GetVideoHdrType (int idx = 0) const; int GetVideoDuration(int idx = 0) const; void SetVideoDuration(int idx, const int duration); std::string GetStereoMode(int idx = 0) const; diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 4b9b0ec7ad52a..914d22f8f72b9 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -178,7 +178,8 @@ void CVideoDatabase::CreateTables() m_pDS->exec("CREATE TABLE streamdetails (idFile integer, iStreamType integer, " "strVideoCodec text, fVideoAspect float, iVideoWidth integer, iVideoHeight integer, " "strAudioCodec text, iAudioChannels integer, strAudioLanguage text, " - "strSubtitleLanguage text, iVideoDuration integer, strStereoMode text, strVideoLanguage text)"); + "strSubtitleLanguage text, iVideoDuration integer, strStereoMode text, strVideoLanguage text, " + "strHdrType text)"); CLog::Log(LOGINFO, "create sets table"); m_pDS->exec("CREATE TABLE sets ( idSet integer primary key, strSet text, strOverview text)"); @@ -3057,13 +3058,15 @@ void CVideoDatabase::SetStreamDetailsForFileId(const CStreamDetails& details, in { m_pDS->exec(PrepareSQL("INSERT INTO streamdetails " "(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth, " - "iVideoHeight, iVideoDuration, strStereoMode, strVideoLanguage) " - "VALUES (%i,%i,'%s',%f,%i,%i,%i,'%s','%s')", + "iVideoHeight, iVideoDuration, strStereoMode, strVideoLanguage, " + "strHdrType)" + "VALUES (%i,%i,'%s',%f,%i,%i,%i,'%s','%s','%s')", idFile, (int)CStreamDetail::VIDEO, details.GetVideoCodec(i).c_str(), static_cast(details.GetVideoAspect(i)), details.GetVideoWidth(i), details.GetVideoHeight(i), details.GetVideoDuration(i), details.GetStereoMode(i).c_str(), - details.GetVideoLanguage(i).c_str())); + details.GetVideoLanguage(i).c_str(), + details.GetVideoHdrType(i).c_str())); } for (int i=1; i<=details.GetAudioStreamCount(); i++) { @@ -3894,6 +3897,7 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const p->m_iDuration = pDS->fv(10).get_asInt(); p->m_strStereoMode = pDS->fv(11).get_asString(); p->m_strLanguage = pDS->fv(12).get_asString(); + p->m_strHdrType = pDS->fv(13).get_asString(); details.AddStream(p); retVal = true; break; @@ -5830,11 +5834,15 @@ void CVideoDatabase::UpdateTables(int iVersion) if (iVersion < 119) m_pDS->exec("ALTER TABLE path ADD allAudio bool"); + if (iVersion < 120) + { + m_pDS->exec("ALTER TABLE streamdetails ADD strHdrType text"); + } } int CVideoDatabase::GetSchemaVersion() const { - return 119; + return 120; } bool CVideoDatabase::LookupByFolders(const std::string &path, bool shows) diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp index 489c6bd1bc152..1893a7cbb6a1e 100644 --- a/xbmc/video/VideoInfoTag.cpp +++ b/xbmc/video/VideoInfoTag.cpp @@ -248,6 +248,7 @@ bool CVideoInfoTag::Save(TiXmlNode *node, const std::string &tag, bool savePathI XMLUtils::SetInt(&stream, "height", m_streamDetails.GetVideoHeight(iStream)); XMLUtils::SetInt(&stream, "durationinseconds", m_streamDetails.GetVideoDuration(iStream)); XMLUtils::SetString(&stream, "stereomode", m_streamDetails.GetStereoMode(iStream)); + XMLUtils::SetString(&stream, "hdrtype", m_streamDetails.GetVideoHdrType(iStream)); streamdetails.InsertEndChild(stream); } for (int iStream=1; iStream<=m_streamDetails.GetAudioStreamCount(); iStream++) @@ -1305,10 +1306,13 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie, bool prioritise) p->m_strStereoMode = StringUtils::Trim(value); if (XMLUtils::GetString(nodeDetail, "language", value)) p->m_strLanguage = StringUtils::Trim(value); + if (XMLUtils::GetString(nodeDetail, "hdrtype", value)) + p->m_strHdrType = StringUtils::Trim(value); StringUtils::ToLower(p->m_strCodec); StringUtils::ToLower(p->m_strStereoMode); StringUtils::ToLower(p->m_strLanguage); + StringUtils::ToLower(p->m_strHdrType); m_streamDetails.AddStream(p); } nodeDetail = NULL;