| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class WebAudioSourceProvider; | 46 class WebAudioSourceProvider; |
| 47 | 47 |
| 48 class PLATFORM_EXPORT MediaStreamComponent : public RefCounted<MediaStreamCompon
ent> { | 48 class PLATFORM_EXPORT MediaStreamComponent : public RefCounted<MediaStreamCompon
ent> { |
| 49 public: | 49 public: |
| 50 class ExtraData { | 50 class ExtraData { |
| 51 public: | 51 public: |
| 52 virtual ~ExtraData() { } | 52 virtual ~ExtraData() { } |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 static PassRefPtr<MediaStreamComponent> create(PassRefPtr<MediaStreamSource>
); | 55 static PassRefPtr<MediaStreamComponent> create(PassRefPtr<MediaStreamSource>
); |
| 56 static PassRefPtr<MediaStreamComponent> create(const String& id, PassRefPtr<
MediaStreamSource>); | 56 static PassRefPtr<MediaStreamComponent> create(const String& id, PassRefPtr<
MediaStreamSource>, bool remote); |
| 57 | 57 |
| 58 MediaStreamSource* source() const { return m_source.get(); } | 58 MediaStreamSource* source() const { return m_source.get(); } |
| 59 | 59 |
| 60 String id() const { return m_id; } | 60 String id() const { return m_id; } |
| 61 bool enabled() const { return m_enabled; } | 61 bool enabled() const { return m_enabled; } |
| 62 void setEnabled(bool enabled) { m_enabled = enabled; } | 62 void setEnabled(bool enabled) { m_enabled = enabled; } |
| 63 bool muted() const { return m_muted; } | 63 bool muted() const { return m_muted; } |
| 64 bool remote() const { return m_remote; } |
| 64 | 65 |
| 65 #if ENABLE(WEB_AUDIO) | 66 #if ENABLE(WEB_AUDIO) |
| 66 AudioSourceProvider* audioSourceProvider() { return &m_sourceProvider; } | 67 AudioSourceProvider* audioSourceProvider() { return &m_sourceProvider; } |
| 67 void setSourceProvider(WebAudioSourceProvider* provider) { m_sourceProvider.
wrap(provider); } | 68 void setSourceProvider(WebAudioSourceProvider* provider) { m_sourceProvider.
wrap(provider); } |
| 68 #endif // ENABLE(WEB_AUDIO) | 69 #endif // ENABLE(WEB_AUDIO) |
| 69 | 70 |
| 70 ExtraData* extraData() const { return m_extraData.get(); } | 71 ExtraData* extraData() const { return m_extraData.get(); } |
| 71 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = extraData
; } | 72 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = extraData
; } |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 MediaStreamComponent(const String& id, PassRefPtr<MediaStreamSource>); | 75 MediaStreamComponent(const String& id, PassRefPtr<MediaStreamSource>, bool); |
| 75 | 76 |
| 76 #if ENABLE(WEB_AUDIO) | 77 #if ENABLE(WEB_AUDIO) |
| 77 // AudioSourceProviderImpl wraps a WebAudioSourceProvider::provideInput() | 78 // AudioSourceProviderImpl wraps a WebAudioSourceProvider::provideInput() |
| 78 // calls into chromium to get a rendered audio stream. | 79 // calls into chromium to get a rendered audio stream. |
| 79 | 80 |
| 80 class PLATFORM_EXPORT AudioSourceProviderImpl FINAL: public AudioSourceProvi
der { | 81 class PLATFORM_EXPORT AudioSourceProviderImpl FINAL: public AudioSourceProvi
der { |
| 81 public: | 82 public: |
| 82 AudioSourceProviderImpl() | 83 AudioSourceProviderImpl() |
| 83 : m_webAudioSourceProvider(0) | 84 : m_webAudioSourceProvider(0) |
| 84 { | 85 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 97 Mutex m_provideInputLock; | 98 Mutex m_provideInputLock; |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 AudioSourceProviderImpl m_sourceProvider; | 101 AudioSourceProviderImpl m_sourceProvider; |
| 101 #endif // ENABLE(WEB_AUDIO) | 102 #endif // ENABLE(WEB_AUDIO) |
| 102 | 103 |
| 103 RefPtr<MediaStreamSource> m_source; | 104 RefPtr<MediaStreamSource> m_source; |
| 104 String m_id; | 105 String m_id; |
| 105 bool m_enabled; | 106 bool m_enabled; |
| 106 bool m_muted; | 107 bool m_muted; |
| 108 bool m_remote; |
| 107 OwnPtr<ExtraData> m_extraData; | 109 OwnPtr<ExtraData> m_extraData; |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 typedef Vector<RefPtr<MediaStreamComponent> > MediaStreamComponentVector; | 112 typedef Vector<RefPtr<MediaStreamComponent> > MediaStreamComponentVector; |
| 111 | 113 |
| 112 } // namespace blink | 114 } // namespace blink |
| 113 | 115 |
| 114 #endif // MediaStreamComponent_h | 116 #endif // MediaStreamComponent_h |
| OLD | NEW |