MediaPlayer::SupportsType MediaPlayerPrivateGStreamerMSE::supportsType(const MediaEngineSupportParameters& parameters)
{
- static std::optional<VideoDecodingLimits> videoDecodingLimits;
-#ifdef VIDEO_DECODING_LIMIT
- static std::once_flag onceFlag;
- std::call_once(onceFlag, [] {
- videoDecodingLimits = videoDecoderLimitsDefaults();
- if (!videoDecodingLimits) {
- GST_WARNING("Parsing VIDEO_DECODING_LIMIT failed");
- ASSERT_NOT_REACHED();
- }
- });
-#endif
-
MediaPlayer::SupportsType result = MediaPlayer::SupportsType::IsNotSupported;
if (!parameters.isMediaSource)
return result;
+ if (!ensureGStreamerInitialized())
+ return result;
+
auto containerType = parameters.type.containerType();
// YouTube TV provides empty types for some videos and we want to be selected as best media engine for them.
if (!ok)
height = 0;
+ static std::optional<VideoDecodingLimits> videoDecodingLimits;
+#ifdef VIDEO_DECODING_LIMIT
+ static std::once_flag onceFlag;
+ std::call_once(onceFlag, [] {
+ videoDecodingLimits = videoDecoderLimitsDefaults();
+ if (!videoDecodingLimits)
+ GST_WARNING("Parsing VIDEO_DECODING_LIMIT failed");
+ });
+#endif
+
if (videoDecodingLimits && (width > videoDecodingLimits->mediaMaxWidth || height > videoDecodingLimits->mediaMaxHeight))
return result;