Skip to content

Commit

Permalink
Bug 1061046. Part 1.5: Expose MediaStream::GraphRate(). r=karlt
Browse files Browse the repository at this point in the history
This is guaranteed to work even if the stream has been disconnected from the graph,
so it's preferred to Graph()->GraphRate().
  • Loading branch information
rocallahan committed Sep 18, 2014
1 parent 16e020a commit 4216c1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/media/MediaStreamGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ class MediaStream : public mozilla::LinkedListElement<MediaStream> {
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
Expand Down
2 changes: 2 additions & 0 deletions media/webrtc/signaling/test/FakeMediaStreams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4216c1b

Please sign in to comment.