зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376873 - Update WebrtcMediaCodecVP8VideoCodec; r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D7451 --HG-- extra : rebase_source : e39a235884d1a60ff75eba66dc8fc9e3dde2f5f1
This commit is contained in:
Родитель
a4bb9e371c
Коммит
af9ad6b69a
|
@ -24,7 +24,6 @@
|
|||
#include "libyuv/row.h"
|
||||
|
||||
#include "webrtc/modules/video_coding/include/video_error_codes.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
#include "webrtc/api/video/i420_buffer.h"
|
||||
#include <webrtc/common_video/libyuv/include/webrtc_libyuv.h>
|
||||
|
@ -49,7 +48,6 @@ class CallbacksSupport final : public JavaCallbacksSupport
|
|||
public:
|
||||
explicit CallbacksSupport(webrtc::EncodedImageCallback* aCallback)
|
||||
: mCallback(aCallback)
|
||||
, mCritSect(webrtc::CriticalSectionWrapper::CreateCriticalSection())
|
||||
, mPictureId(0) {
|
||||
CSFLogDebug(LOGTAG, "%s %p", __FUNCTION__, this);
|
||||
memset(&mEncodedImage, 0, sizeof(mEncodedImage));
|
||||
|
@ -100,7 +98,7 @@ public:
|
|||
MOZ_RELEASE_ASSERT(ok);
|
||||
|
||||
if (size > 0) {
|
||||
webrtc::CriticalSectionScoped lock(mCritSect.get());
|
||||
rtc::CritScope lock(&mCritSect);
|
||||
VerifyAndAllocate(size);
|
||||
|
||||
int64_t presentationTimeUs;
|
||||
|
@ -156,7 +154,7 @@ private:
|
|||
webrtc::EncodedImageCallback* mCallback;
|
||||
Atomic<bool> mCanceled;
|
||||
webrtc::EncodedImage mEncodedImage;
|
||||
std::unique_ptr<webrtc::CriticalSectionWrapper> mCritSect;
|
||||
rtc::CriticalSection mCritSect;
|
||||
uint32_t mPictureId;
|
||||
};
|
||||
|
||||
|
@ -671,7 +669,7 @@ class OutputDrain : public MediaCodecOutputDrain
|
|||
};
|
||||
|
||||
static bool I420toNV12(uint8_t* dstY, uint16_t* dstUV, const webrtc::VideoFrame& inputImage) {
|
||||
rtc::scoped_refptr<webrtc::VideoFrameBuffer> inputBuffer = inputImage.video_frame_buffer();
|
||||
rtc::scoped_refptr<webrtc::I420BufferInterface> inputBuffer = inputImage.video_frame_buffer()->GetI420();
|
||||
|
||||
uint8_t* buffer = dstY;
|
||||
uint8_t* dst_y = buffer;
|
||||
|
@ -807,7 +805,7 @@ int32_t WebrtcMediaCodecVP8VideoEncoder::Encode(
|
|||
uint32_t time = PR_IntervalNow();
|
||||
#endif
|
||||
|
||||
rtc::scoped_refptr<webrtc::VideoFrameBuffer> inputBuffer = inputImage.video_frame_buffer();
|
||||
rtc::scoped_refptr<webrtc::I420BufferInterface> inputBuffer = inputImage.video_frame_buffer()->GetI420();
|
||||
size_t sizeY = inputImage.height() * inputBuffer->StrideY();
|
||||
size_t sizeUV = ((inputImage.height() + 1)/2) * inputBuffer->StrideU();
|
||||
size_t size = sizeY + 2 * sizeUV;
|
||||
|
@ -1049,7 +1047,7 @@ int32_t WebrtcMediaCodecVP8VideoRemoteEncoder::Encode(
|
|||
}
|
||||
}
|
||||
|
||||
rtc::scoped_refptr<webrtc::VideoFrameBuffer> inputBuffer = inputImage.video_frame_buffer();
|
||||
rtc::scoped_refptr<webrtc::I420BufferInterface> inputBuffer = inputImage.video_frame_buffer()->GetI420();
|
||||
size_t sizeY = inputImage.height() * inputBuffer->StrideY();
|
||||
size_t sizeUV = ((inputImage.height() + 1)/2) * inputBuffer->StrideU();
|
||||
size_t size = sizeY + 2 * sizeUV;
|
||||
|
|
Загрузка…
Ссылка в новой задаче