| 794 | } |
| 795 | |
| 796 | int 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 | |
| 829 | const char* hb_x265_encopt_name(const char *name) |
| 830 | { |
nothing calls this directly
no test coverage detected