gstvdpvideosrcpad: replace get_pad_template() with get_template_caps()
This commit is contained in:
parent
7f198163ec
commit
9046f1e089
@ -1072,6 +1072,7 @@ gst_vdp_mpeg_dec_base_init (gpointer gclass)
|
|||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||||
|
|
||||||
|
GstCaps *src_caps;
|
||||||
GstPadTemplate *src_template;
|
GstPadTemplate *src_template;
|
||||||
|
|
||||||
gst_element_class_set_details_simple (element_class,
|
gst_element_class_set_details_simple (element_class,
|
||||||
@ -1084,7 +1085,10 @@ gst_vdp_mpeg_dec_base_init (gpointer gclass)
|
|||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&sink_template));
|
gst_static_pad_template_get (&sink_template));
|
||||||
|
|
||||||
src_template = gst_vdp_video_src_pad_get_pad_template ();
|
src_caps = gst_vdp_video_src_pad_get_template_caps ();
|
||||||
|
src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||||
|
src_caps);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class, src_template);
|
gst_element_class_add_pad_template (element_class, src_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,13 +22,20 @@
|
|||||||
|
|
||||||
#include "gstvdpvideosrcpad.h"
|
#include "gstvdpvideosrcpad.h"
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_STATIC (gst_vdp_video_src_pad_debug);
|
||||||
|
#define GST_CAT_DEFAULT gst_vdp_video_src_pad_debug
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_DISPLAY
|
PROP_DISPLAY
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstVdpVideoSrcPad, gst_vdp_video_src_pad, GST_TYPE_PAD);
|
#define DEBUG_INIT(bla) \
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_vdp_video_src_pad_debug, "vdpvideosrcpad", 0, "GstVdpVideoSrcPad");
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE (GstVdpVideoSrcPad, gst_vdp_video_src_pad, GST_TYPE_PAD,
|
||||||
|
DEBUG_INIT ());
|
||||||
|
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_vdp_video_src_pad_push (GstVdpVideoSrcPad * vdp_pad,
|
gst_vdp_video_src_pad_push (GstVdpVideoSrcPad * vdp_pad,
|
||||||
@ -212,17 +219,10 @@ gst_vdp_video_src_pad_get_device (GstVdpVideoSrcPad * vdp_pad)
|
|||||||
return vdp_pad->device;
|
return vdp_pad->device;
|
||||||
}
|
}
|
||||||
|
|
||||||
GstPadTemplate *
|
GstCaps *
|
||||||
gst_vdp_video_src_pad_get_pad_template ()
|
gst_vdp_video_src_pad_get_template_caps ()
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
return gst_vdp_video_buffer_get_caps (TRUE, VDP_CHROMA_TYPE_420);
|
||||||
GstPadTemplate *src_template;
|
|
||||||
|
|
||||||
caps = gst_vdp_video_buffer_get_caps (TRUE, VDP_CHROMA_TYPE_420);
|
|
||||||
src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
|
||||||
caps);
|
|
||||||
|
|
||||||
return src_template;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
@ -243,7 +243,7 @@ gst_vdp_video_src_pad_activate_push (GstPad * pad, gboolean active)
|
|||||||
g_object_unref (vdp_pad->device);
|
g_object_unref (vdp_pad->device);
|
||||||
vdp_pad->device = NULL;
|
vdp_pad->device = NULL;
|
||||||
|
|
||||||
g_object_unref (vdp_pad->caps);
|
gst_caps_unref (vdp_pad->caps);
|
||||||
vdp_pad->caps = gst_vdp_video_buffer_get_caps (TRUE, VDP_CHROMA_TYPE_420);
|
vdp_pad->caps = gst_vdp_video_buffer_get_caps (TRUE, VDP_CHROMA_TYPE_420);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,8 @@ GstFlowReturn gst_vdp_video_src_pad_alloc_buffer (GstVdpVideoSrcPad *vdp_pad, Gs
|
|||||||
GstVdpDevice *gst_vdp_video_src_pad_get_device (GstVdpVideoSrcPad *vdp_pad);
|
GstVdpDevice *gst_vdp_video_src_pad_get_device (GstVdpVideoSrcPad *vdp_pad);
|
||||||
|
|
||||||
gboolean gst_vdp_video_src_pad_set_caps (GstVdpVideoSrcPad *vdp_pad, GstCaps *caps);
|
gboolean gst_vdp_video_src_pad_set_caps (GstVdpVideoSrcPad *vdp_pad, GstCaps *caps);
|
||||||
GstPadTemplate *gst_vdp_video_src_pad_get_pad_template ();
|
|
||||||
|
GstCaps *gst_vdp_video_src_pad_get_template_caps ();
|
||||||
|
|
||||||
GstVdpVideoSrcPad *gst_vdp_video_src_pad_new ();
|
GstVdpVideoSrcPad *gst_vdp_video_src_pad_new ();
|
||||||
GType gst_vdp_video_src_pad_get_type (void) G_GNUC_CONST;
|
GType gst_vdp_video_src_pad_get_type (void) G_GNUC_CONST;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user