Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions DeviceInfo/DeviceInfoImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace Plugin {
using AudioCapabilitiesJsonArray = Core::JSON::ArrayType<Core::JSON::EnumType<Exchange::IDeviceAudioCapabilities::AudioCapability>>;
using MS12CapabilitiesJsonArray = Core::JSON::ArrayType<Core::JSON::EnumType<Exchange::IDeviceAudioCapabilities::MS12Capability>>;
using MS12ProfilesJsonArray = Core::JSON::ArrayType<Core::JSON::EnumType<Exchange::IDeviceAudioCapabilities::MS12Profile>>;
using AudioCapabilityIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator>;
using MS12CapabilityIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator>;
using MS12ProfileIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator>;
using AudioCapabilityIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IAudioCapabilityIterator, std::vector<Exchange::IDeviceAudioCapabilities::AudioCapability>>;
using MS12CapabilityIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IMS12CapabilityIterator, std::vector<Exchange::IDeviceAudioCapabilities::MS12Capability>>;
using MS12ProfileIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IMS12ProfileIterator, std::vector<Exchange::IDeviceAudioCapabilities::MS12Profile>>;

using ResolutionJsonArray = Core::JSON::ArrayType<Core::JSON::EnumType<Exchange::IDeviceVideoCapabilities::ScreenResolution>>;
using ResolutionIteratorImplementation = RPC::IteratorType<Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator>;
using ResolutionIteratorImplementation = RPC::IteratorType<Exchange::IDeviceVideoCapabilities::IScreenResolutionIterator, std::vector<Exchange::IDeviceVideoCapabilities::ScreenResolution>>;
Comment thread
VeithMetro marked this conversation as resolved.

uint32_t DeviceInfoImplementation::Configure(const PluginHost::IShell* service)
{
Expand Down Expand Up @@ -74,13 +74,14 @@ namespace Plugin {
uint32_t DeviceInfoImplementation::AudioOutputs(Exchange::IDeviceAudioCapabilities::IAudioOutputIterator*& audioOutputs) const
{
AudioOutputList audioOutputList;
audioOutputList.reserve(_audioOutputMap.size());

std::transform(_audioOutputMap.begin(), _audioOutputMap.end(), std::front_inserter(audioOutputList),
std::transform(_audioOutputMap.begin(), _audioOutputMap.end(), std::back_inserter(audioOutputList),
[](decltype(_audioOutputMap)::value_type const &pair) {
return pair.first;
});

audioOutputs = Core::ServiceType<AudioOutputIteratorImplementation>::Create<Exchange::IDeviceAudioCapabilities::IAudioOutputIterator>(audioOutputList);
audioOutputs = Core::ServiceType<AudioOutputIteratorImplementation>::Create<Exchange::IDeviceAudioCapabilities::IAudioOutputIterator>(std::move(audioOutputList));
return (audioOutputs != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL);
}

Expand Down Expand Up @@ -114,13 +115,14 @@ namespace Plugin {
uint32_t DeviceInfoImplementation::VideoOutputs(Exchange::IDeviceVideoCapabilities::IVideoOutputIterator*& videoOutputs) const
{
VideoOutputList videoOutputList;
videoOutputList.reserve(_videoOutputMap.size());

std::transform(_videoOutputMap.begin(), _videoOutputMap.end(), std::back_inserter(videoOutputList),
[](decltype(_videoOutputMap)::value_type const &pair) {
return pair.first;
});

videoOutputs = Core::ServiceType<VideoOutputIteratorImplementation>::Create<Exchange::IDeviceVideoCapabilities::IVideoOutputIterator>(videoOutputList);
videoOutputs = Core::ServiceType<VideoOutputIteratorImplementation>::Create<Exchange::IDeviceVideoCapabilities::IVideoOutputIterator>(std::move(videoOutputList));

return (videoOutputs != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL);
}
Expand Down
16 changes: 8 additions & 8 deletions DeviceInfo/DeviceInfoImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,22 @@ namespace Plugin {
}; // CONFIG

struct AudioOutputCapability {
std::list<IDeviceAudioCapabilities::AudioCapability> AudioCapabilities;
std::list<IDeviceAudioCapabilities::MS12Capability> MS12Capabilities;
std::list<IDeviceAudioCapabilities::MS12Profile> MS12Profiles;
std::vector<IDeviceAudioCapabilities::AudioCapability> AudioCapabilities;
std::vector<IDeviceAudioCapabilities::MS12Capability> MS12Capabilities;
std::vector<IDeviceAudioCapabilities::MS12Profile> MS12Profiles;
};
using AudioOutputMap = std::map<Exchange::IDeviceAudioCapabilities::AudioOutput, AudioOutputCapability>;
using AudioOutputList = std::list<Exchange::IDeviceAudioCapabilities::AudioOutput>;
using AudioOutputIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IAudioOutputIterator>;
using AudioOutputList = std::vector<Exchange::IDeviceAudioCapabilities::AudioOutput>;
using AudioOutputIteratorImplementation = RPC::IteratorType<Exchange::IDeviceAudioCapabilities::IAudioOutputIterator, std::vector<Exchange::IDeviceAudioCapabilities::AudioOutput>>;

struct VideoOutputCapability {
std::list<IDeviceVideoCapabilities::ScreenResolution> Resolutions;
std::vector<IDeviceVideoCapabilities::ScreenResolution> Resolutions;
IDeviceVideoCapabilities::ScreenResolution DefaultResolution;
IDeviceVideoCapabilities::CopyProtection CopyProtection;
};
using VideoOutputMap = std::map<Exchange::IDeviceVideoCapabilities::VideoOutput, VideoOutputCapability>;
using VideoOutputList = std::list<Exchange::IDeviceVideoCapabilities::VideoOutput>;
using VideoOutputIteratorImplementation = RPC::IteratorType<Exchange::IDeviceVideoCapabilities::IVideoOutputIterator>;
using VideoOutputList = std::vector<Exchange::IDeviceVideoCapabilities::VideoOutput>;
using VideoOutputIteratorImplementation = RPC::IteratorType<Exchange::IDeviceVideoCapabilities::IVideoOutputIterator, std::vector<Exchange::IDeviceVideoCapabilities::VideoOutput>>;

public:
DeviceInfoImplementation(const DeviceInfoImplementation&) = delete;
Expand Down
20 changes: 12 additions & 8 deletions DisplayInfo/DeviceSettings/PlatformImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class DisplayInfoImplementation :
public Exchange::IHDRProperties,
public Exchange::IDisplayProperties {
private:
using HdrteratorImplementation = RPC::IteratorType<Exchange::IHDRProperties::IHDRIterator>;
using ColorimetryIteratorImplementation = RPC::IteratorType<Exchange::IDisplayProperties::IColorimetryIterator>;
using HdrIteratorImplementation = RPC::IteratorType<Exchange::IHDRProperties::IHDRIterator, std::vector<Exchange::IHDRProperties::HDRType>>;
using ColorimetryIteratorImplementation = RPC::IteratorType<Exchange::IDisplayProperties::IColorimetryIterator, std::vector<Exchange::IDisplayProperties::ColorimetryType>>;
public:
DisplayInfoImplementation()
{
Expand Down Expand Up @@ -584,7 +584,9 @@ class DisplayInfoImplementation :

uint32_t Colorimetry(IColorimetryIterator*& colorimetry /* @out */) const override
{
std::list<Exchange::IDisplayProperties::ColorimetryType> colorimetryCaps;
std::vector<Exchange::IDisplayProperties::ColorimetryType> colorimetryCaps;
colorimetryCaps.reserve(8);

vector<uint8_t> edidVec;
uint32_t ret = GetEdidBytes(edidVec);
if (ret == Core::ERROR_NONE)
Expand Down Expand Up @@ -620,7 +622,7 @@ class DisplayInfoImplementation :
TRACE(Trace::Error, (_T("HDMI not connected!")));
ret = Core::ERROR_GENERAL;
}
colorimetry = Core::ServiceType<ColorimetryIteratorImplementation>::Create<Exchange::IDisplayProperties::IColorimetryIterator>(colorimetryCaps);
colorimetry = Core::ServiceType<ColorimetryIteratorImplementation>::Create<Exchange::IDisplayProperties::IColorimetryIterator>(std::move(colorimetryCaps));
return (colorimetry != nullptr && ret == Core::ERROR_NONE ? Core::ERROR_NONE : Core::ERROR_GENERAL);
}

Expand Down Expand Up @@ -665,7 +667,8 @@ class DisplayInfoImplementation :
// @return HDRType: array of HDR formats
uint32_t TVCapabilities(IHDRIterator*& type /* out */) const override
{
std::list<Exchange::IHDRProperties::HDRType> hdrCapabilities;
std::vector<Exchange::IHDRProperties::HDRType> hdrCapabilities;
hdrCapabilities.reserve(4);

int capabilities = static_cast<int>(dsHDRSTANDARD_NONE);
try
Expand All @@ -691,15 +694,16 @@ class DisplayInfoImplementation :
if (capabilities & dsHDRSTANDARD_Invalid)hdrCapabilities.push_back(HDR_OFF);


type = Core::ServiceType<HdrteratorImplementation>::Create<Exchange::IHDRProperties::IHDRIterator>(hdrCapabilities);
type = Core::ServiceType<HdrIteratorImplementation>::Create<Exchange::IHDRProperties::IHDRIterator>(std::move(hdrCapabilities));
return (type != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL);
}
// @property
// @brief HDR formats supported by STB
// @return HDRType: array of HDR formats
uint32_t STBCapabilities(IHDRIterator*& type /* out */) const override
{
std::list<Exchange::IHDRProperties::HDRType> hdrCapabilities;
std::vector<Exchange::IHDRProperties::HDRType> hdrCapabilities;
hdrCapabilities.reserve(4);

int capabilities = static_cast<int>(dsHDRSTANDARD_NONE);
try
Expand All @@ -718,7 +722,7 @@ class DisplayInfoImplementation :
if (capabilities & dsHDRSTANDARD_TechnicolorPrime) hdrCapabilities.push_back(HDR_TECHNICOLOR);
if (capabilities & dsHDRSTANDARD_Invalid)hdrCapabilities.push_back(HDR_OFF);

type = Core::ServiceType<HdrteratorImplementation>::Create<Exchange::IHDRProperties::IHDRIterator>(hdrCapabilities);
type = Core::ServiceType<HdrIteratorImplementation>::Create<Exchange::IHDRProperties::IHDRIterator>(std::move(hdrCapabilities));
return (type != nullptr ? Core::ERROR_NONE : Core::ERROR_GENERAL);
}
// @property
Expand Down
10 changes: 5 additions & 5 deletions MessageControl/MessageControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,24 +424,24 @@ namespace Plugin {

_client.Modules(list);

using Implementation = RPC::IteratorType<RPC::IStringIterator>;
modules = Core::ServiceType<Implementation>::Create<RPC::IStringIterator>(list);
using Implementation = RPC::IteratorType<RPC::IStringIterator, std::vector<string>>;
modules = Core::ServiceType<Implementation>::Create<RPC::IStringIterator>(std::move(list));

return (Core::ERROR_NONE);
}

Core::hresult Controls(const string& module, Exchange::IMessageControl::IControlIterator*& controls) const override
{
std::list<Exchange::IMessageControl::Control> list;
std::vector<Exchange::IMessageControl::Control> list;
Messaging::MessageUnit::Iterator index;
_client.Controls(index, module);

while (index.Next() == true) {
list.push_back( { static_cast<messagetype>(index.Type()), index.Category(), index.Module(), index.Enabled() } );
}

using Implementation = RPC::IteratorType<Exchange::IMessageControl::IControlIterator>;
controls = Core::ServiceType<Implementation>::Create<Exchange::IMessageControl::IControlIterator>(list);
using Implementation = RPC::IteratorType<Exchange::IMessageControl::IControlIterator, std::vector<Exchange::IMessageControl::Control>>;
controls = Core::ServiceType<Implementation>::Create<Exchange::IMessageControl::IControlIterator>(std::move(list));

return (Core::ERROR_NONE);
}
Expand Down
12 changes: 8 additions & 4 deletions PlayerInfo/DeviceSettings/PlatformImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties, public Exch
};

private:
using AudioIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IAudioCodecIterator>;
using VideoIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IVideoCodecIterator>;
using AudioIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IAudioCodecIterator, std::vector<Exchange::IPlayerProperties::AudioCodec>>;
using VideoIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IVideoCodecIterator, std::vector<Exchange::IPlayerProperties::VideoCodec>>;

typedef std::map<const string, const Exchange::IPlayerProperties::AudioCodec> AudioCaps;
typedef std::map<const string, const Exchange::IPlayerProperties::VideoCodec> VideoCaps;
Expand Down Expand Up @@ -459,6 +459,8 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties, public Exch
{"audio/x-vorbis", Exchange::IPlayerProperties::AUDIO_VORBIS_OGG},
{"audio/x-wav", Exchange::IPlayerProperties::AUDIO_WAV},
};
_audioCodecs.reserve(audioCaps.size());

if (GstUtils::GstRegistryCheckElementsForMediaTypes(audioCaps, _audioCodecs) != true) {
TRACE(Trace::Warning, (_T("There is no Audio Codec support available")));
}
Expand All @@ -477,14 +479,16 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties, public Exch
{"video/x-vp9", Exchange::IPlayerProperties::VideoCodec::VIDEO_VP9},
{"video/x-vp10", Exchange::IPlayerProperties::VideoCodec::VIDEO_VP10}
};
_videoCodecs.reserve(videoCaps.size());

if (GstUtils::GstRegistryCheckElementsForMediaTypes(videoCaps, _videoCodecs) != true) {
TRACE(Trace::Warning, (_T("There is no Video Codec support available")));
}
}

private:
std::list<Exchange::IPlayerProperties::AudioCodec> _audioCodecs;
std::list<Exchange::IPlayerProperties::VideoCodec> _videoCodecs;
std::vector<Exchange::IPlayerProperties::AudioCodec> _audioCodecs;
std::vector<Exchange::IPlayerProperties::VideoCodec> _videoCodecs;
std::map<string, Exchange::IPlayerProperties::PlaybackResolution> _resolutions =
{
{"480i24", RESOLUTION_480I24},
Expand Down
12 changes: 8 additions & 4 deletions PlayerInfo/GStreamer/PlatformImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties {
};

private:
using AudioIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IAudioCodecIterator>;
using VideoIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IVideoCodecIterator>;
using AudioIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IAudioCodecIterator, std::vector<Exchange::IPlayerProperties::AudioCodec>>;
using VideoIteratorImplementation = RPC::IteratorType<Exchange::IPlayerProperties::IVideoCodecIterator, std::vector<Exchange::IPlayerProperties::VideoCodec>>;

typedef std::map<const string, const Exchange::IPlayerProperties::AudioCodec> AudioCaps;
typedef std::map<const string, const Exchange::IPlayerProperties::VideoCodec> VideoCaps;
Expand Down Expand Up @@ -170,6 +170,8 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties {
{"audio/x-vorbis", Exchange::IPlayerProperties::AudioCodec::AUDIO_VORBIS_OGG},
{"audio/x-wav", Exchange::IPlayerProperties::AudioCodec::AUDIO_WAV},
};
_audioCodecs.reserve(audioCaps.size());

if (GstUtils::GstRegistryCheckElementsForMediaTypes(audioCaps, _audioCodecs) != true) {
TRACE(Trace::Warning, (_T("There is no Audio Codec support available")));
}
Expand All @@ -185,14 +187,16 @@ class PlayerInfoImplementation : public Exchange::IPlayerProperties {
{"video/x-vp9", Exchange::IPlayerProperties::VideoCodec::VIDEO_VP9},
{"video/x-vp10", Exchange::IPlayerProperties::VideoCodec::VIDEO_VP10}
};
_videoCodecs.reserve(videoCaps.size());

if (GstUtils::GstRegistryCheckElementsForMediaTypes(videoCaps, _videoCodecs) != true) {
TRACE(Trace::Warning, (_T("There is no Video Codec support available")));
}
}

private:
std::list<Exchange::IPlayerProperties::AudioCodec> _audioCodecs;
std::list<Exchange::IPlayerProperties::VideoCodec> _videoCodecs;
std::vector<Exchange::IPlayerProperties::AudioCodec> _audioCodecs;
std::vector<Exchange::IPlayerProperties::VideoCodec> _videoCodecs;
#if DOLBY_SUPPORT
Exchange::Dolby::IOutput* _dolbyOut;
#endif
Expand Down
6 changes: 4 additions & 2 deletions WebKitBrowser/WebKitBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,16 @@ namespace Plugin {
Core::JSON::ArrayType<Core::JSON::String> array;
array.FromString(languagesList);

std::list<string> list;
std::vector<string> list;
list.reserve(array.Length());
auto iterator = array.Elements();

while (iterator.Next() == true) {
list.push_back(iterator.Current().Value());
}

languages = Core::ServiceType<RPC::IteratorType<RPC::IStringIterator>>::Create<RPC::IStringIterator>(list);
using LangIterImpl = RPC::IteratorType<RPC::IStringIterator, std::vector<string>>;
languages = Core::ServiceType<LangIterImpl>::Create<RPC::IStringIterator>(std::move(list));
Comment thread
VeithMetro marked this conversation as resolved.

return (Core::ERROR_NONE);
}
Expand Down
Loading