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

Function ghb_update_title_info

gtk/src/callbacks.c:2199–2302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197}
2198
2199void
2200ghb_update_title_info(signal_user_data_t *ud)
2201{
2202 GtkWidget * widget;
2203 GString * info;
2204 gchar * text;
2205 gchar * aspect;
2206 int title_id, titleindex;
2207 int audio_count, subtitle_count;
2208 const hb_title_t * title;
2209 const hb_geometry_t * geo;
2210 gint aspect_n, aspect_d;
2211
2212 title_id = ghb_dict_get_int(ud->settings, "title");
2213 title = ghb_lookup_title(title_id, &titleindex);
2214 if (title == NULL)
2215 return;
2216
2217 update_title_duration(ud);
2218
2219 geo = &title->geometry;
2220 hb_reduce(&aspect_n, &aspect_d, geo->width * geo->par.num,
2221 geo->height * geo->par.den);
2222 aspect = get_aspect_string(aspect_n, aspect_d);
2223 audio_count = hb_list_count(title->list_audio);
2224 subtitle_count = hb_list_count(title->list_subtitle);
2225
2226 info = g_string_sized_new(256);
2227
2228 g_string_append_printf(info, ", %dx%d", geo->width, geo->height);
2229 int screen_width = geo->width * geo->par.num / geo->par.den;
2230 if (geo->width != screen_width)
2231 g_string_append_printf(info, " (%dx%d)", screen_width, geo->height);
2232
2233 g_string_append_printf(info, ", %s, %.6g %s, ", aspect,
2234 (double) title->vrate.num / title->vrate.den,
2235 _("FPS"));
2236
2237 if (title->dovi.dv_profile)
2238 {
2239 g_string_append_printf(info, _("Dolby Vision %d.%d"),
2240 title->dovi.dv_profile,
2241 title->dovi.dv_bl_signal_compatibility_id);
2242 if (title->hdr_10_plus)
2243 g_string_append_printf(info, " %s", _("HDR10+"));
2244 }
2245 else if (title->hdr_10_plus)
2246 g_string_append(info, _("HDR10+"));
2247 else if (title->mastering.has_primaries && title->mastering.has_luminance)
2248 g_string_append(info, _("HDR10"));
2249 else if (title->color_transfer == 16 || title->color_transfer == 18)
2250 g_string_append(info, _("HDR"));
2251 else
2252 g_string_append(info, _("SDR"));
2253
2254 g_string_append(info, " (");
2255
2256 int bit_depth = hb_get_bit_depth(title->pix_fmt);

Callers 1

ghb_load_post_settingsFunction · 0.85

Calls 11

ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
update_title_durationFunction · 0.85
hb_reduceFunction · 0.85
get_aspect_stringFunction · 0.85
hb_list_countFunction · 0.85
hb_get_bit_depthFunction · 0.85
hb_get_chroma_sub_sampleFunction · 0.85
ghb_builder_widgetFunction · 0.85
ghb_ui_updateFunction · 0.85
ghb_string_valueFunction · 0.85

Tested by

no test coverage detected