Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/FFmpegRuntimeLinker.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim:set ts=2 sw=2 sts=2 et cindent: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef __FFmpegRuntimeLinker_h__
8
#define __FFmpegRuntimeLinker_h__
9
10
#include "PlatformDecoderModule.h"
11
12
namespace mozilla {
13
14
class FFmpegRuntimeLinker
15
{
16
public:
17
  static bool Init();
18
  static already_AddRefed<PlatformDecoderModule> CreateDecoderModule();
19
  enum LinkStatus
20
  {
21
    LinkStatus_INIT = 0,  // Never been linked.
22
    LinkStatus_SUCCEEDED, // Found a usable library.
23
    // The following error statuses are sorted from most to least preferred
24
    // (i.e., if more than one happens, the top one is chosen.)
25
    LinkStatus_INVALID_FFMPEG_CANDIDATE, // Found ffmpeg with unexpected contents.
26
    LinkStatus_UNUSABLE_LIBAV57, // Found LibAV 57, which we cannot use.
27
    LinkStatus_INVALID_LIBAV_CANDIDATE, // Found libav with unexpected contents.
28
    LinkStatus_OBSOLETE_FFMPEG,
29
    LinkStatus_OBSOLETE_LIBAV,
30
    LinkStatus_INVALID_CANDIDATE, // Found some lib with unexpected contents.
31
    LinkStatus_NOT_FOUND, // Haven't found any library with an expected name.
32
  };
33
0
  static LinkStatus LinkStatusCode() { return sLinkStatus; }
34
  static const char* LinkStatusString();
35
  // Library name to which the sLinkStatus applies, or "" if not applicable.
36
0
  static const char* LinkStatusLibraryName() { return sLinkStatusLibraryName; }
37
38
private:
39
  static LinkStatus sLinkStatus;
40
  static const char* sLinkStatusLibraryName;
41
};
42
43
}
44
45
#endif // __FFmpegRuntimeLinker_h__