Bug 873003: ignore duplicate frames from NotifyQueuedTrackChanges() r=ekr

This commit is contained in:
Randell Jesup 2013-05-30 16:48:19 -04:00
Родитель 314ed7d128
Коммит b5b771fed5
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -827,6 +827,13 @@ void MediaPipelineTransmit::PipelineListener::ProcessVideoChunk(
return;
}
// We get passed duplicate frames every ~10ms even if there's no frame change!
int32_t serial = img->GetSerial();
if (serial == last_img_) {
return;
}
last_img_ = serial;
ImageFormat format = img->GetFormat();
#ifdef MOZ_WIDGET_GONK
if (format == GONK_IO_SURFACE) {

Просмотреть файл

@ -321,8 +321,12 @@ class MediaPipelineTransmit : public MediaPipeline {
class PipelineListener : public MediaStreamListener {
public:
PipelineListener(const RefPtr<MediaSessionConduit>& conduit)
: conduit_(conduit), active_(false), samples_10ms_buffer_(nullptr),
buffer_current_(0), samplenum_10ms_(0){}
: conduit_(conduit),
active_(false),
last_img_(-1),
samples_10ms_buffer_(nullptr),
buffer_current_(0),
samplenum_10ms_(0) {}
~PipelineListener()
{
@ -359,6 +363,8 @@ class MediaPipelineTransmit : public MediaPipeline {
RefPtr<MediaSessionConduit> conduit_;
volatile bool active_;
int32_t last_img_; // serial number of last Image
// These vars handle breaking audio samples into exact 10ms chunks:
// The buffer of 10ms audio samples that we will send once full
// (can be carried over from one call to another).