| 30 | { |
| 31 | |
| 32 | void video_encoder_x264::ProcessCb(x264_t * h, x264_nal_t * nal, void * opaque) |
| 33 | { |
| 34 | video_encoder_x264 * self = (video_encoder_x264 *)opaque; |
| 35 | std::vector<uint8_t> data(nal->i_payload * 3 / 2 + 5 + 64, 0); |
| 36 | x264_nal_encode(h, data.data(), nal); |
| 37 | data.resize(nal->i_payload); |
| 38 | switch (nal->i_type) |
| 39 | { |
| 40 | case NAL_SPS: |
| 41 | case NAL_PPS: { |
| 42 | self->SendData(data, false, self->control); |
| 43 | break; |
| 44 | } |
| 45 | case NAL_SLICE: |
| 46 | case NAL_SLICE_DPA: |
| 47 | case NAL_SLICE_DPB: |
| 48 | case NAL_SLICE_DPC: |
| 49 | case NAL_SLICE_IDR: |
| 50 | self->ProcessNal({nal->i_first_mb, nal->i_last_mb, std::move(data)}); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | void video_encoder_x264::ProcessNal(pending_nal && nal) |
| 55 | { |
nothing calls this directly
no test coverage detected