Problem with cricket::CapturedFrame

15 views
Skip to first unread message

yihungbakj hung

unread,
Mar 21, 2018, 9:18:42 PM3/21/18
to discuss-webrtc
Hi All

I'm currently trying to port this to newer versions of the library (M59).

The biggest obstacle seems to be that cricket::CapturedFrame was removed in commit f5297a019ea6de709a2bb94793d637bb44538931 (https://codereview.webrtc.org/2262443003/).

I can't really find any talk about what replaces it.

Do you happen to have anything to point me in the right direction?

Thank you.

yh

Here is my code:

bool QueueVideoCapturer::CaptureCustomFrame(const shared_ptr<CaptureFrame>& cf) {

if (!running_) {
return false;
}

int width = GetCaptureFormat()->width;
int height = GetCaptureFormat()->height;
int fourcc = GetCaptureFormat()->fourcc;

if(cf) {
if(start_rtc_timestamp==-1) {
start_rtc_timestamp = cf->rtc_timestamp;
}

// Currently, |fourcc| is always I420 or ARGB.
// TODO(fbarchard): Extend SizeOf to take fourcc.
uint32_t size = 0u;
if (fourcc == cricket::FOURCC_ARGB) {
size = width * 4 * height;
} else if (fourcc == cricket::FOURCC_I420) {
size = FrameSizeOf(width, height);
} else {
return false; // Unsupported FOURCC.
}
if (size == 0u) {
return false; // Width and/or Height were zero.
}

cricket::CapturedFrame frame;
frame.width = cf->width;
frame.height = cf->height;
frame.fourcc = fourcc;
frame.data_size = cf->frame_size;
// frame.elapsed_time = (cf->rtc_timestamp - start_rtc_timestamp) * 1000;
frame.time_stamp = cf->rtc_timestamp * 1000;//webrtc::TickTime::MicrosecondTimestamp()*1000;
frame.data = cf->frame.get_data();
SignalFrameCaptured(this, &frame);
}
return true;
}

Reply all
Reply to author
Forward
0 new messages