michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MOZILLA_MEDIASOURCEDECODER_H_ michael@0: #define MOZILLA_MEDIASOURCEDECODER_H_ michael@0: michael@0: #include "MediaCache.h" michael@0: #include "MediaDecoder.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include "mozilla/ReentrantMonitor.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsError.h" michael@0: #include "nsStringGlue.h" michael@0: #include "nsTArray.h" michael@0: michael@0: class nsIStreamListener; michael@0: michael@0: namespace mozilla { michael@0: michael@0: class MediaResource; michael@0: class MediaDecoderReader; michael@0: class MediaDecoderStateMachine; michael@0: class SubBufferDecoder; michael@0: class MediaSourceReader; michael@0: michael@0: namespace dom { michael@0: michael@0: class HTMLMediaElement; michael@0: class MediaSource; michael@0: michael@0: } // namespace dom michael@0: michael@0: class MediaSourceDecoder : public MediaDecoder michael@0: { michael@0: public: michael@0: MediaSourceDecoder(dom::HTMLMediaElement* aElement); michael@0: michael@0: virtual MediaDecoder* Clone() MOZ_OVERRIDE; michael@0: virtual MediaDecoderStateMachine* CreateStateMachine() MOZ_OVERRIDE; michael@0: virtual nsresult Load(nsIStreamListener**, MediaDecoder*) MOZ_OVERRIDE; michael@0: virtual nsresult GetSeekable(dom::TimeRanges* aSeekable) MOZ_OVERRIDE; michael@0: michael@0: static already_AddRefed CreateResource(); michael@0: michael@0: void AttachMediaSource(dom::MediaSource* aMediaSource); michael@0: void DetachMediaSource(); michael@0: michael@0: already_AddRefed CreateSubDecoder(const nsACString& aType); michael@0: michael@0: nsresult EnqueueDecoderInitialization(); michael@0: michael@0: private: michael@0: // The owning MediaSource holds a strong reference to this decoder, and michael@0: // calls Attach/DetachMediaSource on this decoder to set and clear michael@0: // mMediaSource. michael@0: dom::MediaSource* mMediaSource; michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif /* MOZILLA_MEDIASOURCEDECODER_H_ */