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

Function encavcodecInit

libhb/encavcodec.c:267–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265};
266
267int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
268{
269 int ret = 0;
270 char reason[80];
271 char * codec_name = NULL;
272 const AVCodec * codec = NULL;
273 AVCodecContext * context;
274 AVRational fps;
275 AVDictionary *av_opts = NULL;
276 const AVRational *frame_rates = NULL;
277
278 hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) );
279 w->private_data = pv;
280 pv->job = job;
281 pv->chapter_queue = hb_chapter_queue_init();
282 pv->pkt = av_packet_alloc();
283
284 if (pv->pkt == NULL)
285 {
286 hb_log("encavcodecInit: av_packet_alloc failed");
287 ret = 1;
288 goto done;
289 }
290
291 hb_buffer_list_clear(&pv->delay_list);
292
293 int clock_min, clock_max, clock;
294 hb_video_framerate_get_limits(&clock_min, &clock_max, &clock);
295
296 switch ( w->codec_param )
297 {
298 case AV_CODEC_ID_MPEG4:
299 {
300 hb_log("encavcodecInit: MPEG-4 ASP encoder");
301 codec_name = "mpeg4";
302 } break;
303 case AV_CODEC_ID_MPEG2VIDEO:
304 {
305 hb_log("encavcodecInit: MPEG-2 encoder");
306 codec_name = "mpeg2video";
307 } break;
308 case AV_CODEC_ID_VP8:
309 {
310 hb_log("encavcodecInit: VP8 encoder");
311 codec_name = "libvpx";
312 } break;
313 case AV_CODEC_ID_VP9:
314 {
315 hb_log("encavcodecInit: VP9 encoder");
316 codec_name = "libvpx-vp9";
317 } break;
318 case AV_CODEC_ID_H264:
319 {
320 switch (job->vcodec) {
321 case HB_VCODEC_FFMPEG_NVENC_H264:
322 hb_log("encavcodecInit: H.264 (Nvidia NVENC)");
323 codec_name = "h264_nvenc";
324 break;

Callers

nothing calls this directly

Calls 15

hb_chapter_queue_initFunction · 0.85
hb_logFunction · 0.85
hb_buffer_list_clearFunction · 0.85
hb_reduceFunction · 0.85
apply_encoder_levelFunction · 0.85
apply_encoder_presetFunction · 0.85
apply_encoder_tuneFunction · 0.85
apply_encoder_optionsFunction · 0.85

Tested by

no test coverage detected