2 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 #ifndef MediaStreamClient_h
26 #define MediaStreamClient_h
28 #if ENABLE(MEDIA_STREAM)
30 #include <wtf/Forward.h>
36 enum GenerateStreamOptionFlag {
37 GenerateStreamRequestAudio = 1,
38 GenerateStreamRequestVideoFacingUser = 1 << 1,
39 GenerateStreamRequestVideoFacingEnvironment = 1 << 2,
42 typedef unsigned GenerateStreamOptionFlags;
44 class MediaStreamClient {
46 // MediaStream functions.
47 virtual void mediaStreamDestroyed() = 0;
48 virtual void generateStream(int requestId, GenerateStreamOptionFlags, PassRefPtr<SecurityOrigin>) = 0;
49 virtual void stopGeneratedStream(const String& streamLabel) = 0;
50 virtual void setMediaStreamTrackEnabled(const String& trackId, bool enabled) = 0;
52 // PeerConnection functions.
53 virtual void newPeerConnection(int peerConnectionId, const String& configuration) = 0;
54 virtual void startNegotiation(int peerConnectionId) = 0;
55 virtual void processSignalingMessage(int peerConnectionId, const String& message) = 0;
56 virtual void message(int peerConnectionId, const String& message) = 0;
57 virtual void addStream(int peerConnectionId, const String& streamLabel) = 0;
58 virtual void removeStream(int peerConnectionId, const String& streamLabel) = 0;
59 virtual void closePeerConnection(int peerConnectionId) = 0;
62 virtual ~MediaStreamClient() { }
65 } // namespace WebCore
67 #endif // ENABLE(MEDIA_STREAM)
69 #endif // MediaStreamClient_h