2014-03-21 10:35:15 +04:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
|
|
|
#ifndef __FFmpegRuntimeLinker_h__
|
|
|
|
#define __FFmpegRuntimeLinker_h__
|
|
|
|
|
2014-12-23 06:36:10 +03:00
|
|
|
#include "PlatformDecoderModule.h"
|
2015-11-12 04:06:18 +03:00
|
|
|
|
2017-02-08 01:27:56 +03:00
|
|
|
namespace mozilla {
|
2014-03-21 10:35:15 +04:00
|
|
|
|
|
|
|
class FFmpegRuntimeLinker
|
|
|
|
{
|
|
|
|
public:
|
2016-01-20 12:22:43 +03:00
|
|
|
static bool Init();
|
2014-12-23 06:36:10 +03:00
|
|
|
static already_AddRefed<PlatformDecoderModule> CreateDecoderModule();
|
2016-09-22 11:59:59 +03:00
|
|
|
enum LinkStatus
|
|
|
|
{
|
|
|
|
LinkStatus_INIT = 0, // Never been linked.
|
|
|
|
LinkStatus_SUCCEEDED, // Found a usable library.
|
|
|
|
// The following error statuses are sorted from most to least preferred
|
|
|
|
// (i.e., if more than one happens, the top one is chosen.)
|
|
|
|
LinkStatus_INVALID_FFMPEG_CANDIDATE, // Found ffmpeg with unexpected contents.
|
|
|
|
LinkStatus_UNUSABLE_LIBAV57, // Found LibAV 57, which we cannot use.
|
|
|
|
LinkStatus_INVALID_LIBAV_CANDIDATE, // Found libav with unexpected contents.
|
|
|
|
LinkStatus_OBSOLETE_FFMPEG,
|
|
|
|
LinkStatus_OBSOLETE_LIBAV,
|
|
|
|
LinkStatus_INVALID_CANDIDATE, // Found some lib with unexpected contents.
|
|
|
|
LinkStatus_NOT_FOUND, // Haven't found any library with an expected name.
|
|
|
|
};
|
|
|
|
static LinkStatus LinkStatusCode() { return sLinkStatus; }
|
|
|
|
static const char* LinkStatusString();
|
|
|
|
// Library name to which the sLinkStatus applies, or "" if not applicable.
|
|
|
|
static const char* LinkStatusLibraryName() { return sLinkStatusLibraryName; }
|
2014-03-21 10:35:15 +04:00
|
|
|
|
|
|
|
private:
|
2016-09-22 11:59:59 +03:00
|
|
|
static LinkStatus sLinkStatus;
|
|
|
|
static const char* sLinkStatusLibraryName;
|
2014-03-21 10:35:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __FFmpegRuntimeLinker_h__
|