Bug 1273405. Part 1 - rename some functions to be consistent with other MediaDataDecoder sub-classes. r=jya. draft 1273405_VorbisDataDecoder_Flush
authorJW Wang <jwwang@mozilla.com>
Tue, 17 May 2016 16:05:30 +0800
branch1273405_VorbisDataDecoder_Flush
changeset 370006 f9000b2562512a633c35a16fa338354514d0107c
parent 369317 16663eb3dcfa759f25b5e27b101bc79270c156f2
child 370007 dde2ff867bb6de3d9e00fdd55c66ac7e8f97438b
push id18977
push userjwwang@mozilla.com
push dateTue, 24 May 2016 03:49:46 +0000
reviewersjya
bugs1273405
milestone49.0a1
Bug 1273405. Part 1 - rename some functions to be consistent with other MediaDataDecoder sub-classes. r=jya. MozReview-Commit-ID: 1CpEZktGNia
dom/media/platforms/agnostic/VorbisDecoder.cpp
dom/media/platforms/agnostic/VorbisDecoder.h
--- a/dom/media/platforms/agnostic/VorbisDecoder.cpp
+++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp
@@ -125,24 +125,23 @@ VorbisDataDecoder::DecodeHeader(const un
                                     &pkt);
   return r == 0 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 nsresult
 VorbisDataDecoder::Input(MediaRawData* aSample)
 {
   mTaskQueue->Dispatch(NewRunnableMethod<RefPtr<MediaRawData>>(
-                         this, &VorbisDataDecoder::Decode,
-                         RefPtr<MediaRawData>(aSample)));
+                       this, &VorbisDataDecoder::ProcessDecode, aSample));
 
   return NS_OK;
 }
 
 void
-VorbisDataDecoder::Decode(MediaRawData* aSample)
+VorbisDataDecoder::ProcessDecode(MediaRawData* aSample)
 {
   if (DoDecode(aSample) == -1) {
     mCallback->Error();
   } else if (mTaskQueue->IsEmpty()) {
     mCallback->InputExhausted();
   }
 }
 
@@ -250,25 +249,25 @@ VorbisDataDecoder::DoDecode(MediaRawData
 
     frames = vorbis_synthesis_pcmout(&mVorbisDsp, &pcm);
   }
 
   return aTotalFrames > 0 ? 1 : 0;
 }
 
 void
-VorbisDataDecoder::DoDrain()
+VorbisDataDecoder::ProcessDrain()
 {
   mCallback->DrainComplete();
 }
 
 nsresult
 VorbisDataDecoder::Drain()
 {
-  mTaskQueue->Dispatch(NewRunnableMethod(this, &VorbisDataDecoder::DoDrain));
+  mTaskQueue->Dispatch(NewRunnableMethod(this, &VorbisDataDecoder::ProcessDrain));
   return NS_OK;
 }
 
 nsresult
 VorbisDataDecoder::Flush()
 {
   mTaskQueue->Flush();
   // Ignore failed results from vorbis_synthesis_restart. They
--- a/dom/media/platforms/agnostic/VorbisDecoder.h
+++ b/dom/media/platforms/agnostic/VorbisDecoder.h
@@ -38,19 +38,19 @@ public:
 
   // Return true if mimetype is Vorbis
   static bool IsVorbis(const nsACString& aMimeType);
   static const AudioConfig::Channel* VorbisLayout(uint32_t aChannels);
 
 private:
   nsresult DecodeHeader(const unsigned char* aData, size_t aLength);
 
-  void Decode (MediaRawData* aSample);
-  int DoDecode (MediaRawData* aSample);
-  void DoDrain ();
+  void ProcessDecode(MediaRawData* aSample);
+  int DoDecode(MediaRawData* aSample);
+  void ProcessDrain();
 
   const AudioInfo& mInfo;
   RefPtr<FlushableTaskQueue> mTaskQueue;
   MediaDataDecoderCallback* mCallback;
 
   // Vorbis decoder state
   vorbis_info mVorbisInfo;
   vorbis_comment mVorbisComment;