mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
vdpau: add stubs for pushing VdpVideoSurfaces to the src pad
This commit is contained in:
parent
46a7e8221c
commit
24dfc72e89
2 changed files with 19 additions and 4 deletions
|
@ -71,6 +71,19 @@ static void gst_vdpaudecoder_set_property (GObject * object, guint prop_id,
|
||||||
static void gst_vdpaudecoder_get_property (GObject * object, guint prop_id,
|
static void gst_vdpaudecoder_get_property (GObject * object, guint prop_id,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_vdpaudecoder_push_video_surface (GstVdpauDecoder * dec,
|
||||||
|
VdpVideoSurface * surface)
|
||||||
|
{
|
||||||
|
switch (dec->format) {
|
||||||
|
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
|
||||||
|
/* YV12 specific code */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
VdpChromaType chroma_type;
|
VdpChromaType chroma_type;
|
||||||
|
@ -163,8 +176,6 @@ gst_vdpaudecoder_get_vdpau_support (GstVdpauDecoder * dec)
|
||||||
"height", GST_TYPE_INT_RANGE, 1, max_h,
|
"height", GST_TYPE_INT_RANGE, 1, max_h,
|
||||||
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
||||||
gst_caps_append (caps, format_caps);
|
gst_caps_append (caps, format_caps);
|
||||||
GST_DEBUG ("fourcc: %" GST_FOURCC_FORMAT "\n",
|
|
||||||
GST_FOURCC_ARGS (formats[j].fourcc));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,6 +242,7 @@ gst_vdpaudecoder_sink_set_caps (GstPad * pad, GstCaps * caps)
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
gint framerate_numerator, framerate_denominator;
|
gint framerate_numerator, framerate_denominator;
|
||||||
|
guint32 fourcc_format;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
@ -240,9 +252,9 @@ gst_vdpaudecoder_sink_set_caps (GstPad * pad, GstCaps * caps)
|
||||||
&framerate_numerator, &framerate_denominator);
|
&framerate_numerator, &framerate_denominator);
|
||||||
|
|
||||||
src_caps = gst_pad_get_allowed_caps (dec->src);
|
src_caps = gst_pad_get_allowed_caps (dec->src);
|
||||||
GST_DEBUG ("caps: %s\n\n", gst_caps_to_string (src_caps));
|
|
||||||
|
|
||||||
structure = gst_caps_get_structure (src_caps, 0);
|
structure = gst_caps_get_structure (src_caps, 0);
|
||||||
|
gst_structure_get_fourcc (structure, "format", &fourcc_format);
|
||||||
gst_structure_set (structure,
|
gst_structure_set (structure,
|
||||||
"width", G_TYPE_INT, width,
|
"width", G_TYPE_INT, width,
|
||||||
"height", G_TYPE_INT, height,
|
"height", G_TYPE_INT, height,
|
||||||
|
@ -255,11 +267,12 @@ gst_vdpaudecoder_sink_set_caps (GstPad * pad, GstCaps * caps)
|
||||||
res = gst_pad_set_caps (dec->src, new_caps);
|
res = gst_pad_set_caps (dec->src, new_caps);
|
||||||
|
|
||||||
gst_caps_unref (new_caps);
|
gst_caps_unref (new_caps);
|
||||||
GST_DEBUG ("caps: %s\n\n", gst_caps_to_string (gst_pad_get_caps (dec->src)));
|
|
||||||
|
|
||||||
if (!res)
|
if (!res)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
dec->format = fourcc_format;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ struct _GstVdpauDecoder {
|
||||||
|
|
||||||
GstCaps *src_caps;
|
GstCaps *src_caps;
|
||||||
|
|
||||||
|
guint32 format;
|
||||||
|
|
||||||
gboolean silent;
|
gboolean silent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue