mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
ges: Set default caps for GESVideoTrack
By default, video track output full HD@30fps, this makes the behaviour of clip position much more understandable and guarantess that we always have a framerate. The user can modify the values whenever he wants
This commit is contained in:
parent
df6058c802
commit
221353e75c
2 changed files with 22 additions and 0 deletions
|
@ -61,6 +61,11 @@ GstDebugCategory * _ges_debug (void);
|
||||||
#define _set_duration0 ges_timeline_element_set_duration
|
#define _set_duration0 ges_timeline_element_set_duration
|
||||||
#define _set_priority0 ges_timeline_element_set_priority
|
#define _set_priority0 ges_timeline_element_set_priority
|
||||||
|
|
||||||
|
#define DEFAULT_FRAMERATE_N 30
|
||||||
|
#define DEFAULT_FRAMERATE_D 1
|
||||||
|
#define DEFAULT_WIDTH 1280
|
||||||
|
#define DEFAULT_HEIGHT 720
|
||||||
|
|
||||||
#define GES_TIMELINE_ELEMENT_FORMAT \
|
#define GES_TIMELINE_ELEMENT_FORMAT \
|
||||||
"s<%p>" \
|
"s<%p>" \
|
||||||
" [ %" GST_TIME_FORMAT \
|
" [ %" GST_TIME_FORMAT \
|
||||||
|
|
|
@ -21,6 +21,17 @@
|
||||||
* SECTION: gesvideotrack
|
* SECTION: gesvideotrack
|
||||||
* @title: GESVideoTrack
|
* @title: GESVideoTrack
|
||||||
* @short_description: A standard GESTrack for raw video
|
* @short_description: A standard GESTrack for raw video
|
||||||
|
*
|
||||||
|
* Sane default properties to specify and fixate the output stream are
|
||||||
|
* set as restriction-caps.
|
||||||
|
* It is advised, to modify these properties, to use
|
||||||
|
* #ges_track_update_restriction_caps, setting them directly is
|
||||||
|
* possible through #ges_track_set_restriction_caps.
|
||||||
|
*
|
||||||
|
* The default properties are:
|
||||||
|
* - width: 1920
|
||||||
|
* - height: 1080
|
||||||
|
* - framerate: 30/1
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -28,6 +39,9 @@
|
||||||
|
|
||||||
#include "ges-video-track.h"
|
#include "ges-video-track.h"
|
||||||
#include "ges-smart-video-mixer.h"
|
#include "ges-smart-video-mixer.h"
|
||||||
|
#include "ges-internal.h"
|
||||||
|
|
||||||
|
#define DEFAULT_RESTRICTION_CAPS "video/x-raw(ANY), framerate=" G_STRINGIFY(DEFAULT_FRAMERATE_N) "/" G_STRINGIFY(DEFAULT_FRAMERATE_D) ", width=" G_STRINGIFY(DEFAULT_WIDTH) ", height=" G_STRINGIFY(DEFAULT_HEIGHT)
|
||||||
|
|
||||||
struct _GESVideoTrackPrivate
|
struct _GESVideoTrackPrivate
|
||||||
{
|
{
|
||||||
|
@ -144,14 +158,17 @@ ges_video_track_new (void)
|
||||||
{
|
{
|
||||||
GESVideoTrack *ret;
|
GESVideoTrack *ret;
|
||||||
GstCaps *caps = gst_caps_new_empty_simple ("video/x-raw");
|
GstCaps *caps = gst_caps_new_empty_simple ("video/x-raw");
|
||||||
|
GstCaps *restriction_caps = gst_caps_from_string (DEFAULT_RESTRICTION_CAPS);
|
||||||
|
|
||||||
ret = g_object_new (GES_TYPE_VIDEO_TRACK, "track-type", GES_TRACK_TYPE_VIDEO,
|
ret = g_object_new (GES_TYPE_VIDEO_TRACK, "track-type", GES_TRACK_TYPE_VIDEO,
|
||||||
"caps", caps, NULL);
|
"caps", caps, NULL);
|
||||||
|
|
||||||
ges_track_set_create_element_for_gap_func (GES_TRACK (ret),
|
ges_track_set_create_element_for_gap_func (GES_TRACK (ret),
|
||||||
create_element_for_raw_video_gap);
|
create_element_for_raw_video_gap);
|
||||||
|
ges_track_set_restriction_caps (GES_TRACK (ret), restriction_caps);
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
gst_caps_unref (restriction_caps);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue