Bug 1073003 - Additional Werror bustage fixes in newly added webrtc code. r=bustage

--HG--
extra : rebase_source : bdf0d3d341a42608366912243c1e1cc9fd398b0c
This commit is contained in:
Botond Ballo 2014-12-22 22:23:51 -05:00
parent 387ccf2fbe
commit ac92460241
4 changed files with 18 additions and 17 deletions

View File

@ -26,7 +26,7 @@ GonkCameraImage::~GonkCameraImage()
}
nsresult
GonkCameraImage::GetBuffer(android::MediaBuffer** aBuffer)
GonkCameraImage::GetMediaBuffer(android::MediaBuffer** aBuffer)
{
ReentrantMonitorAutoEnter mon(mMonitor);
@ -50,7 +50,7 @@ GonkCameraImage::HasMediaBuffer()
}
nsresult
GonkCameraImage::SetBuffer(android::MediaBuffer* aBuffer)
GonkCameraImage::SetMediaBuffer(android::MediaBuffer* aBuffer)
{
ReentrantMonitorAutoEnter mon(mMonitor);
MOZ_ASSERT(!mMediaBuffer);
@ -63,7 +63,7 @@ GonkCameraImage::SetBuffer(android::MediaBuffer* aBuffer)
}
nsresult
GonkCameraImage::ClearBuffer()
GonkCameraImage::ClearMediaBuffer()
{
ReentrantMonitorAutoEnter mon(mMonitor);

View File

@ -24,8 +24,8 @@ namespace mozilla {
* 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
@ -37,8 +37,8 @@ namespace mozilla {
* 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
{
@ -47,15 +47,15 @@ public:
// 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();
@ -65,7 +65,7 @@ protected:
// 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;
};

View File

@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MediaEngineGonkVideoSource.h"
#undef LOG_TAG
#define LOG_TAG "MediaEngineGonkVideoSource"
#include <utils/Log.h>
@ -803,7 +804,7 @@ MediaEngineGonkVideoSource::OnNewMediaBufferFrame(MediaBuffer* aBuffer)
// 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"));
}
@ -824,7 +825,7 @@ MediaEngineGonkVideoSource::OnNewMediaBufferFrame(MediaBuffer* aBuffer)
GonkCameraImage* cameraImage = static_cast<GonkCameraImage*>(mImage.get());
// Clear MediaBuffer immediately, it prevents MediaBuffer is kept in
// MediaStreamGraph thread.
cameraImage->ClearBuffer();
cameraImage->ClearMediaBuffer();
}
}

View File

@ -98,7 +98,7 @@ public:
// 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);