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 RtspChannelChild_h michael@0: #define RtspChannelChild_h michael@0: michael@0: #include "mozilla/net/PRtspChannelChild.h" michael@0: #include "mozilla/net/NeckoChild.h" michael@0: #include "nsBaseChannel.h" michael@0: #include "nsIChildChannel.h" michael@0: #include "nsIStreamingProtocolController.h" michael@0: #include "nsIStreamingProtocolService.h" michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: // RtspChannelChild is a dummy channel used to aid MediaResource creation in michael@0: // HTMLMediaElement. Network control and data flows are managed by an michael@0: // RtspController object, which is created by us and manipulated by michael@0: // RtspMediaResource. This object is also responsible for inter-process michael@0: // communication with the parent process. michael@0: // When RtspChannelChild::AsyncOpen is called, it should create an michael@0: // RtspController object, dispatch an OnStartRequest and immediately return. michael@0: // We expect an RtspMediaResource object will be created in the calling context michael@0: // and it will use the RtpController we create. michael@0: michael@0: class RtspChannelChild : public PRtspChannelChild michael@0: , public nsBaseChannel michael@0: , public nsIChildChannel michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICHILDCHANNEL michael@0: michael@0: RtspChannelChild(nsIURI *aUri); michael@0: ~RtspChannelChild(); michael@0: michael@0: // nsBaseChannel::nsIChannel michael@0: NS_IMETHOD GetContentType(nsACString & aContentType) MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *aContext) michael@0: MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIStreamListener::nsIRequestObserver michael@0: NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) michael@0: MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD OnStopRequest(nsIRequest *aRequest, michael@0: nsISupports *aContext, michael@0: nsresult aStatusCode) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIStreamListener michael@0: NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, michael@0: nsISupports *aContext, michael@0: nsIInputStream *aInputStream, michael@0: uint64_t aOffset, michael@0: uint32_t aCount) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel::nsIChannel::nsIRequest michael@0: NS_IMETHOD Cancel(nsresult status) MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD Suspend() MOZ_OVERRIDE MOZ_FINAL; michael@0: NS_IMETHOD Resume() MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // nsBaseChannel michael@0: NS_IMETHOD OpenContentStream(bool aAsync, michael@0: nsIInputStream **aStream, michael@0: nsIChannel **aChannel) MOZ_OVERRIDE MOZ_FINAL; michael@0: michael@0: // IPDL michael@0: void AddIPDLReference(); michael@0: void ReleaseIPDLReference(); michael@0: michael@0: // RtspChannelChild michael@0: nsIStreamingProtocolController* GetController(); michael@0: void ReleaseController(); michael@0: michael@0: private: michael@0: bool mIPCOpen; michael@0: bool mCanceled; michael@0: nsCOMPtr mMediaStreamController; michael@0: }; michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: michael@0: #endif // RtspChannelChild_h