static int
fill_planes (GstVideoInfo * info)
{
- gint width, height;
+ gsize width, height;
- width = info->width;
- height = info->height;
+ width = (gsize) info->width;
+ height = (gsize) info->height;
switch (info->finfo->format) {
case GST_VIDEO_FORMAT_YUY2:
GstFormat dest_format, gint64 * dest_value)
{
gboolean ret = FALSE;
- int size, fps_n, fps_d;
+ int fps_n, fps_d;
+ gsize size;
g_return_val_if_fail (info != NULL, 0);
g_return_val_if_fail (info->finfo != NULL, 0);
/* bytes to frames */
if (src_format == GST_FORMAT_BYTES && dest_format == GST_FORMAT_DEFAULT) {
if (size != 0) {
- *dest_value = gst_util_uint64_scale_int (src_value, 1, size);
+ *dest_value = gst_util_uint64_scale (src_value, 1, size);
} else {
GST_ERROR ("blocksize is 0");
*dest_value = 0;
/* frames to bytes */
if (src_format == GST_FORMAT_DEFAULT && dest_format == GST_FORMAT_BYTES) {
- *dest_value = gst_util_uint64_scale_int (src_value, size, 1);
+ *dest_value = gst_util_uint64_scale (src_value, size, 1);
ret = TRUE;
goto done;
}
GST_END_TEST;
+
+GST_START_TEST (test_video_formats_rgba_large_dimension)
+{
+ GstVideoInfo vinfo;
+ gint width, height, framerate_n, framerate_d, par_n, par_d;
+ GstCaps *caps;
+ GstStructure *structure;
+
+ gst_video_info_init (&vinfo);
+ gst_video_info_set_format (&vinfo, GST_VIDEO_FORMAT_RGBA, 29700, 21000);
+ vinfo.par_n = 1;
+ vinfo.par_d = 1;
+ vinfo.fps_n = 0;
+ vinfo.fps_d = 1;
+ caps = gst_video_info_to_caps (&vinfo);
+ structure = gst_caps_get_structure (caps, 0);
+
+ fail_unless (gst_structure_get_int (structure, "width", &width));
+ fail_unless (gst_structure_get_int (structure, "height", &height));
+ fail_unless (gst_structure_get_fraction (structure, "framerate", &framerate_n,
+ &framerate_d));
+ fail_unless (gst_structure_get_fraction (structure, "pixel-aspect-ratio",
+ &par_n, &par_d));
+
+ fail_unless (width == 29700);
+ fail_unless (height == 21000);
+ fail_unless (framerate_n == 0);
+ fail_unless (framerate_d == 1);
+ fail_unless (par_n == 1);
+ fail_unless (par_d == 1);
+ fail_unless (vinfo.size == (gsize) 29700 * 21000 * 4);
+
+ gst_caps_unref (caps);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_dar_calc)
{
guint display_ratio_n, display_ratio_d;
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_video_formats);
tcase_add_test (tc_chain, test_video_formats_rgb);
+ tcase_add_test (tc_chain, test_video_formats_rgba_large_dimension);
tcase_add_test (tc_chain, test_video_formats_all);
tcase_add_test (tc_chain, test_video_formats_pack_unpack);
tcase_add_test (tc_chain, test_dar_calc);