Bug 1274189. Part 1 - rename some functions to be consistent with other MediaDataDecoder sub-classes. r=jya. draft 1273405_VorbisDataDecoder_Flush
authorJW Wang <jwwang@mozilla.com>
Fri, 20 May 2016 16:28:50 +0800
branch1273405_VorbisDataDecoder_Flush
changeset 370604 c08c82c76bef3d92bc11dd4076201c4cb89b1194
parent 370603 b0f4848dc4b411d3eaa17084d21716c62204f9bf
child 370605 c70f46a87a0ba46b51af0a44114017fc75a1c057
child 724576 cdece5035c1e457b9c4abce4a030ffb7438d013c
push id19124
push userjwwang@mozilla.com
push dateWed, 25 May 2016 06:27:58 +0000
reviewersjya
bugs1274189
milestone49.0a1
Bug 1274189. Part 1 - rename some functions to be consistent with other MediaDataDecoder sub-classes. r=jya. MozReview-Commit-ID: EqR1cQ2sAhQ
dom/media/platforms/agnostic/OpusDecoder.cpp
dom/media/platforms/agnostic/OpusDecoder.h
--- a/dom/media/platforms/agnostic/OpusDecoder.cpp
+++ b/dom/media/platforms/agnostic/OpusDecoder.cpp
@@ -128,24 +128,23 @@ OpusDataDecoder::DecodeHeader(const unsi
 
   return NS_OK;
 }
 
 nsresult
 OpusDataDecoder::Input(MediaRawData* aSample)
 {
   mTaskQueue->Dispatch(NewRunnableMethod<RefPtr<MediaRawData>>(
-                         this, &OpusDataDecoder::Decode,
-                         RefPtr<MediaRawData>(aSample)));
+                       this, &OpusDataDecoder::ProcessDecode, aSample));
 
   return NS_OK;
 }
 
 void
-OpusDataDecoder::Decode(MediaRawData* aSample)
+OpusDataDecoder::ProcessDecode(MediaRawData* aSample)
 {
   if (DoDecode(aSample) == -1) {
     mCallback->Error();
   } else if(mTaskQueue->IsEmpty()) {
     mCallback->InputExhausted();
   }
 }
 
@@ -294,25 +293,25 @@ OpusDataDecoder::DoDecode(MediaRawData* 
                                   Move(buffer),
                                   mOpusParser->mChannels,
                                   mOpusParser->mRate));
   mFrames += frames;
   return frames;
 }
 
 void
-OpusDataDecoder::DoDrain()
+OpusDataDecoder::ProcessDrain()
 {
   mCallback->DrainComplete();
 }
 
 nsresult
 OpusDataDecoder::Drain()
 {
-  mTaskQueue->Dispatch(NewRunnableMethod(this, &OpusDataDecoder::DoDrain));
+  mTaskQueue->Dispatch(NewRunnableMethod(this, &OpusDataDecoder::ProcessDrain));
   return NS_OK;
 }
 
 nsresult
 OpusDataDecoder::Flush()
 {
   mTaskQueue->Flush();
   if (mOpusDecoder) {
--- a/dom/media/platforms/agnostic/OpusDecoder.h
+++ b/dom/media/platforms/agnostic/OpusDecoder.h
@@ -33,19 +33,19 @@ public:
   }
 
   // Return true if mimetype is Opus
   static bool IsOpus(const nsACString& aMimeType);
 
 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;
 
   // Opus decoder state
   nsAutoPtr<OpusParser> mOpusParser;
   OpusMSDecoder* mOpusDecoder;