void video_demux(mvp_widget_t *widget) { demux_attr_t *attr; attr = demux_get_attr(handle); mvpw_set_graph_current(demux_video, attr->video.stats.cur_bytes); mvpw_expose(demux_video); mvpw_set_graph_current(demux_audio, attr->audio.stats.cur_bytes); mvpw_expose(demux_audio); }
static void fb_osd_update(mvp_widget_t *widget) { av_stc_t stc; char buf[256]; struct stat64 sb; long long offset; int percent; if (fstat64(fd, &sb) < 0) return; av_current_stc(&stc); snprintf(buf, sizeof(buf), "%.2d:%.2d:%.2d", stc.hour, stc.minute, stc.second); mvpw_set_text_str(fb_time, buf); snprintf(buf, sizeof(buf), "Bytes: %lld", (long long)sb.st_size); mvpw_set_text_str(fb_size, buf); offset = lseek(fd, 0, SEEK_CUR); percent = (int)((double)(offset/1000) / (double)(sb.st_size/1000) * 100.0); snprintf(buf, sizeof(buf), "%d%%", percent); mvpw_set_text_str(fb_offset_widget, buf); mvpw_set_graph_current(fb_offset_bar, percent); mvpw_expose(fb_offset_bar); }
void osd_callback(mvp_widget_t *widget) { struct stat64 sb; long long offset = 0; int off, Mb; char buf[32]; av_stc_t stc; demux_attr_t *attr; fstat64(fd, &sb); if (video_functions->seek) offset = video_functions->seek(0, SEEK_CUR); off = (int)((double)(offset/1000) / (double)(sb.st_size/1000) * 100.0); snprintf(buf, sizeof(buf), "%d", off); mvpw_set_text_str(offset_widget, buf); mvpw_set_graph_current(offset_bar, off); attr = demux_get_attr(handle); av_current_stc(&stc); Mb = (attr->Bps * 8) / (1024 * 1024); snprintf(buf, sizeof(buf), "Mbps: %d.%.2d Time: %.2d:%.2d:%.2d", Mb, (attr->Bps * 8) / (1024 * 1024 / 100) - (Mb * 100), stc.hour, stc.minute, stc.second); mvpw_set_text_str(bps_widget, buf); }
void video_progress(mvp_widget_t *widget) { long long offset = 0, size; int off; char buf[32]; if ((size=video_functions->size()) < 0) { disable_osd(); mvpw_hide(osd_widget); mvpw_hide(mute_widget); mvpw_hide(pause_widget); mvpw_hide(ffwd_widget); mvpw_hide(zoom_widget); display_on = 0; zoomed = 0; return; } if (video_functions->seek) offset = video_functions->seek(0, SEEK_CUR); off = (int)((double)(offset/1000) / (double)(size/1000) * 100.0); snprintf(buf, sizeof(buf), "%d%%", off); mvpw_set_text_str(offset_widget, buf); mvpw_set_graph_current(offset_bar, off); mvpw_expose(offset_widget); }