Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
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 RtspController_h |
michael@0 | 8 | #define RtspController_h |
michael@0 | 9 | |
michael@0 | 10 | #include "nsIStreamingProtocolController.h" |
michael@0 | 11 | #include "nsIChannel.h" |
michael@0 | 12 | #include "nsCOMPtr.h" |
michael@0 | 13 | #include "nsString.h" |
michael@0 | 14 | #include "RTSPSource.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace mozilla { |
michael@0 | 17 | namespace net { |
michael@0 | 18 | |
michael@0 | 19 | class RtspController : public nsIStreamingProtocolController |
michael@0 | 20 | , public nsIStreamingProtocolListener |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 24 | NS_DECL_NSISTREAMINGPROTOCOLCONTROLLER |
michael@0 | 25 | NS_DECL_NSISTREAMINGPROTOCOLLISTENER |
michael@0 | 26 | |
michael@0 | 27 | RtspController(nsIChannel *channel); |
michael@0 | 28 | ~RtspController(); |
michael@0 | 29 | |
michael@0 | 30 | private: |
michael@0 | 31 | enum State { |
michael@0 | 32 | INIT, |
michael@0 | 33 | CONNECTED, |
michael@0 | 34 | DISCONNECTED |
michael@0 | 35 | }; |
michael@0 | 36 | |
michael@0 | 37 | // RTSP URL refer to a stream or an aggregate of streams. |
michael@0 | 38 | nsCOMPtr<nsIURI> mURI; |
michael@0 | 39 | // The nsIStreamingProtocolListener implementation. |
michael@0 | 40 | nsCOMPtr<nsIStreamingProtocolListener> mListener; |
michael@0 | 41 | // ASCII encoded URL spec. |
michael@0 | 42 | nsCString mSpec; |
michael@0 | 43 | // Indicate the connection state between the |
michael@0 | 44 | // media streaming server and the Rtsp client. |
michael@0 | 45 | State mState; |
michael@0 | 46 | // Rtsp Streaming source. |
michael@0 | 47 | android::sp<android::RTSPSource> mRtspSource; |
michael@0 | 48 | }; |
michael@0 | 49 | |
michael@0 | 50 | } |
michael@0 | 51 | } // namespace mozilla::net |
michael@0 | 52 | #endif |