mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1133634 - Fix CanPlayType in GStreamer backend - r=kinetik
This commit is contained in:
parent
d08f967d7b
commit
eda1e0c4c7
@ -224,25 +224,15 @@ GStreamerFormatHelper::IsBlacklistEnabled()
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
GStreamerFormatHelper::IsPluginFeatureBlacklisted(GstPluginFeature *aFeature,
|
||||
FactoryType aTypes)
|
||||
GStreamerFormatHelper::IsPluginFeatureBlacklisted(GstPluginFeature *aFeature)
|
||||
{
|
||||
if (!IsBlacklistEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const gchar *className =
|
||||
gst_element_factory_get_klass(GST_ELEMENT_FACTORY_CAST(aFeature));
|
||||
|
||||
const gchar *factoryName =
|
||||
gst_plugin_feature_get_name(aFeature);
|
||||
|
||||
if ((!(aTypes & FactoryTypeDecoder) && strstr(className, "Decoder")) ||
|
||||
(!(aTypes & FactoryTypeDemuxer) && strstr(className, "Demuxer")) ||
|
||||
(!(aTypes & FactoryTypeParser) && strstr(className, "Parser"))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < G_N_ELEMENTS(sPluginBlacklist); i++) {
|
||||
if (!strcmp(factoryName, sPluginBlacklist[i])) {
|
||||
return true;
|
||||
@ -258,8 +248,16 @@ static gboolean FactoryFilter(GstPluginFeature *aFeature, gpointer)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return !GStreamerFormatHelper::IsPluginFeatureBlacklisted(aFeature,
|
||||
(FactoryType)(FactoryTypeDecoder|FactoryTypeDemuxer));
|
||||
const gchar *className =
|
||||
gst_element_factory_get_klass(GST_ELEMENT_FACTORY_CAST(aFeature));
|
||||
|
||||
if (!strstr(className, "Decoder") && !strstr(className, "Demux")) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return
|
||||
gst_plugin_feature_get_rank(aFeature) >= GST_RANK_MARGINAL &&
|
||||
!GStreamerFormatHelper::IsPluginFeatureBlacklisted(aFeature);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,13 +13,6 @@
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
enum FactoryType {
|
||||
FactoryTypeDecoder = 1 << 0,
|
||||
FactoryTypeDemuxer = 1 << 1,
|
||||
FactoryTypeParser = 1 << 2,
|
||||
FactoryTypeAll = FactoryTypeDecoder|FactoryTypeDemuxer|FactoryTypeParser
|
||||
};
|
||||
|
||||
class GStreamerFormatHelper {
|
||||
/* This class can be used to query the GStreamer registry for the required
|
||||
* demuxers/decoders from nsHTMLMediaElement::CanPlayType.
|
||||
@ -37,8 +30,7 @@ class GStreamerFormatHelper {
|
||||
bool CanHandleCodecCaps(GstCaps* aCaps);
|
||||
|
||||
static bool IsBlacklistEnabled();
|
||||
static bool IsPluginFeatureBlacklisted(GstPluginFeature *aFeature,
|
||||
FactoryType aTypes = FactoryTypeAll);
|
||||
static bool IsPluginFeatureBlacklisted(GstPluginFeature *aFeature);
|
||||
|
||||
static GstCaps* ConvertFormatsToCaps(const char* aMIMEType,
|
||||
const nsAString* aCodecs);
|
||||
|
Loading…
Reference in New Issue
Block a user