| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 579 |
| 580 DECLARE_TRACE(); | 580 DECLARE_TRACE(); |
| 581 | 581 |
| 582 private: | 582 private: |
| 583 Member<AudioSourceProviderClient> m_client; | 583 Member<AudioSourceProviderClient> m_client; |
| 584 }; | 584 }; |
| 585 | 585 |
| 586 // AudioSourceProviderImpl wraps a WebAudioSourceProvider. | 586 // AudioSourceProviderImpl wraps a WebAudioSourceProvider. |
| 587 // provideInput() calls into Chromium to get a rendered audio stream. | 587 // provideInput() calls into Chromium to get a rendered audio stream. |
| 588 class AudioSourceProviderImpl final : public AudioSourceProvider { | 588 class AudioSourceProviderImpl final : public AudioSourceProvider { |
| 589 DISALLOW_ALLOCATION(); |
| 589 public: | 590 public: |
| 590 AudioSourceProviderImpl() | 591 AudioSourceProviderImpl() |
| 591 : m_webAudioSourceProvider(nullptr) | 592 : m_webAudioSourceProvider(nullptr) |
| 592 { | 593 { |
| 593 } | 594 } |
| 594 | 595 |
| 595 ~AudioSourceProviderImpl() override { } | 596 ~AudioSourceProviderImpl() override { } |
| 596 | 597 |
| 597 // Wraps the given WebAudioSourceProvider. | 598 // Wraps the given WebAudioSourceProvider. |
| 598 void wrap(WebAudioSourceProvider*); | 599 void wrap(WebAudioSourceProvider*); |
| 599 | 600 |
| 600 // AudioSourceProvider | 601 // AudioSourceProvider |
| 601 void setClient(AudioSourceProviderClient*) override; | 602 void setClient(AudioSourceProviderClient*) override; |
| 602 void provideInput(AudioBus*, size_t framesToProcess) override; | 603 void provideInput(AudioBus*, size_t framesToProcess) override; |
| 603 | 604 |
| 605 DECLARE_TRACE(); |
| 606 |
| 604 private: | 607 private: |
| 605 WebAudioSourceProvider* m_webAudioSourceProvider; | 608 WebAudioSourceProvider* m_webAudioSourceProvider; |
| 606 Persistent<AudioClientImpl> m_client; | 609 PersistentWillBeMember<AudioClientImpl> m_client; |
| 607 Mutex provideInputLock; | 610 Mutex provideInputLock; |
| 608 }; | 611 }; |
| 609 | 612 |
| 610 AudioSourceProviderImpl m_audioSourceProvider; | 613 AudioSourceProviderImpl m_audioSourceProvider; |
| 611 #endif | 614 #endif |
| 612 | 615 |
| 613 friend class MediaController; | 616 friend class MediaController; |
| 614 PersistentWillBeMember<MediaController> m_mediaController; | 617 PersistentWillBeMember<MediaController> m_mediaController; |
| 615 | 618 |
| 616 friend class Internals; | 619 friend class Internals; |
| 617 friend class TrackDisplayUpdateScope; | 620 friend class TrackDisplayUpdateScope; |
| 618 | 621 |
| 619 static URLRegistry* s_mediaStreamRegistry; | 622 static URLRegistry* s_mediaStreamRegistry; |
| 620 }; | 623 }; |
| 621 | 624 |
| 622 inline bool isHTMLMediaElement(const HTMLElement& element) | 625 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 623 { | 626 { |
| 624 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 627 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 625 } | 628 } |
| 626 | 629 |
| 627 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 630 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 628 | 631 |
| 629 } // namespace blink | 632 } // namespace blink |
| 630 | 633 |
| 631 #endif // HTMLMediaElement_h | 634 #endif // HTMLMediaElement_h |
| OLD | NEW |