Bug 946027 - Expose subdecoder's owner to avoid breaking DXVA decoding in MSE. r=cpearce
authorMatthew Gregan <kinetik@flim.org>
Sun, 27 Apr 2014 17:36:00 +1200
changeset 180918 dcbcab7596ae0788dcce6ce870e6fafdab09fd91
parent 180917 f8a665814b94d3cd99a4bc38c9cfe7b49958cee7
child 180919 d762dfa90990c510e45ef0cbaea221e549160700
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerscpearce
bugs946027
milestone31.0a1
Bug 946027 - Expose subdecoder's owner to avoid breaking DXVA decoding in MSE. r=cpearce
content/media/BufferDecoder.h
content/media/mediasource/SourceBuffer.cpp
content/media/mediasource/SubBufferDecoder.h
--- a/content/media/BufferDecoder.h
+++ b/content/media/BufferDecoder.h
@@ -67,17 +67,17 @@ public:
   virtual void QueueMetadata(int64_t aTime, int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags) MOZ_FINAL MOZ_OVERRIDE;
 
   virtual void SetMediaEndTime(int64_t aTime) MOZ_FINAL MOZ_OVERRIDE;
 
   virtual void UpdatePlaybackPosition(int64_t aTime) MOZ_FINAL MOZ_OVERRIDE;
 
   virtual void OnReadMetadataCompleted() MOZ_FINAL MOZ_OVERRIDE;
 
-  virtual MediaDecoderOwner* GetOwner() MOZ_FINAL MOZ_OVERRIDE;
+  virtual MediaDecoderOwner* GetOwner() MOZ_OVERRIDE;
 
   virtual void NotifyWaitingForResourcesStatusChanged() MOZ_FINAL MOZ_OVERRIDE;
 
 protected:
   // This monitor object is not really used to synchronize access to anything.
   // It's just there in order for us to be able to override
   // GetReentrantMonitor correctly.
   ReentrantMonitor mReentrantMonitor;
--- a/content/media/mediasource/SourceBuffer.cpp
+++ b/content/media/mediasource/SourceBuffer.cpp
@@ -91,16 +91,22 @@ SubBufferDecoder::SetTransportSeekable(b
 }
 
 layers::ImageContainer*
 SubBufferDecoder::GetImageContainer()
 {
   return mParentDecoder->GetImageContainer();
 }
 
+MediaDecoderOwner*
+SubBufferDecoder::GetOwner()
+{
+  return mParentDecoder->GetOwner();
+}
+
 int64_t
 SubBufferDecoder::ConvertToByteOffset(double aTime)
 {
   // Uses a conversion based on (aTime/duration) * length.  For the
   // purposes of eviction this should be adequate since we have the
   // byte threshold as well to ensure data actually gets evicted and
   // we ensure we don't evict before the current playable point.
   if (mMediaDuration == -1) {
--- a/content/media/mediasource/SubBufferDecoder.h
+++ b/content/media/mediasource/SubBufferDecoder.h
@@ -39,16 +39,17 @@ public:
   virtual bool OnStateMachineThread() const MOZ_OVERRIDE;
   virtual bool OnDecodeThread() const MOZ_OVERRIDE;
   virtual SourceBufferResource* GetResource() const MOZ_OVERRIDE;
   virtual void SetMediaDuration(int64_t aDuration) MOZ_OVERRIDE;
   virtual void UpdateEstimatedMediaDuration(int64_t aDuration) MOZ_OVERRIDE;
   virtual void SetMediaSeekable(bool aMediaSeekable) MOZ_OVERRIDE;
   virtual void SetTransportSeekable(bool aTransportSeekable) MOZ_OVERRIDE;
   virtual layers::ImageContainer* GetImageContainer() MOZ_OVERRIDE;
+  virtual MediaDecoderOwner* GetOwner() MOZ_OVERRIDE;
 
   void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset)
   {
     mReader->NotifyDataArrived(aBuffer, aLength, aOffset);
 
     // XXX: Params make no sense to parent decoder as it relates to a
     // specific SubBufferDecoder's data stream.  Pass bogus values here to
     // force parent decoder's state machine to recompute end time for