MCPcopy Create free account
hub / github.com/apache/nuttx / sim_decoder_process

Function sim_decoder_process

arch/sim/src/sim/sim_decoder.c:394–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394static int sim_decoder_process(sim_decoder_t *sim_decoder,
395 struct v4l2_buffer *dst_buf,
396 struct v4l2_buffer *src_buf)
397{
398 struct v4l2_event event;
399 uint8_t *src_data = NULL;
400 uint32_t src_size = 0;
401 int64_t src_pts = 0;
402 int64_t dst_pts = 0;
403 int ret;
404
405 if (src_buf != NULL)
406 {
407 src_data = (uint8_t *)src_buf->m.userptr;
408 src_size = src_buf->bytesused;
409 src_pts = src_buf->timestamp.tv_sec * 1000000 +
410 src_buf->timestamp.tv_usec;
411 }
412
413 ret = openh264_decoder_enqueue(sim_decoder->decoder,
414 src_data, src_pts, src_size);
415 if (ret >= 0 && src_buf != NULL)
416 {
417 codec_output_put_buf(sim_decoder->cookie, src_buf);
418 }
419
420 if (ret < 1)
421 {
422 return ret;
423 }
424
425 ret = openh264_decoder_dequeue(sim_decoder->decoder,
426 (uint8_t *)dst_buf->m.userptr,
427 &dst_pts,
428 &dst_buf->bytesused);
429 if (ret == 0 && src_buf == NULL)
430 {
431 sim_decoder->flushing = false;
432 dst_buf->flags |= V4L2_BUF_FLAG_LAST;
433
434 memset(&event, 0, sizeof(event));
435 event.type = V4L2_EVENT_EOS;
436 codec_queue_event(sim_decoder->cookie, &event);
437 }
438
439 dst_buf->timestamp.tv_usec = dst_pts % 1000000;
440 dst_buf->timestamp.tv_sec = dst_pts / 1000000;
441
442 codec_capture_put_buf(sim_decoder->cookie, dst_buf);
443 return ret;
444}
445
446static void sim_decoder_work(void *decoder)
447{

Callers 1

sim_decoder_workFunction · 0.85

Calls 6

openh264_decoder_enqueueFunction · 0.85
codec_output_put_bufFunction · 0.85
openh264_decoder_dequeueFunction · 0.85
codec_queue_eventFunction · 0.85
codec_capture_put_bufFunction · 0.85
memsetFunction · 0.50

Tested by

no test coverage detected