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

Side by Side Diff: Source/modules/webaudio/MediaStreamAudioSourceNode.h

Issue 85523002: Fixed the crash in the wbaudio source provider when the audio track is going away. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google 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 23 matching lines...) Expand all
34 #include "wtf/OwnPtr.h" 34 #include "wtf/OwnPtr.h"
35 #include "wtf/PassRefPtr.h" 35 #include "wtf/PassRefPtr.h"
36 #include "wtf/Threading.h" 36 #include "wtf/Threading.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class AudioContext; 40 class AudioContext;
41 41
42 class MediaStreamAudioSourceNode : public AudioSourceNode, public AudioSourcePro viderClient { 42 class MediaStreamAudioSourceNode : public AudioSourceNode, public AudioSourcePro viderClient {
43 public: 43 public:
44 static PassRefPtr<MediaStreamAudioSourceNode> create(AudioContext*, MediaStr eam*, AudioSourceProvider*); 44 static PassRefPtr<MediaStreamAudioSourceNode> create(AudioContext*, MediaStr eam*, MediaStreamTrack*, AudioSourceProvider*);
45 45
46 virtual ~MediaStreamAudioSourceNode(); 46 virtual ~MediaStreamAudioSourceNode();
47 47
48 MediaStream* mediaStream() { return m_mediaStream.get(); } 48 MediaStream* mediaStream() { return m_mediaStream.get(); }
49 49
50 // AudioNode 50 // AudioNode
51 virtual void process(size_t framesToProcess); 51 virtual void process(size_t framesToProcess);
52 virtual void reset(); 52 virtual void reset();
53 53
54 // AudioSourceProviderClient 54 // AudioSourceProviderClient
55 virtual void setFormat(size_t numberOfChannels, float sampleRate); 55 virtual void setFormat(size_t numberOfChannels, float sampleRate);
56 56
57 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi der; } 57 AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvi der; }
58 58
59 private: 59 private:
60 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, AudioSourceProvider* ); 60 MediaStreamAudioSourceNode(AudioContext*, MediaStream*, MediaStreamTrack*, A udioSourceProvider*);
61 61
62 // As an audio source, we will never propagate silence. 62 // As an audio source, we will never propagate silence.
63 virtual bool propagatesSilence() const OVERRIDE { return false; } 63 virtual bool propagatesSilence() const OVERRIDE { return false; }
64 64
65 RefPtr<MediaStream> m_mediaStream; 65 RefPtr<MediaStream> m_mediaStream;
66
67 // Keep a reference of the audio MediaStreamTrack which owns the AudioSource Provider.
Tommy Widenflycht 2013/11/25 11:09:33 NIT: Drop the comment, please
no longer working on chromium 2013/11/25 14:00:19 Done.
68 RefPtr<MediaStreamTrack> m_audioTrack;
66 AudioSourceProvider* m_audioSourceProvider; 69 AudioSourceProvider* m_audioSourceProvider;
67 70
68 Mutex m_processLock; 71 Mutex m_processLock;
69 72
70 unsigned m_sourceNumberOfChannels; 73 unsigned m_sourceNumberOfChannels;
71 }; 74 };
72 75
73 } // namespace WebCore 76 } // namespace WebCore
74 77
75 #endif // ENABLE(WEB_AUDIO) 78 #endif // ENABLE(WEB_AUDIO)
76 79
77 #endif // MediaStreamAudioSourceNode_h 80 #endif // MediaStreamAudioSourceNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/MediaStreamAudioSourceNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698