mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-01 17:31:10 +00:00
[MOVED FROM BAD 19/28] ext/x264/gstx264enc.c: Construct source caps in more conventional (and correct) manner.
Original commit message from CVS: * ext/x264/gstx264enc.c: (gst_x264_enc_set_src_caps): Construct source caps in more conventional (and correct) manner.
This commit is contained in:
parent
fb6ce222c2
commit
4ce646744c
1 changed files with 7 additions and 6 deletions
|
@ -204,7 +204,9 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("video/x-h264")
|
GST_STATIC_CAPS ("video/x-h264, "
|
||||||
|
"framerate = (fraction) [0/1, MAX], "
|
||||||
|
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")
|
||||||
);
|
);
|
||||||
|
|
||||||
static void gst_x264_enc_finalize (GObject * object);
|
static void gst_x264_enc_finalize (GObject * object);
|
||||||
|
@ -712,15 +714,14 @@ gst_x264_enc_header_buf (GstX264Enc * encoder)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstPad * pad, GstCaps * caps)
|
gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstStructure *structure;
|
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
GstCaps *outcaps;
|
GstCaps *outcaps;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
outcaps = gst_caps_new_simple ("video/x-h264",
|
||||||
structure = gst_structure_copy (structure);
|
"width", G_TYPE_INT, encoder->width,
|
||||||
gst_structure_set_name (structure, "video/x-h264");
|
"height", G_TYPE_INT, encoder->height,
|
||||||
outcaps = gst_caps_new_full (structure, NULL);
|
"framerate", GST_TYPE_FRACTION, encoder->fps_num, encoder->fps_den, NULL);
|
||||||
|
|
||||||
if (!encoder->byte_stream) {
|
if (!encoder->byte_stream) {
|
||||||
buf = gst_x264_enc_header_buf (encoder);
|
buf = gst_x264_enc_header_buf (encoder);
|
||||||
|
|
Loading…
Reference in a new issue