michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et 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 RtspControllerChild_h michael@0: #define RtspControllerChild_h michael@0: michael@0: #include "mozilla/net/PRtspControllerChild.h" michael@0: #include "nsIStreamingProtocolController.h" michael@0: #include "nsIChannel.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "nsTArray.h" michael@0: #include "mozilla/net/RtspChannelChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: class RtspControllerChild : public nsIStreamingProtocolController michael@0: , public nsIStreamingProtocolListener michael@0: , public PRtspControllerChild michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSISTREAMINGPROTOCOLCONTROLLER michael@0: NS_DECL_NSISTREAMINGPROTOCOLLISTENER michael@0: michael@0: RtspControllerChild(nsIChannel *channel); michael@0: ~RtspControllerChild(); michael@0: michael@0: bool RecvOnConnected(const uint8_t& index, michael@0: const InfallibleTArray& meta); michael@0: michael@0: bool RecvOnMediaDataAvailable( michael@0: const uint8_t& index, michael@0: const nsCString& data, michael@0: const uint32_t& length, michael@0: const uint32_t& offset, michael@0: const InfallibleTArray& meta); michael@0: michael@0: bool RecvOnDisconnected(const uint8_t& index, michael@0: const nsresult& reason); michael@0: michael@0: bool RecvAsyncOpenFailed(const nsresult& reason); michael@0: void AddIPDLReference(); michael@0: void ReleaseIPDLReference(); michael@0: void AddMetaData(already_AddRefed&& meta); michael@0: int GetMetaDataLength(); michael@0: bool OKToSendIPC(); michael@0: void AllowIPC(); michael@0: void DisallowIPC(); michael@0: michael@0: private: michael@0: bool mIPCOpen; michael@0: // The intention of this variable is just to avoid any IPC message to be sent michael@0: // when this flag is set as false. Nothing more. michael@0: bool mIPCAllowed; michael@0: // Dummy channel used to aid MediaResource creation in HTMLMediaElement. michael@0: nsCOMPtr mChannel; michael@0: // The nsIStreamingProtocolListener implementation. michael@0: nsCOMPtr mListener; michael@0: // RTSP URL refer to a stream or an aggregate of streams. michael@0: nsCOMPtr mURI; michael@0: // Array refer to metadata of the media stream. michael@0: nsTArray> mMetaArray; michael@0: // ASCII encoded URL spec michael@0: nsCString mSpec; michael@0: // The total tracks for the given media stream session. michael@0: uint32_t mTotalTracks; michael@0: // Current suspension depth for this channel object michael@0: uint32_t mSuspendCount; michael@0: // Detach channel-controller relationship. michael@0: void ReleaseChannel(); michael@0: }; michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: michael@0: #endif // RtspControllerChild_h