Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et tw=80 : */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef RtspControllerChild_h |
michael@0 | 8 | #define RtspControllerChild_h |
michael@0 | 9 | |
michael@0 | 10 | #include "mozilla/net/PRtspControllerChild.h" |
michael@0 | 11 | #include "nsIStreamingProtocolController.h" |
michael@0 | 12 | #include "nsIChannel.h" |
michael@0 | 13 | #include "nsCOMPtr.h" |
michael@0 | 14 | #include "nsString.h" |
michael@0 | 15 | #include "nsTArray.h" |
michael@0 | 16 | #include "mozilla/net/RtspChannelChild.h" |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | namespace net { |
michael@0 | 20 | |
michael@0 | 21 | class RtspControllerChild : public nsIStreamingProtocolController |
michael@0 | 22 | , public nsIStreamingProtocolListener |
michael@0 | 23 | , public PRtspControllerChild |
michael@0 | 24 | { |
michael@0 | 25 | public: |
michael@0 | 26 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 27 | NS_DECL_NSISTREAMINGPROTOCOLCONTROLLER |
michael@0 | 28 | NS_DECL_NSISTREAMINGPROTOCOLLISTENER |
michael@0 | 29 | |
michael@0 | 30 | RtspControllerChild(nsIChannel *channel); |
michael@0 | 31 | ~RtspControllerChild(); |
michael@0 | 32 | |
michael@0 | 33 | bool RecvOnConnected(const uint8_t& index, |
michael@0 | 34 | const InfallibleTArray<RtspMetadataParam>& meta); |
michael@0 | 35 | |
michael@0 | 36 | bool RecvOnMediaDataAvailable( |
michael@0 | 37 | const uint8_t& index, |
michael@0 | 38 | const nsCString& data, |
michael@0 | 39 | const uint32_t& length, |
michael@0 | 40 | const uint32_t& offset, |
michael@0 | 41 | const InfallibleTArray<RtspMetadataParam>& meta); |
michael@0 | 42 | |
michael@0 | 43 | bool RecvOnDisconnected(const uint8_t& index, |
michael@0 | 44 | const nsresult& reason); |
michael@0 | 45 | |
michael@0 | 46 | bool RecvAsyncOpenFailed(const nsresult& reason); |
michael@0 | 47 | void AddIPDLReference(); |
michael@0 | 48 | void ReleaseIPDLReference(); |
michael@0 | 49 | void AddMetaData(already_AddRefed<nsIStreamingProtocolMetaData>&& meta); |
michael@0 | 50 | int GetMetaDataLength(); |
michael@0 | 51 | bool OKToSendIPC(); |
michael@0 | 52 | void AllowIPC(); |
michael@0 | 53 | void DisallowIPC(); |
michael@0 | 54 | |
michael@0 | 55 | private: |
michael@0 | 56 | bool mIPCOpen; |
michael@0 | 57 | // The intention of this variable is just to avoid any IPC message to be sent |
michael@0 | 58 | // when this flag is set as false. Nothing more. |
michael@0 | 59 | bool mIPCAllowed; |
michael@0 | 60 | // Dummy channel used to aid MediaResource creation in HTMLMediaElement. |
michael@0 | 61 | nsCOMPtr<nsIChannel> mChannel; |
michael@0 | 62 | // The nsIStreamingProtocolListener implementation. |
michael@0 | 63 | nsCOMPtr<nsIStreamingProtocolListener> mListener; |
michael@0 | 64 | // RTSP URL refer to a stream or an aggregate of streams. |
michael@0 | 65 | nsCOMPtr<nsIURI> mURI; |
michael@0 | 66 | // Array refer to metadata of the media stream. |
michael@0 | 67 | nsTArray<nsCOMPtr<nsIStreamingProtocolMetaData>> mMetaArray; |
michael@0 | 68 | // ASCII encoded URL spec |
michael@0 | 69 | nsCString mSpec; |
michael@0 | 70 | // The total tracks for the given media stream session. |
michael@0 | 71 | uint32_t mTotalTracks; |
michael@0 | 72 | // Current suspension depth for this channel object |
michael@0 | 73 | uint32_t mSuspendCount; |
michael@0 | 74 | // Detach channel-controller relationship. |
michael@0 | 75 | void ReleaseChannel(); |
michael@0 | 76 | }; |
michael@0 | 77 | } // namespace net |
michael@0 | 78 | } // namespace mozilla |
michael@0 | 79 | |
michael@0 | 80 | #endif // RtspControllerChild_h |