Bug 1110534 - Use ref counted pointers to hold references in mac decoder. r=rillian, a=sledru
--- a/dom/media/fmp4/apple/AppleATDecoder.h
+++ b/dom/media/fmp4/apple/AppleATDecoder.h
@@ -4,17 +4,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_AppleATDecoder_h
#define mozilla_AppleATDecoder_h
#include <AudioToolbox/AudioToolbox.h>
#include "PlatformDecoderModule.h"
-#include "mozilla/RefPtr.h"
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/Vector.h"
#include "nsIThread.h"
namespace mozilla {
class MediaTaskQueue;
class MediaDataDecoderCallback;
@@ -37,17 +36,17 @@ public:
// Use to extract magic cookie for HE-AAC detection.
nsTArray<uint8_t> mMagicCookie;
// Will be set to true should an error occurred while attempting to retrieve
// the magic cookie property.
bool mFileStreamError;
private:
- RefPtr<MediaTaskQueue> mTaskQueue;
+ nsRefPtr<MediaTaskQueue> mTaskQueue;
MediaDataDecoderCallback* mCallback;
AudioConverterRef mConverter;
AudioStreamBasicDescription mOutputFormat;
UInt32 mFormatID;
AudioFileStreamID mStream;
nsTArray<nsAutoPtr<mp4_demuxer::MP4Sample>> mQueuedSamples;
void SubmitSample(nsAutoPtr<mp4_demuxer::MP4Sample> aSample);
--- a/dom/media/fmp4/apple/AppleVDADecoder.h
+++ b/dom/media/fmp4/apple/AppleVDADecoder.h
@@ -3,17 +3,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_AppleVDADecoder_h
#define mozilla_AppleVDADecoder_h
#include "PlatformDecoderModule.h"
-#include "mozilla/RefPtr.h"
#include "mozilla/ReentrantMonitor.h"
#include "MP4Reader.h"
#include "MP4Decoder.h"
#include "nsIThread.h"
#include "ReorderQueue.h"
#include "VideoDecodeAcceleration/VDADecoder.h"
@@ -82,19 +81,19 @@ public:
protected:
AppleFrameRef* CreateAppleFrameRef(const mp4_demuxer::MP4Sample* aSample);
void DrainReorderedFrames();
void ClearReorderedFrames();
CFDictionaryRef CreateOutputConfiguration();
const mp4_demuxer::VideoDecoderConfig& mConfig;
- RefPtr<MediaTaskQueue> mTaskQueue;
+ nsRefPtr<MediaTaskQueue> mTaskQueue;
MediaDataDecoderCallback* mCallback;
- layers::ImageContainer* mImageContainer;
+ nsRefPtr<layers::ImageContainer> mImageContainer;
ReorderQueue mReorderQueue;
private:
VDADecoder mDecoder;
bool mIs106;
// Method to pass a frame to VideoToolbox for decoding.
nsresult SubmitFrame(mp4_demuxer::MP4Sample* aSample);