author | Ryan VanderMeulen <ryanvm@gmail.com> |
Tue, 16 Dec 2014 11:41:36 -0500 | |
changeset 245796 | c1c84378ba02e2c2342efe4c46aa7df3d707e7bb |
parent 245795 | 2c638a1ade013822355f8e0ded2a6bf87a3354c5 |
child 245797 | cd44fbb9f362b9e679be34385f303b42eb472610 |
push id | 4489 |
push user | raliiev@mozilla.com |
push date | Mon, 23 Feb 2015 15:17:55 +0000 |
treeherder | mozilla-beta@fd7c3dc24146 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1080995 |
milestone | 37.0a1 |
backs out | 938abddb1a2d34e139afbaeaf0296a00a34b8255 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/media/gstreamer/GStreamerFunctionList.h +++ b/dom/media/gstreamer/GStreamerFunctionList.h @@ -83,19 +83,17 @@ GST_FUNC(LIBGSTREAMER, gst_element_facto GST_FUNC(LIBGSTREAMER, gst_element_get_pad) GST_FUNC(LIBGSTREAMER, gst_event_parse_new_segment) GST_FUNC(LIBGSTREAMER, gst_mini_object_get_type) GST_FUNC(LIBGSTREAMER, gst_mini_object_new) GST_FUNC(LIBGSTREAMER, gst_pad_add_event_probe) GST_FUNC(LIBGSTREAMER, gst_pad_alloc_buffer) GST_FUNC(LIBGSTREAMER, gst_pad_get_negotiated_caps) GST_FUNC(LIBGSTREAMER, gst_pad_set_bufferalloc_function) -GST_FUNC(LIBGSTREAMER, gst_registry_find_plugin) GST_FUNC(LIBGSTREAMER, gst_registry_get_default) -GST_FUNC(LIBGSTREAMER, gst_plugin_feature_get_type) GST_FUNC(LIBGSTREAMER, gst_segment_set_newsegment) GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_height) GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_offset) GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_width) GST_FUNC(LIBGSTVIDEO, gst_video_format_get_pixel_stride) GST_FUNC(LIBGSTVIDEO, gst_video_format_get_row_stride) GST_FUNC(LIBGSTVIDEO, gst_video_format_parse_caps) GST_FUNC(LIBGSTVIDEO, gst_video_parse_caps_pixel_aspect_ratio) @@ -127,18 +125,16 @@ GST_FUNC(LIBGSTREAMER, gst_event_parse_s GST_FUNC(LIBGSTREAMER, gst_event_type_get_name) GST_FUNC(LIBGSTREAMER, gst_memory_init) GST_FUNC(LIBGSTREAMER, gst_memory_map) GST_FUNC(LIBGSTREAMER, gst_memory_unmap) GST_FUNC(LIBGSTREAMER, gst_object_get_type) GST_FUNC(LIBGSTREAMER, gst_pad_add_probe) GST_FUNC(LIBGSTREAMER, gst_pad_get_current_caps) GST_FUNC(LIBGSTREAMER, gst_pad_probe_info_get_query) -GST_FUNC(LIBGSTREAMER, gst_plugin_feature_get_plugin) -GST_FUNC(LIBGSTREAMER, gst_plugin_get_version) GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_meta) GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_param) GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_pool) GST_FUNC(LIBGSTREAMER, gst_query_parse_allocation) GST_FUNC(LIBGSTREAMER, gst_registry_get) GST_FUNC(LIBGSTREAMER, gst_sample_get_buffer) GST_FUNC(LIBGSTREAMER, gst_segment_copy_into) GST_FUNC(LIBGSTREAMER, gst_structure_free)
--- a/dom/media/gstreamer/GStreamerReader.cpp +++ b/dom/media/gstreamer/GStreamerReader.cpp @@ -10,28 +10,23 @@ #include "AbstractMediaDecoder.h" #include "MediaResource.h" #include "GStreamerReader.h" #if GST_VERSION_MAJOR >= 1 #include "GStreamerAllocator.h" #endif #include "GStreamerFormatHelper.h" #include "VideoUtils.h" -#include "mozilla/ArrayUtils.h" #include "mozilla/dom/TimeRanges.h" #include "mozilla/Endian.h" #include "mozilla/Preferences.h" #include "mozilla/unused.h" #include "GStreamerLoader.h" #include "gfx2DGlue.h" -#include <gst/gstplugin.h> -#include <gst/gstpluginfeature.h> -#include <gst/gstregistry.h> - namespace mozilla { using namespace gfx; using namespace layers; // Un-comment to enable logging of seek bisections. //#define SEEK_LOGGING @@ -1168,81 +1163,27 @@ GStreamerReader::PlayElementAddedCb(GstB if (!strncmp(name, sUriDecodeBinPrefix, sizeof(sUriDecodeBinPrefix) - 1)) { g_signal_connect(G_OBJECT(aElement), "autoplug-sort", G_CALLBACK(GStreamerReader::AutoplugSortCb), aUserData); } g_free(name); } -/** - * Helper to calculate the length of a C string constant at compile time. - * Substract one from the array length for the trailing null. - */ -#define STRING_LENGTH(string) (ArrayLength(string) - 1) - -/** Check proposed element factories for acceptability. */ -bool GStreamerReader::IsFactoryBlacklisted(GstElementFactory* aFactory) -{ - // Retrieve version string for the element. -#if GST_VERSION_MAJOR >= 1 - GstPlugin* plugin = gst_plugin_feature_get_plugin(GST_PLUGIN_FEATURE(aFactory)); - const gchar* version = plugin ? gst_plugin_get_version(plugin) : "unknown"; -#else - const gchar* plugin_name = GST_PLUGIN_FEATURE(aFactory)->plugin_name; - if (!plugin_name) { - return true; - } - GstPlugin* plugin = gst_default_registry_find_plugin(plugin_name); - const gchar* version = plugin ? plugin->desc.version : "unknown"; -#endif - if (!plugin) { - return true; - } - // Retrieve the element name. - const gchar* name = gst_element_get_name(aFactory); - - // Reject h264parse <= 0.10.23. - const char badname[] = "h264parse"; - const char version_base[] = "0.10."; - // Length needed to compare with version base plus two more digits. - const size_t version_min = STRING_LENGTH(version_base) + 2; - if (strcmp(name, badname) == 0 && - strncmp(version, version_base, strlen(version_base)) == 0 && - strlen(version) >= version_min && - atoi(version + strlen(version_base)) <= 23) { - gst_object_unref(plugin); - return true; - } - - // Clean up. - gst_object_unref(plugin); - - // Factory isn't blacklisted. - return false; -} - -/** Filter elements to control autoplug selection. */ bool GStreamerReader::ShouldAutoplugFactory(GstElementFactory* aFactory, GstCaps* aCaps) { - /* Blacklist unstable elements. */ - if (IsFactoryBlacklisted(aFactory)) { - return false; - } - - /* Filter Demuxers and Decoders for supported formats. */ bool autoplug; - const gchar* klass = gst_element_factory_get_klass(aFactory); + const gchar *klass = gst_element_factory_get_klass(aFactory); if (strstr(klass, "Demuxer") && !strstr(klass, "Metadata")) { autoplug = GStreamerFormatHelper::Instance()->CanHandleContainerCaps(aCaps); } else if (strstr(klass, "Decoder") && !strstr(klass, "Generic")) { autoplug = GStreamerFormatHelper::Instance()->CanHandleCodecCaps(aCaps); } else { - /* Let everything else be autoplugged. */ + /* we only filter demuxers and decoders, let everything else be autoplugged */ autoplug = true; } return autoplug; } /** * This is called by uridecodebin (running inside playbin), after it has found
--- a/dom/media/gstreamer/GStreamerReader.h +++ b/dom/media/gstreamer/GStreamerReader.h @@ -161,21 +161,19 @@ private: void Eos(GstAppSink* aSink = nullptr); /* Called when an element is added inside playbin. We use it to find the * decodebin instance. */ static void PlayElementAddedCb(GstBin *aBin, GstElement *aElement, gpointer *aUserData); - /* Called during decoding, to decide whether a (sub)stream should be - * decoded or ignored. */ + /* Called during decoding, to decide whether a (sub)stream should be decoded or + * ignored */ static bool ShouldAutoplugFactory(GstElementFactory* aFactory, GstCaps* aCaps); - /* Called from ShouldAutoplugFactory to check for blacklisted elements. */ - static bool IsFactoryBlacklisted(GstElementFactory* aFactory); /* Called by decodebin during autoplugging. We use it to apply our * container/codec whitelist. */ static GValueArray* AutoplugSortCb(GstElement* aElement, GstPad* aPad, GstCaps* aCaps, GValueArray* aFactories);