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

Function get_packets

libhb/encavcodec.c:1329–1368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327}
1328
1329static void get_packets( hb_work_object_t * w, hb_buffer_list_t * list )
1330{
1331 hb_work_private_t * pv = w->private_data;
1332
1333 while (1)
1334 {
1335 int ret;
1336 hb_buffer_t * out;
1337
1338 ret = avcodec_receive_packet(pv->context, pv->pkt);
1339 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
1340 {
1341 break;
1342 }
1343 if (ret < 0)
1344 {
1345 hb_log("encavcodec: avcodec_receive_packet failed");
1346 }
1347
1348 out = hb_buffer_init(pv->pkt->size);
1349 memcpy(out->data, pv->pkt->data, out->size);
1350
1351 int64_t frameno = pv->pkt->pts;
1352 out->size = pv->pkt->size;
1353 out->s.start = get_frame_start(pv, frameno);
1354 out->s.duration = get_frame_duration(pv, frameno);
1355 out->s.stop = out->s.stop + out->s.duration;
1356 out->s.frametype = convert_pict_type(pv->pkt, &out->s.flags);
1357
1358 if (out->s.flags & HB_FLAG_FRAMETYPE_KEY)
1359 {
1360 hb_chapter_dequeue(pv->chapter_queue, out);
1361 }
1362
1363 out = process_delay_list(pv, out);
1364
1365 hb_buffer_list_append(list, out);
1366 av_packet_unref(pv->pkt);
1367 }
1368}
1369
1370static void Encode( hb_work_object_t *w, hb_buffer_t **buf_in,
1371 hb_buffer_list_t *list )

Callers 2

EncodeFunction · 0.70
FlushFunction · 0.70

Calls 8

hb_logFunction · 0.85
hb_buffer_initFunction · 0.85
get_frame_startFunction · 0.85
convert_pict_typeFunction · 0.85
hb_chapter_dequeueFunction · 0.85
process_delay_listFunction · 0.85
hb_buffer_list_appendFunction · 0.85
get_frame_durationFunction · 0.70

Tested by

no test coverage detected