[Spice-devel] [PATCH spice-gtk v4 6/7] display-gst: Use Playbin for GStreamer 1.9.0 onwards
Victor Toso
victortoso at redhat.com
Thu Jun 29 14:41:53 UTC 2017
Hi,
On Thu, Jun 29, 2017 at 04:35:30PM +0200, Christophe Fergeau wrote:
> On Thu, Jun 29, 2017 at 01:58:07PM +0200, Victor Toso wrote:
> > Hi,
> >
> > On Thu, Jun 29, 2017 at 10:59:16AM +0200, Pavel Grunt wrote:
> > > On Wed, 2017-06-28 at 14:43 +0200, Victor Toso wrote:
> > > > From: Victor Toso <me at victortoso.com>
> > > >
> > > > The Playbin can provide the full pipeline which reduces the
> > > > overall maintenance in the code as we don't need to track which
> > > > decoder can work with our stream type.
> > > >
> > > > We need to maintain the GstCaps per SPICE_VIDEO_CODEC_TYPE in order
> > > > to
> > > > tell Playbin the type of data we expect. This much should be covered
> > > > by spice-protocol and very likely we will need to extend it in the
> > > > future to allow more settings that might not possible to verify at
> > > > runtime.
> > > >
> > > > This patch keeps previous code for compatibility reasons.
> > > >
> > > > Note that we have to wait Playbin to emit "source-setup" in order to
> > > > configure GstAppSrc with the capabilities of input stream. If in the
> > > > unlikely event of frames arriving while GstAppSrc is not setup, we
> > > > will drop those frames.
> > > >
> > > > Signed-off-by: Victor Toso <victortoso at redhat.com>
> > > > Signed-off-by: Victor Toso <me at victortoso.com>
> > > > ---
> > > > src/channel-display-gst.c | 99
> > > > ++++++++++++++++++++++++++++++++++++++++++++++-
> > > > 1 file changed, 97 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> > > > index 1b40002..df58de3 100644
> > > > --- a/src/channel-display-gst.c
> > > > +++ b/src/channel-display-gst.c
> > > > @@ -50,6 +50,9 @@ typedef struct SpiceGstDecoder {
> > > > guint timer_id;
> > > > } SpiceGstDecoder;
> > > >
> > > > +/* FIXME: With gstreamer version 1.9.0 and higher, we are using
> > > > playbin to
> > > > + * create the pipeline for us and for that reason we don't need to
> > > > keep track of
> > > > + * decoder's name anymore. */
> > > > static struct {
> > > > const gchar *dec_name;
> > > > const gchar *dec_caps;
> > > > @@ -83,6 +86,21 @@ G_STATIC_ASSERT(G_N_ELEMENTS(gst_opts) <=
> > > > SPICE_VIDEO_CODEC_TYPE_ENUM_END);
> > > > #define VALID_VIDEO_CODEC_TYPE(codec) \
> > > > (codec > 0 && codec < G_N_ELEMENTS(gst_opts))
> > > >
> > > > +typedef enum {
> > > > + GST_PLAY_FLAG_VIDEO = (1 << 0),
> > > > + GST_PLAY_FLAG_AUDIO = (1 << 1),
> > > > + GST_PLAY_FLAG_TEXT = (1 << 2),
> > > > + GST_PLAY_FLAG_VIS = (1 << 3),
> > > > + GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
> > > > + GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
> > > > + GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
> > > > + GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
> > > > + GST_PLAY_FLAG_BUFFERING = (1 << 8),
> > > > + GST_PLAY_FLAG_DEINTERLACE = (1 << 9),
> > > > + GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
> > > > + GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11),
> > > > +} GstPlayFlags;
> > >
> > > It can cause problems if gstreamer exports, please give them a SPICE
> > > prefix
> >
> > "Thanks for the bug report, but we don't export plugin headers, sorry.
> >
> > You can copy and paste these into your code, or use API like
> > gst_util_set_object_arg() so you can use string nicks."
> >
> > So, it should never happen. Source:
> > https://bugzilla.gnome.org/show_bug.cgi?id=784279
>
> I'd add a bug reference before the enum so that people know why you
> copied and pasted this.
>
> Christophe
Sure, I've just added it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170629/24629e4c/attachment.sig>
More information about the Spice-devel
mailing list