Bug 1073003 - Fix a -Woverloaded-virtual warning by renaming a method. r=alfredo
authorBotond Ballo <botond@mozilla.com>
Tue, 23 Dec 2014 03:24:14 -0500
changeset 248390 0f9759d2b5215509dd36a9e1e954b65e8c462354
parent 248389 f1ff5ea60279a3f5e7498fe7cb5dffe4d0eda27d
child 248391 dd0a52ad9cb3cf32f5c837b06cc155d1ddb0ed52
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalfredo
bugs1073003
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073003 - Fix a -Woverloaded-virtual warning by renaming a method. r=alfredo
dom/media/webrtc/GonkCameraImage.cpp
dom/media/webrtc/GonkCameraImage.h
dom/media/webrtc/MediaEngineGonkVideoSource.cpp
dom/media/webrtc/MediaEngineGonkVideoSource.h
--- a/dom/media/webrtc/GonkCameraImage.cpp
+++ b/dom/media/webrtc/GonkCameraImage.cpp
@@ -21,17 +21,17 @@ GonkCameraImage::GonkCameraImage()
 GonkCameraImage::~GonkCameraImage()
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
   // mMediaBuffer must be cleared before destructor.
   MOZ_ASSERT(mMediaBuffer == nullptr);
 }
 
 nsresult
-GonkCameraImage::GetBuffer(android::MediaBuffer** aBuffer)
+GonkCameraImage::GetMediaBuffer(android::MediaBuffer** aBuffer)
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
 
   if (!mMediaBuffer) {
     return NS_ERROR_FAILURE;
   }
 
   MOZ_ASSERT(NS_GetCurrentThread() == mThread);
@@ -45,30 +45,30 @@ GonkCameraImage::GetBuffer(android::Medi
 bool
 GonkCameraImage::HasMediaBuffer()
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
   return mMediaBuffer != nullptr;
 }
 
 nsresult
-GonkCameraImage::SetBuffer(android::MediaBuffer* aBuffer)
+GonkCameraImage::SetMediaBuffer(android::MediaBuffer* aBuffer)
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
   MOZ_ASSERT(!mMediaBuffer);
 
   mMediaBuffer = aBuffer;
   mMediaBuffer->add_ref();
   mThread = NS_GetCurrentThread();
 
   return NS_OK;
 }
 
 nsresult
-GonkCameraImage::ClearBuffer()
+GonkCameraImage::ClearMediaBuffer()
 {
   ReentrantMonitorAutoEnter mon(mMonitor);
 
   if (mMediaBuffer) {
     MOZ_ASSERT(NS_GetCurrentThread() == mThread);
     mMediaBuffer->release();
     mMediaBuffer = nullptr;
     mThread = nullptr;
--- a/dom/media/webrtc/GonkCameraImage.h
+++ b/dom/media/webrtc/GonkCameraImage.h
@@ -19,57 +19,57 @@ namespace mozilla {
 
 /**
  * GonkCameraImage has two parts. One is preview image which will be saved in
  * GrallocImage, another kind is the MediaBuffer keeps in mMediaBuffer
  * which is from gonk camera recording callback. The data in MediaBuffer is Gonk
  * shared memory based on android binder (IMemory), the actual format in IMemory
  * is platform dependent.
  * This instance is created in MediaEngine when the preview image arrives.
- * The MediaBuffer is attached to the current created GonkCameraImage via SetBuffer().
- * After sending this image to MediaStreamGraph by AppendToTrack(), ClearBuffer()
+ * The MediaBuffer is attached to the current created GonkCameraImage via SetMediaBuffer().
+ * After sending this image to MediaStreamGraph by AppendToTrack(), ClearMediaBuffer()
  * must be called to clear MediaBuffer to avoid MediaBuffer be kept in MSG thread.
  * The reason to keep MediaBuffer be accessed from MSG thread is MediaBuffer is
  * limited resource and it could cause frame rate jitter if MediaBuffer stay too
  * long in other threads.
  * So there will be 3 threads to accessed this class. First is camera preview
  * thread which creates an instance of this class and initialize the preview
  * image in the base class GrallocImage. Second is the camera recording
  * thread which attaches MediaBuffer and sends this image to MediaStreamDirectListener.
  * Third is the MSG thread via NotifyPull, the image should have preview image
  * only in NotifyPull.
  *
- * Note: SetBuffer() and GetBuffer() should be called from the same thread. It
- *       is forbidden to call GetBuffer() from other threads.
+ * Note: SetMediaBuffer() and GetMediaBuffer() should be called from the same 
+ *       thread. It is forbidden to call GetMediaBuffer() from other threads.
  */
 class GonkCameraImage : public layers::GrallocImage
 {
 public:
   GonkCameraImage();
 
   // The returned aBuffer has called aBuffer->add_ref() already, so it is caller's
   // duty to release aBuffer. It should be called from the same thread which
-  // called SetBuffer().
-  nsresult GetBuffer(android::MediaBuffer** aBuffer);
+  // called SetMediaBuffer().
+  nsresult GetMediaBuffer(android::MediaBuffer** aBuffer);
 
-  // Set MediaBuffer to image. It is caller's responsibility to call ClearBuffer()
+  // Set MediaBuffer to image. It is caller's responsibility to call ClearMediaBuffer()
   // after the MediaBuffer is sent via MediaStreamGraph.
-  nsresult SetBuffer(android::MediaBuffer* aBuffer);
+  nsresult SetMediaBuffer(android::MediaBuffer* aBuffer);
 
-  // It should be called from the same thread which called SetBuffer().
-  nsresult ClearBuffer();
+  // It should be called from the same thread which called SetMediaBuffer().
+  nsresult ClearMediaBuffer();
 
   bool HasMediaBuffer();
 
 protected:
   virtual ~GonkCameraImage();
 
   // mMonitor protects mMediaBuffer and mThread.
   ReentrantMonitor mMonitor;
   android::MediaBuffer* mMediaBuffer;
-  // Check if current thread is the same one which called SetBuffer().
+  // Check if current thread is the same one which called SetMediaBuffer().
   // It doesn't need to hold reference count.
   DebugOnly<nsIThread*> mThread;
 };
 
 } // namespace mozilla
 
 #endif /* GONKCAMERAIMAGE_H */
--- a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
@@ -796,17 +796,17 @@ MediaEngineGonkVideoSource::OnNewMediaBu
   }
 
   MonitorAutoLock enter(mMonitor);
   if (mImage) {
     if (mImage->AsGrallocImage()) {
       // MediaEngineGonkVideoSource expects that GrallocImage is GonkCameraImage.
       // See Bug 938034.
       GonkCameraImage* cameraImage = static_cast<GonkCameraImage*>(mImage.get());
-      cameraImage->SetBuffer(aBuffer);
+      cameraImage->SetMediaBuffer(aBuffer);
     } else {
       LOG(("mImage is non-GrallocImage"));
     }
 
     uint32_t len = mSources.Length();
     for (uint32_t i = 0; i < len; i++) {
       if (mSources[i]) {
         // Duration is 1 here.
@@ -817,16 +817,16 @@ MediaEngineGonkVideoSource::OnNewMediaBu
         // queued in MSG longer and longer as time going by in device like Frame)
         AppendToTrack(mSources[i], mImage, mTrackID, 1);
       }
     }
     if (mImage->AsGrallocImage()) {
       GonkCameraImage* cameraImage = static_cast<GonkCameraImage*>(mImage.get());
       // Clear MediaBuffer immediately, it prevents MediaBuffer is kept in
       // MediaStreamGraph thread.
-      cameraImage->ClearBuffer();
+      cameraImage->ClearMediaBuffer();
     }
   }
 
   return NS_OK;
 }
 
 } // namespace mozilla
--- a/dom/media/webrtc/MediaEngineGonkVideoSource.h
+++ b/dom/media/webrtc/MediaEngineGonkVideoSource.h
@@ -92,17 +92,17 @@ public:
   nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE;
 
   // It sets the correct photo orientation via camera parameter according to
   // current screen orientation.
   nsresult UpdatePhotoOrientation();
 
   // It adds aBuffer to current preview image and sends this image to MediaStreamDirectListener
   // via AppendToTrack(). Due to MediaBuffer is limited resource, it will clear
-  // image's MediaBuffer by calling GonkCameraImage::ClearBuffer() before leaving
+  // image's MediaBuffer by calling GonkCameraImage::ClearMediaBuffer() before leaving
   // this function.
   nsresult OnNewMediaBufferFrame(android::MediaBuffer* aBuffer);
 
 protected:
   ~MediaEngineGonkVideoSource()
   {
     Shutdown();
   }