Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding YUY2 input format support to deiscaler

commit 7f6c5159a1a670c90910451f14d92c4e028df8c0 1 parent 83fdfcd
@mmontero mmontero authored
View
5 omx/gstomx_base_vfpc2.c
@@ -96,7 +96,6 @@ sink_setcaps (GstPad *pad,
GstOmxBaseVfpc2 *self;
GstOmxBaseFilter2 *omx_base;
GOmxCore *gomx;
- GstVideoFormat format;
self = GST_OMX_BASE_VFPC2 (GST_PAD_PARENT (pad));
omx_base = GST_OMX_BASE_FILTER2 (self);
@@ -113,7 +112,7 @@ sink_setcaps (GstPad *pad,
g_return_val_if_fail (structure, FALSE);
if (!gst_video_format_parse_caps_strided (caps,
- &format, &self->in_width, &self->in_height, &self->in_stride))
+ &self->in_format, &self->in_width, &self->in_height, &self->in_stride))
{
GST_WARNING_OBJECT (self, "width and/or height is not set in caps");
return FALSE;
@@ -121,7 +120,7 @@ sink_setcaps (GstPad *pad,
if (!self->in_stride)
{
- self->in_stride = gstomx_calculate_stride (self->in_width, format);
+ self->in_stride = gstomx_calculate_stride (self->in_width, self->in_format);
}
{
View
1  omx/gstomx_base_vfpc2.h
@@ -48,6 +48,7 @@ struct GstOmxBaseVfpc2
gboolean port_configured;
GstPadSetCapsFunction sink_setcaps;
gint in_width, in_height, in_stride;
+ GstVideoFormat in_format;
gint out_width[NUM_OUTPUTS], out_height[NUM_OUTPUTS], out_stride[NUM_OUTPUTS];
gint left, top;
GstOmxBaseFilter2Cb omx_setup;
View
7 omx/gstomx_deiscaler.c
@@ -34,7 +34,7 @@ static GstStaticPadTemplate sink_template =
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV_STRIDED (
- "{NV12}", "[ 0, max ]"))
+ "{NV12,YUY2}", "[ 0, max ]"))
);
static GstStaticPadTemplate src_template_yuv2 =
@@ -333,8 +333,9 @@ omx_setup (GstOmxBaseFilter2 *omx_base)
paramPort.format.video.nFrameHeight = self->in_height >> shift;
paramPort.format.video.nStride = self->in_stride;
paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
- paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
- paramPort.nBufferSize = self->in_stride * self->in_height * 1.5;
+ paramPort.format.video.eColorFormat = g_omx_gstvformat_to_colorformat (self->in_format);
+ paramPort.nBufferSize = gst_video_format_get_size_strided (self->in_format,
+ self->in_width, self->in_height, self->in_stride);
paramPort.nBufferAlignment = 0;
paramPort.bBuffersContiguous = 0;
G_OMX_PORT_SET_DEFINITION (omx_base->in_port, &paramPort);
Please sign in to comment.
Something went wrong with that request. Please try again.