2017-05-05 11:40:29 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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 HLSDecoder_h_
|
|
|
|
#define HLSDecoder_h_
|
|
|
|
|
2017-06-19 10:50:09 +03:00
|
|
|
#include "ChannelMediaDecoder.h"
|
2017-05-05 11:40:29 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
class MediaFormatReader;
|
|
|
|
|
2017-06-19 10:50:09 +03:00
|
|
|
class HLSDecoder final : public ChannelMediaDecoder
|
2017-05-05 11:40:29 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// MediaDecoder interface.
|
2017-06-19 10:50:09 +03:00
|
|
|
explicit HLSDecoder(MediaDecoderInit& aInit)
|
|
|
|
: ChannelMediaDecoder(aInit)
|
|
|
|
{
|
|
|
|
}
|
2017-05-05 11:40:29 +03:00
|
|
|
|
2017-06-20 13:10:27 +03:00
|
|
|
ChannelMediaDecoder* Clone(MediaDecoderInit& aInit) override;
|
2017-05-05 11:40:29 +03:00
|
|
|
|
2017-06-19 10:50:09 +03:00
|
|
|
MediaDecoderStateMachine* CreateStateMachine() override;
|
2017-05-05 11:40:29 +03:00
|
|
|
|
2017-06-19 10:50:09 +03:00
|
|
|
// Returns true if the HLS backend is pref'ed on.
|
|
|
|
static bool IsEnabled();
|
2017-05-05 11:40:29 +03:00
|
|
|
|
2017-06-19 10:50:09 +03:00
|
|
|
// Returns true if aContainerType is an HLS type that we think we can render
|
|
|
|
// with the a platform decoder backend.
|
|
|
|
// If provided, codecs are checked for support.
|
|
|
|
static bool IsSupportedType(const MediaContainerType& aContainerType);
|
2017-05-05 11:40:29 +03:00
|
|
|
|
2017-06-30 05:11:42 +03:00
|
|
|
nsresult Load(nsIChannel* aChannel,
|
|
|
|
bool aIsPrivateBrowsing,
|
|
|
|
nsIStreamListener**) override;
|
|
|
|
nsresult Load(MediaResource*) override;
|
2017-07-20 12:47:54 +03:00
|
|
|
|
|
|
|
nsresult Play() override;
|
|
|
|
|
|
|
|
void Pause() override;
|
2017-05-05 11:40:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* HLSDecoder_h_ */
|