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

Function encx265Work

libhb/encx265.c:796–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796int encx265Work(hb_work_object_t *w, hb_buffer_t **buf_in, hb_buffer_t **buf_out)
797{
798 hb_work_private_t *pv = w->private_data;
799 hb_buffer_t *in = *buf_in;
800
801 if (in->s.flags & HB_BUF_FLAG_EOF)
802 {
803 uint32_t nnal;
804 x265_nal *nal;
805 x265_picture pic_out;
806 hb_buffer_list_t list;
807
808 hb_buffer_list_clear(&list);
809
810 // flush delayed frames
811 while (pv->api->encoder_encode(pv->x265, &nal,
812 &nnal, NULL, &pic_out) > 0)
813 {
814 hb_buffer_t *buf = nal_encode(w, &pic_out, nal, nnal);
815 hb_buffer_list_append(&list, buf);
816 }
817 // add the EOF to the end of the chain
818 hb_buffer_list_append(&list, in);
819
820 *buf_out = hb_buffer_list_clear(&list);
821 *buf_in = NULL;
822 return HB_WORK_DONE;
823 }
824
825 *buf_out = x265_encode(w, in);
826 return HB_WORK_OK;
827}
828
829const char* hb_x265_encopt_name(const char *name)
830{

Callers

nothing calls this directly

Calls 4

hb_buffer_list_clearFunction · 0.85
hb_buffer_list_appendFunction · 0.85
x265_encodeFunction · 0.85
nal_encodeFunction · 0.70

Tested by

no test coverage detected