2013-11-21 01:04:33 +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/. */
|
|
|
|
#if !defined(MP4Decoder_h_)
|
|
|
|
# define MP4Decoder_h_
|
|
|
|
|
2018-06-07 17:47:41 +03:00
|
|
|
# include "mozilla/UniquePtr.h"
|
2017-08-17 02:48:52 +03:00
|
|
|
# include "nsStringFwd.h"
|
2018-06-07 17:47:41 +03:00
|
|
|
# include "nsTArray.h"
|
2013-11-21 01:04:33 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2017-01-18 03:59:03 +03:00
|
|
|
class MediaContainerType;
|
2017-08-16 08:19:39 +03:00
|
|
|
class DecoderDoctorDiagnostics;
|
2018-06-07 17:47:41 +03:00
|
|
|
class TrackInfo;
|
2016-10-01 11:10:18 +03:00
|
|
|
|
2013-11-21 01:04:33 +04:00
|
|
|
// Decoder that uses a bundled MP4 demuxer and platform decoders to play MP4.
|
2017-08-15 08:52:17 +03:00
|
|
|
class MP4Decoder {
|
2013-11-21 01:04:33 +04:00
|
|
|
public:
|
2017-01-18 03:59:03 +03:00
|
|
|
// Returns true if aContainerType is an MP4 type that we think we can render
|
2017-01-01 04:27:45 +03:00
|
|
|
// with the a platform decoder backend.
|
|
|
|
// If provided, codecs are checked for support.
|
2017-01-18 03:59:03 +03:00
|
|
|
static bool IsSupportedType(const MediaContainerType& aContainerType,
|
2017-01-01 04:27:45 +03:00
|
|
|
DecoderDoctorDiagnostics* aDiagnostics);
|
2015-10-05 05:03:48 +03:00
|
|
|
|
2017-08-15 08:38:16 +03:00
|
|
|
static bool IsSupportedTypeWithoutDiagnostics(
|
|
|
|
const MediaContainerType& aContainerType);
|
|
|
|
|
2016-07-29 05:12:54 +03:00
|
|
|
// Return true if aMimeType is a one of the strings used by our demuxers to
|
|
|
|
// identify H264. Does not parse general content type strings, i.e. white
|
|
|
|
// space matters.
|
|
|
|
static bool IsH264(const nsACString& aMimeType);
|
|
|
|
|
2016-11-01 23:43:45 +03:00
|
|
|
// Return true if aMimeType is a one of the strings used by our demuxers to
|
|
|
|
// identify AAC. Does not parse general content type strings, i.e. white
|
|
|
|
// space matters.
|
|
|
|
static bool IsAAC(const nsACString& aMimeType);
|
|
|
|
|
2015-05-18 08:42:32 +03:00
|
|
|
// Returns true if the MP4 backend is preffed on.
|
2013-11-21 01:04:33 +04:00
|
|
|
static bool IsEnabled();
|
2015-05-08 04:36:32 +03:00
|
|
|
|
2018-06-07 17:47:41 +03:00
|
|
|
static nsTArray<UniquePtr<TrackInfo>> GetTracksInfo(
|
|
|
|
const MediaContainerType& aType);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static nsTArray<UniquePtr<TrackInfo>> GetTracksInfo(
|
|
|
|
const MediaContainerType& aType, MediaResult& aError);
|
2013-11-21 01:04:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|