MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / encavcodecWork

Function encavcodecWork

libhb/encavcodec.c:1470–1496  ·  view source on GitHub ↗

* Work *********************************************************************** * **********************************************************************/

Source from the content-addressed store, hash-verified

1468 *
1469 **********************************************************************/
1470int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
1471 hb_buffer_t ** buf_out )
1472{
1473 hb_work_private_t * pv = w->private_data;
1474 hb_buffer_t * in = *buf_in;
1475 hb_buffer_list_t list;
1476
1477 if (pv->context == NULL || pv->context->codec == NULL)
1478 {
1479 hb_error("encavcodec: codec context is uninitialized");
1480 return HB_WORK_DONE;
1481 }
1482
1483 hb_buffer_list_clear(&list);
1484 if (in->s.flags & HB_BUF_FLAG_EOF)
1485 {
1486 Flush(w, &list);
1487 hb_buffer_list_append(&list, hb_buffer_eof_init());
1488 *buf_out = hb_buffer_list_clear(&list);
1489 return HB_WORK_DONE;
1490 }
1491
1492 Encode(w, buf_in, &list);
1493 *buf_out = hb_buffer_list_clear(&list);
1494
1495 return HB_WORK_OK;
1496}
1497
1498/**
1499 * Encoder options and presets

Callers

nothing calls this directly

Calls 6

hb_errorFunction · 0.85
hb_buffer_list_clearFunction · 0.85
hb_buffer_list_appendFunction · 0.85
hb_buffer_eof_initFunction · 0.85
FlushFunction · 0.70
EncodeFunction · 0.70

Tested by

no test coverage detected