mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-16 13:26:36 +00:00
player: Add support for multiview settings
https://bugzilla.gnome.org/show_bug.cgi?id=765302
This commit is contained in:
parent
45b258127c
commit
aa754f634c
6 changed files with 146 additions and 2 deletions
|
@ -1745,6 +1745,11 @@ gst_player_has_color_balance
|
|||
gst_player_set_color_balance
|
||||
gst_player_get_color_balance
|
||||
|
||||
gst_player_get_multiview_mode
|
||||
gst_player_set_multiview_mode
|
||||
gst_player_get_multiview_flags
|
||||
gst_player_set_multiview_flags
|
||||
|
||||
gst_player_get_rate
|
||||
gst_player_set_rate
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ GstPlayer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstplayer-@GST_API_
|
|||
--library-path=$(top_builddir)/gst-libs \
|
||||
--library=libgstplayer-@GST_API_VERSION@.la \
|
||||
--include=Gst-@GST_API_VERSION@ \
|
||||
--include=GstVideo-@GST_API_VERSION@ \
|
||||
--libtool="${LIBTOOL}" \
|
||||
--pkg gstreamer-@GST_API_VERSION@ \
|
||||
--pkg gstreamer-audio-@GST_API_VERSION@ \
|
||||
|
|
|
@ -95,6 +95,8 @@ enum
|
|||
PROP_RATE,
|
||||
PROP_PIPELINE,
|
||||
PROP_POSITION_UPDATE_INTERVAL,
|
||||
PROP_VIDEO_MULTIVIEW_MODE,
|
||||
PROP_VIDEO_MULTIVIEW_FLAGS,
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
|
@ -325,6 +327,22 @@ gst_player_class_init (GstPlayerClass * klass)
|
|||
0, 10000, DEFAULT_POSITION_UPDATE_INTERVAL_MS,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
param_specs[PROP_VIDEO_MULTIVIEW_MODE] =
|
||||
g_param_spec_enum ("video-multiview-mode",
|
||||
"Multiview Mode Override",
|
||||
"Re-interpret a video stream as one of several frame-packed stereoscopic modes.",
|
||||
GST_TYPE_VIDEO_MULTIVIEW_FRAME_PACKING,
|
||||
GST_VIDEO_MULTIVIEW_FRAME_PACKING_NONE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
param_specs[PROP_VIDEO_MULTIVIEW_FLAGS] =
|
||||
g_param_spec_flags ("video-multiview-flags",
|
||||
"Multiview Flags Override",
|
||||
"Override details of the multiview frame layout",
|
||||
GST_TYPE_VIDEO_MULTIVIEW_FLAGS, GST_VIDEO_MULTIVIEW_FLAGS_NONE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
g_object_class_install_properties (gobject_class, PROP_LAST, param_specs);
|
||||
|
||||
signals[SIGNAL_POSITION_UPDATED] =
|
||||
|
@ -570,6 +588,18 @@ gst_player_set_property (GObject * object, guint prop_id,
|
|||
|
||||
gst_player_set_position_update_interval_internal (self);
|
||||
break;
|
||||
case PROP_VIDEO_MULTIVIEW_MODE:
|
||||
GST_DEBUG_OBJECT (self, "Set multiview mode=%u",
|
||||
g_value_get_enum (value));
|
||||
g_object_set_property (G_OBJECT (self->playbin), "video-multiview-mode",
|
||||
value);
|
||||
break;
|
||||
case PROP_VIDEO_MULTIVIEW_FLAGS:
|
||||
GST_DEBUG_OBJECT (self, "Set multiview flags=%x",
|
||||
g_value_get_flags (value));
|
||||
g_object_set_property (G_OBJECT (self->playbin), "video-multiview-flags",
|
||||
value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -662,6 +692,20 @@ gst_player_get_property (GObject * object, guint prop_id,
|
|||
g_value_set_uint (value, gst_player_get_position_update_interval (self));
|
||||
g_mutex_unlock (&self->lock);
|
||||
break;
|
||||
case PROP_VIDEO_MULTIVIEW_MODE:{
|
||||
g_object_get_property (G_OBJECT (self->playbin), "video-multiview-mode",
|
||||
value);
|
||||
GST_TRACE_OBJECT (self, "Return multiview mode=%d",
|
||||
g_value_get_enum (value));
|
||||
break;
|
||||
}
|
||||
case PROP_VIDEO_MULTIVIEW_FLAGS:{
|
||||
g_object_get_property (G_OBJECT (self->playbin), "video-multiview-flags",
|
||||
value);
|
||||
GST_TRACE_OBJECT (self, "Return multiview flags=%x",
|
||||
g_value_get_flags (value));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -3662,6 +3706,88 @@ gst_player_get_color_balance (GstPlayer * self, GstPlayerColorBalanceType type)
|
|||
(gdouble) channel->min_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_player_get_multiview_mode:
|
||||
* @player: #GstPlayer instance
|
||||
*
|
||||
* Retrieve the current value of the indicated @type.
|
||||
*
|
||||
* Returns: The current value of @type, Default: -1 "none"
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
GstVideoMultiviewMode
|
||||
gst_player_get_multiview_mode (GstPlayer * self)
|
||||
{
|
||||
GstVideoMultiviewMode val = GST_VIDEO_MULTIVIEW_FRAME_PACKING_NONE;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PLAYER (self),
|
||||
GST_VIDEO_MULTIVIEW_FRAME_PACKING_NONE);
|
||||
|
||||
g_object_get (self, "video-multiview-mode", &val, NULL);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_player_set_multiview_mode:
|
||||
* @player: #GstPlayer instance
|
||||
* @mode: The new value for the @type
|
||||
*
|
||||
* Sets the current value of the indicated mode @type to the passed
|
||||
* value.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
gst_player_set_multiview_mode (GstPlayer * self, GstVideoMultiviewMode mode)
|
||||
{
|
||||
g_return_if_fail (GST_IS_PLAYER (self));
|
||||
|
||||
g_object_set (self, "video-multiview-mode", mode, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_player_get_multiview_flags:
|
||||
* @player: #GstPlayer instance
|
||||
*
|
||||
* Retrieve the current value of the indicated @type.
|
||||
*
|
||||
* Returns: The current value of @type, Default: 0x00000000 "none
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
GstVideoMultiviewFlags
|
||||
gst_player_get_multiview_flags (GstPlayer * self)
|
||||
{
|
||||
GstVideoMultiviewFlags val = GST_VIDEO_MULTIVIEW_FLAGS_NONE;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PLAYER (self), val);
|
||||
|
||||
g_object_get (self, "video-multiview-flags", &val, NULL);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_player_set_multiview_flags:
|
||||
* @player: #GstPlayer instance
|
||||
* @flags: The new value for the @type
|
||||
*
|
||||
* Sets the current value of the indicated mode @type to the passed
|
||||
* value.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
void
|
||||
gst_player_set_multiview_flags (GstPlayer * self, GstVideoMultiviewFlags flags)
|
||||
{
|
||||
g_return_if_fail (GST_IS_PLAYER (self));
|
||||
|
||||
g_object_set (self, "video-multiview-flags", flags, NULL);
|
||||
}
|
||||
|
||||
|
||||
#define C_ENUM(v) ((gint) v)
|
||||
#define C_FLAGS(v) ((guint) v)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define __GST_PLAYER_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/player/gstplayer-types.h>
|
||||
#include <gst/player/gstplayer-signal-dispatcher.h>
|
||||
#include <gst/player/gstplayer-video-renderer.h>
|
||||
|
@ -178,6 +179,17 @@ void gst_player_set_color_balance (GstPlayer * player,
|
|||
gdouble gst_player_get_color_balance (GstPlayer * player,
|
||||
GstPlayerColorBalanceType type);
|
||||
|
||||
|
||||
GstVideoMultiviewMode gst_player_get_multiview_mode (GstPlayer * player);
|
||||
void gst_player_set_multiview_mode (GstPlayer * player,
|
||||
GstVideoMultiviewMode mode);
|
||||
|
||||
GstVideoMultiviewFlags gst_player_get_multiview_flags (GstPlayer * player);
|
||||
void gst_player_set_multiview_flags (GstPlayer * player,
|
||||
GstVideoMultiviewFlags flags);
|
||||
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_PLAYER_H__ */
|
||||
|
|
|
@ -5,7 +5,7 @@ includedir=${pcfiledir}/../gst-libs
|
|||
|
||||
Name: GStreamer Player, Uninstalled
|
||||
Description: GStreamer Player convenience library, uninstalled
|
||||
Requires: gstreamer-@GST_API_VERSION@
|
||||
Requires: gstreamer-@GST_API_VERSION@ gstreamer-video-@GST_API_VERSION@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgstplayer-@GST_API_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
|
|
|
@ -5,7 +5,7 @@ includedir=@includedir@/gstreamer-@GST_API_VERSION@
|
|||
|
||||
Name: GStreamer Player
|
||||
Description: GStreamer Player convenience library
|
||||
Requires: gstreamer-@GST_API_VERSION@
|
||||
Requires: gstreamer-@GST_API_VERSION@ gstreamer-video-@GST_API_VERSION@
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgstplayer-@GST_API_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
|
|
Loading…
Reference in a new issue