Bug 1061046. Part 1.5: Expose MediaStream::GraphRate(). r=karlt

This is guaranteed to work even if the stream has been disconnected from the graph,
so it's preferred to Graph()->GraphRate().

--HG--
extra : rebase_source : e12fe80b3d95eea5f63e460bf557518a5bdcd42c
This commit is contained in:
Robert O'Callahan 2014-09-18 17:05:04 +12:00
parent 3bc8c5ea49
commit 5b856f8678
2 changed files with 7 additions and 0 deletions

View File

@ -334,6 +334,11 @@ public:
void SetGraphImpl(MediaStreamGraphImpl* aGraph);
void SetGraphImpl(MediaStreamGraph* aGraph);
/**
* Returns sample rate of the graph.
*/
TrackRate GraphRate() { return mBuffer.GraphRate(); }
// Control API.
// Since a stream can be played multiple ways, we need to combine independent
// volume settings. The aKey parameter is used to keep volume settings

View File

@ -71,6 +71,8 @@ class Fake_MediaStream {
public:
Fake_MediaStream () : mListeners(), mMutex("Fake MediaStream") {}
uint32_t GraphRate() { return 16000; }
void AddListener(Fake_MediaStreamListener *aListener) {
mozilla::MutexAutoLock lock(mMutex);
mListeners.insert(aListener);