mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
61 lines
2.2 KiB
C++
61 lines
2.2 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#if !defined(GStreamerFormatHelper_h_)
|
|
#define GStreamerFormatHelper_h_
|
|
|
|
#include <gst/gst.h>
|
|
#include <mozilla/Types.h>
|
|
#include "nsXPCOMStrings.h"
|
|
|
|
class GStreamerFormatHelper {
|
|
/* This class can be used to query the GStreamer registry for the required
|
|
* demuxers/decoders from nsHTMLMediaElement::CanPlayType.
|
|
* It implements looking at the GstRegistry to check if elements to
|
|
* demux/decode the formats passed to CanPlayType() are actually installed.
|
|
*/
|
|
public:
|
|
static GStreamerFormatHelper* Instance();
|
|
~GStreamerFormatHelper();
|
|
|
|
bool CanHandleMediaType(const nsACString& aMIMEType,
|
|
const nsAString* aCodecs);
|
|
|
|
static void Shutdown();
|
|
|
|
private:
|
|
GStreamerFormatHelper();
|
|
GstCaps* ConvertFormatsToCaps(const char* aMIMEType,
|
|
const nsAString* aCodecs);
|
|
char* const *CodecListFromCaps(GstCaps* aCaps);
|
|
bool HaveElementsToProcessCaps(GstCaps* aCaps);
|
|
GList* GetFactories();
|
|
|
|
static GStreamerFormatHelper* gInstance;
|
|
|
|
/* table to convert from container MIME types to GStreamer elements */
|
|
static char const *const mContainers[6][2];
|
|
|
|
/* table to convert from codec MIME types to GStreamer elements */
|
|
static char const *const mCodecs[9][2];
|
|
|
|
/* list of GStreamer element factories
|
|
* Element factories are the basic types retrieved from the GStreamer
|
|
* registry, they describe all plugins and elements that GStreamer can
|
|
* create.
|
|
* This means that element factories are useful for automated element
|
|
* instancing, such as what autopluggers do,
|
|
* and for creating lists of available elements. */
|
|
GList* mFactories;
|
|
|
|
/* Storage for the default registrys feature list cookie.
|
|
* It changes every time a feature is added to or removed from the
|
|
* GStreamer registry. */
|
|
uint32_t mCookie;
|
|
};
|
|
|
|
#endif
|