framerate, GST_TYPE_FRACTION, default 0/1
The framerate of the video 0/1 for variable framerate
+ max-framerate, GST_TYPE_FRACTION, default as framerate
+ For variable framerates this would be the maximum framerate that
+ is expected. This value is only valid when the framerate is 0/1
+
pixel-aspect-ratio, GST_TYPE_FRACTION, default 1/1
The pixel aspect ration of the video
gst_video_info_set_format (info, format, width, height);
if (gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d)) {
+ if (fps_n == 0) {
+ /* variable framerate */
+ info->flags |= GST_VIDEO_FLAG_VARIABLE_FPS;
+ /* see if we have a max-framerate */
+ gst_structure_get_fraction (structure, "max-framerate", &fps_n, &fps_d);
+ }
info->fps_n = fps_n;
info->fps_d = fps_d;
} else {
+ /* unspecified is variable framerate */
info->fps_n = 0;
info->fps_d = 1;
}
"format", G_TYPE_STRING, format,
"width", G_TYPE_INT, info->width,
"height", G_TYPE_INT, info->height,
- "framerate", GST_TYPE_FRACTION, info->fps_n, info->fps_d,
"pixel-aspect-ratio", GST_TYPE_FRACTION, info->par_n, info->par_d, NULL);
if (info->flags & GST_VIDEO_FLAG_INTERLACED)
if (info->views > 1)
gst_caps_set_simple (caps, "views", G_TYPE_INT, info->views, NULL);
+ if (info->flags & GST_VIDEO_FLAG_VARIABLE_FPS && info->fps_n != 0) {
+ /* variable fps with a max-framerate */
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, 0, 1,
+ "max-framerate", GST_TYPE_FRACTION, info->fps_n, info->fps_d, NULL);
+ } else {
+ /* no variable fps or no max-framerate */
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
+ info->fps_n, info->fps_d, NULL);
+ }
+
return caps;
}
* @GST_VIDEO_FLAG_ONEFIELD: one field
* @GST_VIDEO_FLAG_TELECINE: telecine
* @GST_VIDEO_FLAG_PROGRESSIVE: video is progressive
+ * @GST_VIDEO_FLAG_VARIABLE_FPS: a variable fps is selected, fps_n and fps_d
+ * denote the maximum fps of the video
*
* Extra video flags
*/
typedef enum {
- GST_VIDEO_FLAG_NONE = 0,
- GST_VIDEO_FLAG_INTERLACED = (1 << 0),
- GST_VIDEO_FLAG_TFF = (1 << 1),
- GST_VIDEO_FLAG_RFF = (1 << 2),
- GST_VIDEO_FLAG_ONEFIELD = (1 << 3),
- GST_VIDEO_FLAG_TELECINE = (1 << 4),
- GST_VIDEO_FLAG_PROGRESSIVE = (1 << 5)
+ GST_VIDEO_FLAG_NONE = 0,
+ GST_VIDEO_FLAG_INTERLACED = (1 << 0),
+ GST_VIDEO_FLAG_TFF = (1 << 1),
+ GST_VIDEO_FLAG_RFF = (1 << 2),
+ GST_VIDEO_FLAG_ONEFIELD = (1 << 3),
+ GST_VIDEO_FLAG_TELECINE = (1 << 4),
+ GST_VIDEO_FLAG_PROGRESSIVE = (1 << 5),
+ GST_VIDEO_FLAG_VARIABLE_FPS = (1 << 6)
} GstVideoFlags;
/**