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:
mikhal@webrtc.org 2012-10-29 15:59:40 +00:00
parent 6f19b1b651
commit e83d3111d4
6 changed files with 31 additions and 45 deletions

View File

@ -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:

View File

@ -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;
}

View File

@ -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;

View File

@ -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");
}

View File

@ -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,7 +367,6 @@ 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();
@ -385,7 +382,6 @@ void ViECapturer::OnIncomingCapturedEncodedFrame(const WebRtc_Word32 capture_id,
assert(false);
}
encoded_frame_.SwapFrame(video_frame);
}
capture_event_.Set();
return;
}

View File

@ -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);