Removing codecType from capture API
Review URL: https://webrtc-codereview.appspot.com/964005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3013 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
6f19b1b651
commit
e83d3111d4
@ -133,11 +133,9 @@ class VideoCaptureDataCallback
|
||||
{
|
||||
public:
|
||||
virtual void OnIncomingCapturedFrame(const WebRtc_Word32 id,
|
||||
I420VideoFrame& videoFrame,
|
||||
VideoCodecType codecType) = 0;
|
||||
I420VideoFrame& videoFrame) = 0;
|
||||
virtual void OnIncomingCapturedEncodedFrame(const WebRtc_Word32 id,
|
||||
VideoFrame& videoFrame,
|
||||
VideoCodecType codecType) = 0;
|
||||
VideoFrame& videoFrame) = 0;
|
||||
virtual void OnCaptureDelayChanged(const WebRtc_Word32 id,
|
||||
const WebRtc_Word32 delay) = 0;
|
||||
protected:
|
||||
|
@ -182,7 +182,7 @@ WebRtc_Word32 VideoCaptureImpl::CaptureDelay()
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame&
|
||||
captureFrame, WebRtc_Word64 capture_time, VideoCodecType codec_type) {
|
||||
captureFrame, WebRtc_Word64 capture_time) {
|
||||
UpdateFrameCount(); // frame count used for local frame rate callback.
|
||||
|
||||
const bool callOnCaptureDelayChanged = _setCaptureDelay != _captureDelay;
|
||||
@ -209,15 +209,14 @@ WebRtc_Word32 VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame&
|
||||
if (callOnCaptureDelayChanged) {
|
||||
_dataCallBack->OnCaptureDelayChanged(_id, _captureDelay);
|
||||
}
|
||||
_dataCallBack->OnIncomingCapturedFrame(_id, captureFrame, codec_type);
|
||||
_dataCallBack->OnIncomingCapturedFrame(_id, captureFrame);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureImpl::DeliverEncodedCapturedFrame(
|
||||
VideoFrame& captureFrame, WebRtc_Word64 capture_time,
|
||||
VideoCodecType codec_type) {
|
||||
VideoFrame& captureFrame, WebRtc_Word64 capture_time) {
|
||||
UpdateFrameCount(); // frame count used for local frame rate callback.
|
||||
|
||||
const bool callOnCaptureDelayChanged = _setCaptureDelay != _captureDelay;
|
||||
@ -244,8 +243,7 @@ WebRtc_Word32 VideoCaptureImpl::DeliverEncodedCapturedFrame(
|
||||
if (callOnCaptureDelayChanged) {
|
||||
_dataCallBack->OnCaptureDelayChanged(_id, _captureDelay);
|
||||
}
|
||||
_dataCallBack->OnIncomingCapturedEncodedFrame(_id, captureFrame,
|
||||
codec_type);
|
||||
_dataCallBack->OnIncomingCapturedEncodedFrame(_id, captureFrame);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -309,7 +307,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
||||
frameInfo.rawType);
|
||||
return -1;
|
||||
}
|
||||
DeliverCapturedFrame(_captureFrame, captureTime, frameInfo.codecType);
|
||||
DeliverCapturedFrame(_captureFrame, captureTime);
|
||||
}
|
||||
else // Encoded format
|
||||
{
|
||||
@ -319,8 +317,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
||||
"Failed to copy captured frame of length %d",
|
||||
static_cast<int>(videoFrameLength));
|
||||
}
|
||||
DeliverEncodedCapturedFrame(_capture_encoded_frame, captureTime,
|
||||
frameInfo.codecType);
|
||||
DeliverEncodedCapturedFrame(_capture_encoded_frame, captureTime);
|
||||
}
|
||||
|
||||
const WebRtc_UWord32 processTime =
|
||||
@ -356,7 +353,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420(
|
||||
return -1;
|
||||
}
|
||||
|
||||
DeliverCapturedFrame(_captureFrame, captureTime, kVideoCodecUnknown);
|
||||
DeliverCapturedFrame(_captureFrame, captureTime);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -100,11 +100,10 @@ protected:
|
||||
virtual ~VideoCaptureImpl();
|
||||
// TODO(mikhal): Remove codec_type.
|
||||
WebRtc_Word32 DeliverCapturedFrame(I420VideoFrame& captureFrame,
|
||||
WebRtc_Word64 capture_time,
|
||||
VideoCodecType codec_type);
|
||||
WebRtc_Word64 capture_time);
|
||||
WebRtc_Word32 DeliverEncodedCapturedFrame(
|
||||
VideoFrame& captureFrame,
|
||||
WebRtc_Word64 capture_time, VideoCodecType codec_type);
|
||||
WebRtc_Word64 capture_time);
|
||||
|
||||
WebRtc_Word32 _id; // Module ID
|
||||
char* _deviceUniqueId; // current Device unique name;
|
||||
|
@ -154,8 +154,7 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
|
||||
}
|
||||
|
||||
virtual void OnIncomingCapturedFrame(const WebRtc_Word32 id,
|
||||
webrtc::I420VideoFrame& videoFrame,
|
||||
webrtc::VideoCodecType codecType) {
|
||||
webrtc::I420VideoFrame& videoFrame) {
|
||||
CriticalSectionScoped cs(capture_cs_.get());
|
||||
|
||||
int height = videoFrame.height();
|
||||
@ -181,8 +180,7 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
|
||||
last_frame_.CopyFrame(videoFrame);
|
||||
}
|
||||
virtual void OnIncomingCapturedEncodedFrame(const WebRtc_Word32 id,
|
||||
webrtc::VideoFrame& videoFrame,
|
||||
webrtc::VideoCodecType codecType)
|
||||
webrtc::VideoFrame& videoFrame)
|
||||
{
|
||||
assert(!"NOTIMPLEMENTED");
|
||||
}
|
||||
|
@ -345,8 +345,7 @@ int ViECapturer::IncomingFrameI420(const ViEVideoFrameI420& video_frame,
|
||||
}
|
||||
|
||||
void ViECapturer::OnIncomingCapturedFrame(const WebRtc_Word32 capture_id,
|
||||
I420VideoFrame& video_frame,
|
||||
VideoCodecType codec_type) {
|
||||
I420VideoFrame& video_frame) {
|
||||
WEBRTC_TRACE(kTraceStream, kTraceVideo, ViEId(engine_id_, capture_id_),
|
||||
"%s(capture_id: %d)", __FUNCTION__, capture_id);
|
||||
CriticalSectionScoped cs(capture_cs_.get());
|
||||
@ -360,8 +359,7 @@ void ViECapturer::OnIncomingCapturedFrame(const WebRtc_Word32 capture_id,
|
||||
}
|
||||
|
||||
void ViECapturer::OnIncomingCapturedEncodedFrame(const WebRtc_Word32 capture_id,
|
||||
VideoFrame& video_frame,
|
||||
VideoCodecType codec_type) {
|
||||
VideoFrame& video_frame) {
|
||||
WEBRTC_TRACE(kTraceStream, kTraceVideo, ViEId(engine_id_, capture_id_),
|
||||
"%s(capture_id: %d)", __FUNCTION__, capture_id);
|
||||
CriticalSectionScoped cs(capture_cs_.get());
|
||||
@ -369,23 +367,21 @@ void ViECapturer::OnIncomingCapturedEncodedFrame(const WebRtc_Word32 capture_id,
|
||||
// is slightly off since it's being set when the frame has been received from
|
||||
// the camera, and not when the camera actually captured the frame.
|
||||
video_frame.SetRenderTime(video_frame.RenderTimeMs() - FrameDelay());
|
||||
if (codec_type != kVideoCodecUnknown) {
|
||||
if (encoded_frame_.Length() != 0) {
|
||||
// The last encoded frame has not been sent yet. Need to wait.
|
||||
deliver_event_.Reset();
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, capture_id_),
|
||||
"%s(capture_id: %d) Last encoded frame not yet delivered.",
|
||||
__FUNCTION__, capture_id);
|
||||
capture_cs_->Leave();
|
||||
// Wait for the coded frame to be sent before unblocking this.
|
||||
deliver_event_.Wait(kMaxDeliverWaitTime);
|
||||
assert(encoded_frame_.Length() == 0);
|
||||
capture_cs_->Enter();
|
||||
} else {
|
||||
assert(false);
|
||||
}
|
||||
encoded_frame_.SwapFrame(video_frame);
|
||||
if (encoded_frame_.Length() != 0) {
|
||||
// The last encoded frame has not been sent yet. Need to wait.
|
||||
deliver_event_.Reset();
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, capture_id_),
|
||||
"%s(capture_id: %d) Last encoded frame not yet delivered.",
|
||||
__FUNCTION__, capture_id);
|
||||
capture_cs_->Leave();
|
||||
// Wait for the coded frame to be sent before unblocking this.
|
||||
deliver_event_.Wait(kMaxDeliverWaitTime);
|
||||
assert(encoded_frame_.Length() == 0);
|
||||
capture_cs_->Enter();
|
||||
} else {
|
||||
assert(false);
|
||||
}
|
||||
encoded_frame_.SwapFrame(video_frame);
|
||||
capture_event_.Set();
|
||||
return;
|
||||
}
|
||||
|
@ -116,11 +116,9 @@ class ViECapturer
|
||||
|
||||
// Implements VideoCaptureDataCallback.
|
||||
virtual void OnIncomingCapturedFrame(const WebRtc_Word32 id,
|
||||
I420VideoFrame& video_frame,
|
||||
VideoCodecType codec_type);
|
||||
I420VideoFrame& video_frame);
|
||||
virtual void OnIncomingCapturedEncodedFrame(const WebRtc_Word32 capture_id,
|
||||
VideoFrame& video_frame,
|
||||
VideoCodecType codec_type);
|
||||
VideoFrame& video_frame);
|
||||
virtual void OnCaptureDelayChanged(const WebRtc_Word32 id,
|
||||
const WebRtc_Word32 delay);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user