зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1195158. Part 2 - Have OggReader send TimedMetadata events through a event source instead of direct calls to AbstractMediaDecoder::QueueMetadata. r=cpearce.
This commit is contained in:
Родитель
e82e865c9a
Коммит
2b46e9e678
|
@ -11,6 +11,7 @@
|
|||
#include "AbstractMediaDecoder.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaData.h"
|
||||
#include "MediaMetadataManager.h"
|
||||
#include "MediaQueue.h"
|
||||
#include "MediaTimer.h"
|
||||
#include "AudioCompactor.h"
|
||||
|
@ -327,6 +328,10 @@ public:
|
|||
|
||||
virtual void DisableHardwareAcceleration() {}
|
||||
|
||||
TimedMetadataEventSource& TimedMetadataEvent() {
|
||||
return mTimedMetadataEvent;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~MediaDecoderReader();
|
||||
|
||||
|
@ -418,6 +423,9 @@ protected:
|
|||
bool mHitAudioDecodeError;
|
||||
bool mShutdown;
|
||||
|
||||
// Used to send TimedMetadata to the listener.
|
||||
TimedMetadataEventProducer mTimedMetadataEvent;
|
||||
|
||||
private:
|
||||
// Promises used only for the base-class (sync->async adapter) implementation
|
||||
// of Request{Audio,Video}Data.
|
||||
|
|
|
@ -814,10 +814,11 @@ bool OggReader::ReadOggChain()
|
|||
if (chained) {
|
||||
SetChained(true);
|
||||
{
|
||||
nsAutoPtr<MediaInfo> info(new MediaInfo(mInfo));
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
auto t = mDecodedAudioFrames * USECS_PER_S / mInfo.mAudio.mRate;
|
||||
mDecoder->QueueMetadata(media::TimeUnit::FromMicroseconds(t), info, tags);
|
||||
mTimedMetadataEvent.Notify(
|
||||
TimedMetadata(media::TimeUnit::FromMicroseconds(t),
|
||||
Move(tags),
|
||||
nsAutoPtr<MediaInfo>(new MediaInfo(mInfo))));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче