Bug 879668 - Part 1: Make CreateMutedFrame static. r=roc

This commit is contained in:
Shelly Lin 2013-12-03 17:50:48 +08:00
parent 8147ef5734
commit 17bb66b11d
2 changed files with 11 additions and 8 deletions

View File

@ -208,13 +208,15 @@ VideoTrackEncoder::NotifyEndOfStream()
mReentrantMonitor.NotifyAll();
}
/* static */
void
VideoTrackEncoder::CreateMutedFrame(nsTArray<uint8_t>* aOutputBuffer)
VideoTrackEncoder::CreateMutedFrame(nsTArray<uint8_t>* aOutputBuffer,
int aFrameWidth, int aFrameHeight)
{
NS_ENSURE_TRUE_VOID(aOutputBuffer);
// Supports YUV420 image format only.
int yPlaneLen = mFrameWidth * mFrameHeight;
int yPlaneLen = aFrameWidth * aFrameHeight;
int cbcrPlaneLen = yPlaneLen / 2;
int frameLen = yPlaneLen + cbcrPlaneLen;

View File

@ -229,6 +229,13 @@ public:
uint32_t aTrackEvents,
const MediaSegment& aQueuedMedia) MOZ_OVERRIDE;
/**
* Create a buffer of black image in format of YUV:420. Called on the worker
* thread.
*/
static void CreateMutedFrame(nsTArray<uint8_t>* aOutputBuffer,
int aFrameWidth, int aFrameHeight);
protected:
/**
* Initialized the video encoder. In order to collect the value of width and
@ -252,12 +259,6 @@ protected:
*/
virtual void NotifyEndOfStream() MOZ_OVERRIDE;
/**
* Create a buffer of black image in format of YUV:420. Called on the worker
* thread.
*/
void CreateMutedFrame(nsTArray<uint8_t>* aOutputBuffer);
/**
* The width of source video frame, ceiled if the source width is odd.
*/