1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/rtsp/RtspChannelChild.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,88 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set sw=2 ts=8 et tw=80 : */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef RtspChannelChild_h 1.11 +#define RtspChannelChild_h 1.12 + 1.13 +#include "mozilla/net/PRtspChannelChild.h" 1.14 +#include "mozilla/net/NeckoChild.h" 1.15 +#include "nsBaseChannel.h" 1.16 +#include "nsIChildChannel.h" 1.17 +#include "nsIStreamingProtocolController.h" 1.18 +#include "nsIStreamingProtocolService.h" 1.19 + 1.20 +namespace mozilla { 1.21 +namespace net { 1.22 + 1.23 +//----------------------------------------------------------------------------- 1.24 +// RtspChannelChild is a dummy channel used to aid MediaResource creation in 1.25 +// HTMLMediaElement. Network control and data flows are managed by an 1.26 +// RtspController object, which is created by us and manipulated by 1.27 +// RtspMediaResource. This object is also responsible for inter-process 1.28 +// communication with the parent process. 1.29 +// When RtspChannelChild::AsyncOpen is called, it should create an 1.30 +// RtspController object, dispatch an OnStartRequest and immediately return. 1.31 +// We expect an RtspMediaResource object will be created in the calling context 1.32 +// and it will use the RtpController we create. 1.33 + 1.34 +class RtspChannelChild : public PRtspChannelChild 1.35 + , public nsBaseChannel 1.36 + , public nsIChildChannel 1.37 +{ 1.38 +public: 1.39 + NS_DECL_ISUPPORTS 1.40 + NS_DECL_NSICHILDCHANNEL 1.41 + 1.42 + RtspChannelChild(nsIURI *aUri); 1.43 + ~RtspChannelChild(); 1.44 + 1.45 + // nsBaseChannel::nsIChannel 1.46 + NS_IMETHOD GetContentType(nsACString & aContentType) MOZ_OVERRIDE MOZ_FINAL; 1.47 + NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *aContext) 1.48 + MOZ_OVERRIDE MOZ_FINAL; 1.49 + 1.50 + // nsBaseChannel::nsIStreamListener::nsIRequestObserver 1.51 + NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) 1.52 + MOZ_OVERRIDE MOZ_FINAL; 1.53 + NS_IMETHOD OnStopRequest(nsIRequest *aRequest, 1.54 + nsISupports *aContext, 1.55 + nsresult aStatusCode) MOZ_OVERRIDE MOZ_FINAL; 1.56 + 1.57 + // nsBaseChannel::nsIStreamListener 1.58 + NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, 1.59 + nsISupports *aContext, 1.60 + nsIInputStream *aInputStream, 1.61 + uint64_t aOffset, 1.62 + uint32_t aCount) MOZ_OVERRIDE MOZ_FINAL; 1.63 + 1.64 + // nsBaseChannel::nsIChannel::nsIRequest 1.65 + NS_IMETHOD Cancel(nsresult status) MOZ_OVERRIDE MOZ_FINAL; 1.66 + NS_IMETHOD Suspend() MOZ_OVERRIDE MOZ_FINAL; 1.67 + NS_IMETHOD Resume() MOZ_OVERRIDE MOZ_FINAL; 1.68 + 1.69 + // nsBaseChannel 1.70 + NS_IMETHOD OpenContentStream(bool aAsync, 1.71 + nsIInputStream **aStream, 1.72 + nsIChannel **aChannel) MOZ_OVERRIDE MOZ_FINAL; 1.73 + 1.74 + // IPDL 1.75 + void AddIPDLReference(); 1.76 + void ReleaseIPDLReference(); 1.77 + 1.78 + // RtspChannelChild 1.79 + nsIStreamingProtocolController* GetController(); 1.80 + void ReleaseController(); 1.81 + 1.82 +private: 1.83 + bool mIPCOpen; 1.84 + bool mCanceled; 1.85 + nsCOMPtr<nsIStreamingProtocolController> mMediaStreamController; 1.86 +}; 1.87 + 1.88 +} // namespace net 1.89 +} // namespace mozilla 1.90 + 1.91 +#endif // RtspChannelChild_h