Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/platform/mediastream/MediaStreamSource.h

Issue 569613002: Add the possibility to specify MediaStreamTrack::remote when creating a track. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed construction call from WebAudio. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 TypeAudio, 61 TypeAudio,
62 TypeVideo 62 TypeVideo
63 }; 63 };
64 64
65 enum ReadyState { 65 enum ReadyState {
66 ReadyStateLive = 0, 66 ReadyStateLive = 0,
67 ReadyStateMuted = 1, 67 ReadyStateMuted = 1,
68 ReadyStateEnded = 2 68 ReadyStateEnded = 2
69 }; 69 };
70 70
71 static PassRefPtr<MediaStreamSource> create(const String& id, Type, const St ring& name, ReadyState = ReadyStateLive, bool requiresConsumer = false); 71 static PassRefPtr<MediaStreamSource> create(const String& id, Type, const St ring& name, bool remote, bool readonly, ReadyState = ReadyStateLive, bool requir esConsumer = false);
72 72
73 const String& id() const { return m_id; } 73 const String& id() const { return m_id; }
74 Type type() const { return m_type; } 74 Type type() const { return m_type; }
75 const String& name() const { return m_name; } 75 const String& name() const { return m_name; }
76 bool remote() const { return m_remote; }
77 bool readonly() const { return m_readonly; }
76 78
77 void setReadyState(ReadyState); 79 void setReadyState(ReadyState);
78 ReadyState readyState() const { return m_readyState; } 80 ReadyState readyState() const { return m_readyState; }
79 81
80 void addObserver(Observer*); 82 void addObserver(Observer*);
81 void removeObserver(Observer*); 83 void removeObserver(Observer*);
82 84
83 ExtraData* extraData() const { return m_extraData.get(); } 85 ExtraData* extraData() const { return m_extraData.get(); }
84 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = extraData ; } 86 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = extraData ; }
85 87
86 void setConstraints(blink::WebMediaConstraints constraints) { m_constraints = constraints; } 88 void setConstraints(blink::WebMediaConstraints constraints) { m_constraints = constraints; }
87 blink::WebMediaConstraints constraints() { return m_constraints; } 89 blink::WebMediaConstraints constraints() { return m_constraints; }
88 90
89 void setAudioFormat(size_t numberOfChannels, float sampleRate); 91 void setAudioFormat(size_t numberOfChannels, float sampleRate);
90 void consumeAudio(AudioBus*, size_t numberOfFrames); 92 void consumeAudio(AudioBus*, size_t numberOfFrames);
91 93
92 bool requiresAudioConsumer() const { return m_requiresConsumer; } 94 bool requiresAudioConsumer() const { return m_requiresConsumer; }
93 void addAudioConsumer(AudioDestinationConsumer*); 95 void addAudioConsumer(AudioDestinationConsumer*);
94 bool removeAudioConsumer(AudioDestinationConsumer*); 96 bool removeAudioConsumer(AudioDestinationConsumer*);
95 const HeapHashSet<Member<AudioDestinationConsumer> >& audioConsumers() { ret urn m_audioConsumers; } 97 const HeapHashSet<Member<AudioDestinationConsumer> >& audioConsumers() { ret urn m_audioConsumers; }
96 98
97 private: 99 private:
98 MediaStreamSource(const String& id, Type, const String& name, ReadyState, bo ol requiresConsumer); 100 MediaStreamSource(const String& id, Type, const String& name, bool remote, b ool readonly, ReadyState, bool requiresConsumer);
99 101
100 String m_id; 102 String m_id;
101 Type m_type; 103 Type m_type;
102 String m_name; 104 String m_name;
105 bool m_remote;
106 bool m_readonly;
103 ReadyState m_readyState; 107 ReadyState m_readyState;
104 bool m_requiresConsumer; 108 bool m_requiresConsumer;
105 Vector<Observer*> m_observers; 109 Vector<Observer*> m_observers;
106 Mutex m_audioConsumersLock; 110 Mutex m_audioConsumersLock;
107 PersistentHeapHashSet<Member<AudioDestinationConsumer> > m_audioConsumers; 111 PersistentHeapHashSet<Member<AudioDestinationConsumer> > m_audioConsumers;
108 OwnPtr<ExtraData> m_extraData; 112 OwnPtr<ExtraData> m_extraData;
109 blink::WebMediaConstraints m_constraints; 113 blink::WebMediaConstraints m_constraints;
110 }; 114 };
111 115
112 typedef Vector<RefPtr<MediaStreamSource> > MediaStreamSourceVector; 116 typedef Vector<RefPtr<MediaStreamSource> > MediaStreamSourceVector;
113 117
114 } // namespace blink 118 } // namespace blink
115 119
116 #endif // MediaStreamSource_h 120 #endif // MediaStreamSource_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebMediaStreamSource.cpp ('k') | Source/platform/mediastream/MediaStreamSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698