1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,80 @@ 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 RtspControllerChild_h 1.11 +#define RtspControllerChild_h 1.12 + 1.13 +#include "mozilla/net/PRtspControllerChild.h" 1.14 +#include "nsIStreamingProtocolController.h" 1.15 +#include "nsIChannel.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "nsString.h" 1.18 +#include "nsTArray.h" 1.19 +#include "mozilla/net/RtspChannelChild.h" 1.20 + 1.21 +namespace mozilla { 1.22 +namespace net { 1.23 + 1.24 +class RtspControllerChild : public nsIStreamingProtocolController 1.25 + , public nsIStreamingProtocolListener 1.26 + , public PRtspControllerChild 1.27 +{ 1.28 + public: 1.29 + NS_DECL_THREADSAFE_ISUPPORTS 1.30 + NS_DECL_NSISTREAMINGPROTOCOLCONTROLLER 1.31 + NS_DECL_NSISTREAMINGPROTOCOLLISTENER 1.32 + 1.33 + RtspControllerChild(nsIChannel *channel); 1.34 + ~RtspControllerChild(); 1.35 + 1.36 + bool RecvOnConnected(const uint8_t& index, 1.37 + const InfallibleTArray<RtspMetadataParam>& meta); 1.38 + 1.39 + bool RecvOnMediaDataAvailable( 1.40 + const uint8_t& index, 1.41 + const nsCString& data, 1.42 + const uint32_t& length, 1.43 + const uint32_t& offset, 1.44 + const InfallibleTArray<RtspMetadataParam>& meta); 1.45 + 1.46 + bool RecvOnDisconnected(const uint8_t& index, 1.47 + const nsresult& reason); 1.48 + 1.49 + bool RecvAsyncOpenFailed(const nsresult& reason); 1.50 + void AddIPDLReference(); 1.51 + void ReleaseIPDLReference(); 1.52 + void AddMetaData(already_AddRefed<nsIStreamingProtocolMetaData>&& meta); 1.53 + int GetMetaDataLength(); 1.54 + bool OKToSendIPC(); 1.55 + void AllowIPC(); 1.56 + void DisallowIPC(); 1.57 + 1.58 + private: 1.59 + bool mIPCOpen; 1.60 + // The intention of this variable is just to avoid any IPC message to be sent 1.61 + // when this flag is set as false. Nothing more. 1.62 + bool mIPCAllowed; 1.63 + // Dummy channel used to aid MediaResource creation in HTMLMediaElement. 1.64 + nsCOMPtr<nsIChannel> mChannel; 1.65 + // The nsIStreamingProtocolListener implementation. 1.66 + nsCOMPtr<nsIStreamingProtocolListener> mListener; 1.67 + // RTSP URL refer to a stream or an aggregate of streams. 1.68 + nsCOMPtr<nsIURI> mURI; 1.69 + // Array refer to metadata of the media stream. 1.70 + nsTArray<nsCOMPtr<nsIStreamingProtocolMetaData>> mMetaArray; 1.71 + // ASCII encoded URL spec 1.72 + nsCString mSpec; 1.73 + // The total tracks for the given media stream session. 1.74 + uint32_t mTotalTracks; 1.75 + // Current suspension depth for this channel object 1.76 + uint32_t mSuspendCount; 1.77 + // Detach channel-controller relationship. 1.78 + void ReleaseChannel(); 1.79 +}; 1.80 +} // namespace net 1.81 +} // namespace mozilla 1.82 + 1.83 +#endif // RtspControllerChild_h