Bug 879743 - Fake audio should be sent at the same rate as fake video r=jesup

This commit is contained in:
Ethan Hugg 2013-06-20 10:14:04 -07:00
parent 7fe8540ff0
commit 7bf9622aff
3 changed files with 5 additions and 7 deletions

View File

@ -44,6 +44,7 @@ public:
static const int DEFAULT_VIDEO_MIN_FPS = 10; static const int DEFAULT_VIDEO_MIN_FPS = 10;
static const int DEFAULT_VIDEO_WIDTH = 640; static const int DEFAULT_VIDEO_WIDTH = 640;
static const int DEFAULT_VIDEO_HEIGHT = 480; static const int DEFAULT_VIDEO_HEIGHT = 480;
static const int DEFAULT_AUDIO_TIMER_MS = 10;
/* Populate an array of video sources in the nsTArray. Also include devices /* Populate an array of video sources in the nsTArray. Also include devices
* that are currently unavailable. */ * that are currently unavailable. */

View File

@ -336,7 +336,7 @@ MediaEngineDefaultAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
mTrackID = aID; mTrackID = aID;
// 1 Audio frame per Video frame // 1 Audio frame per Video frame
mTimer->InitWithCallback(this, 1000 / MediaEngineDefaultVideoSource::DEFAULT_VIDEO_FPS, mTimer->InitWithCallback(this, MediaEngine::DEFAULT_AUDIO_TIMER_MS,
nsITimer::TYPE_REPEATING_SLACK); nsITimer::TYPE_REPEATING_SLACK);
mState = kStarted; mState = kStarted;
@ -373,7 +373,9 @@ NS_IMETHODIMP
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer) MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
{ {
AudioSegment segment; AudioSegment segment;
segment.InsertNullDataAtStart(AUDIO_RATE/100); // 10ms of fake data
// Notify timer is set every DEFAULT_AUDIO_TIMER_MS milliseconds.
segment.InsertNullDataAtStart((AUDIO_RATE * MediaEngine::DEFAULT_AUDIO_TIMER_MS) / 1000);
mSource->AppendToTrack(mTrackID, &segment); mSource->AppendToTrack(mTrackID, &segment);

View File

@ -58,11 +58,6 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSITIMERCALLBACK NS_DECL_NSITIMERCALLBACK
static const int DEFAULT_VIDEO_FPS = 60;
static const int DEFAULT_VIDEO_MIN_FPS = 10;
static const int DEFAULT_VIDEO_WIDTH = 640;
static const int DEFAULT_VIDEO_HEIGHT = 480;
protected: protected:
friend class MediaEngineDefault; friend class MediaEngineDefault;