| 228 | |
| 229 | #ifndef HEADLESS |
| 230 | bool FFVideoEncoder::encode(AVFrame * frame) |
| 231 | { |
| 232 | int got_picture = 0; |
| 233 | |
| 234 | int ret = avcodec_encode_video2(pCodecCtx, pkt, frameYUV, &got_picture); |
| 235 | if (ret < 0) { |
| 236 | SIBR_WRG << "[FFMPEG] Failed to encode frame." << std::endl; |
| 237 | return false; |
| 238 | } |
| 239 | if (got_picture == 1) { |
| 240 | pkt->stream_index = video_st->index; |
| 241 | ret = av_write_frame(pFormatCtx, pkt); |
| 242 | av_packet_unref(pkt); |
| 243 | } |
| 244 | |
| 245 | return true; |
| 246 | } |
| 247 | #endif |
| 248 | |
| 249 | } |
no outgoing calls
no test coverage detected