MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / sub2video_update

Function sub2video_update

ffmpeg-single-cmd/src/main/cpp/ffmpeg_mod.c:232–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void sub2video_update(InputStream *ist, AVSubtitle *sub)
233{
234 AVFrame *frame = ist->sub2video.frame;
235 int8_t *dst;
236 int dst_linesize;
237 int num_rects, i;
238 int64_t pts, end_pts;
239
240 if (!frame)
241 return;
242 if (sub) {
243 pts = av_rescale_q(sub->pts + sub->start_display_time * 1000LL,
244 AV_TIME_BASE_Q, ist->st->time_base);
245 end_pts = av_rescale_q(sub->pts + sub->end_display_time * 1000LL,
246 AV_TIME_BASE_Q, ist->st->time_base);
247 num_rects = sub->num_rects;
248 } else {
249 pts = ist->sub2video.end_pts;
250 end_pts = INT64_MAX;
251 num_rects = 0;
252 }
253 if (sub2video_get_blank_frame(ist) < 0) {
254 av_log(ist->dec_ctx, AV_LOG_ERROR,
255 "Impossible to get a blank canvas.\n");
256 return;
257 }
258 dst = frame->data [0];
259 dst_linesize = frame->linesize[0];
260 for (i = 0; i < num_rects; i++)
261 sub2video_copy_rect(dst, dst_linesize, frame->width, frame->height, sub->rects[i]);
262 sub2video_push_ref(ist, pts);
263 ist->sub2video.end_pts = end_pts;
264}
265
266static void sub2video_heartbeat(InputStream *ist, int64_t pts)
267{

Callers 4

configure_filtergraphFunction · 0.85
sub2video_heartbeatFunction · 0.85
sub2video_flushFunction · 0.85
transcode_subtitlesFunction · 0.85

Calls 3

sub2video_copy_rectFunction · 0.85
sub2video_push_refFunction · 0.85

Tested by

no test coverage detected