video: Update for libgstvideo API changes

This commit is contained in:
Sebastian Dröge 2012-04-19 12:20:59 +02:00
parent 09dabd4be6
commit 04b70571e5
6 changed files with 9 additions and 13 deletions

View file

@ -342,10 +342,8 @@ gst_dvdec_src_negotiate (GstDVDec * dvdec)
dvdec->vinfo.par_d = dvdec->par_y;
if (dvdec->interlaced) {
dvdec->vinfo.interlace_mode = GST_VIDEO_INTERLACE_MODE_INTERLEAVED;
dvdec->vinfo.flags |= GST_VIDEO_FLAG_INTERLACED;
} else {
dvdec->vinfo.interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
dvdec->vinfo.flags &= GST_VIDEO_FLAG_INTERLACED;
}
othercaps = gst_video_info_to_caps (&dvdec->vinfo);

View file

@ -17,7 +17,7 @@ libgst1394_la_CFLAGS = \
$(GST_CFLAGS) \
$(DV1394_CFLAGS)
libgst1394_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_API_VERSION) \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(DV1394_LIBS)

View file

@ -187,7 +187,7 @@ gst_rtp_vraw_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
break;
}
if (info.flags & GST_VIDEO_FLAG_INTERLACED) {
if (GST_VIDEO_INFO_IS_INTERLACED (&info)) {
yinc *= 2;
}
@ -204,7 +204,7 @@ gst_rtp_vraw_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
hstr = g_strdup_printf ("%d", GST_VIDEO_INFO_HEIGHT (&info));
gst_rtp_base_payload_set_options (payload, "video", TRUE, "RAW", 90000);
if (info.flags & GST_VIDEO_FLAG_INTERLACED) {
if (GST_VIDEO_INFO_IS_INTERLACED (&info)) {
res = gst_rtp_base_payload_set_outcaps (payload, "sampling", G_TYPE_STRING,
samplingstr, "depth", G_TYPE_STRING, depthstr, "width", G_TYPE_STRING,
wstr, "height", G_TYPE_STRING, hstr, "colorimetry", G_TYPE_STRING,
@ -271,7 +271,7 @@ gst_rtp_vraw_pay_handle_buffer (GstRTPBasePayload * payload, GstBuffer * buffer)
width = GST_VIDEO_INFO_WIDTH (&rtpvrawpay->vinfo);
height = GST_VIDEO_INFO_HEIGHT (&rtpvrawpay->vinfo);
interlaced = ! !(rtpvrawpay->vinfo.flags & GST_VIDEO_FLAG_INTERLACED);
interlaced = GST_VIDEO_INFO_IS_INTERLACED (&rtpvrawpay->vinfo);
/* start with line 0, offset 0 */
for (field = 0; field < 1 + interlaced; field++) {

View file

@ -220,7 +220,7 @@ gst_y4m_encode_get_stream_header (GstY4mEncode * filter, gboolean tff)
gchar interlaced;
gsize len;
if (filter->info.flags & GST_VIDEO_FLAG_INTERLACED) {
if (GST_VIDEO_INFO_IS_INTERLACED (&filter->info)) {
if (tff)
interlaced = 't';
else
@ -278,7 +278,7 @@ gst_y4m_encode_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
if (G_UNLIKELY (!filter->header)) {
gboolean tff;
if (filter->info.flags & GST_VIDEO_FLAG_INTERLACED) {
if (GST_VIDEO_INFO_IS_INTERLACED (&filter->info)) {
tff = GST_BUFFER_FLAG_IS_SET (buf, GST_VIDEO_BUFFER_FLAG_TFF);
}
outbuf = gst_y4m_encode_get_stream_header (filter, tff);

View file

@ -197,8 +197,8 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
stride[0] = obj->bytesperline;
GST_DEBUG_OBJECT (pool, "adding video meta, stride %d", stride[0]);
gst_buffer_add_video_meta_full (newbuf, info->flags,
GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
gst_buffer_add_video_meta_full (newbuf, GST_VIDEO_INFO_FORMAT (info),
GST_VIDEO_FRAME_FLAG_NONE, GST_VIDEO_INFO_WIDTH (info),
GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
offset, stride);
}
@ -595,11 +595,9 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
/* set top/bottom field first if v4l2_buffer has the information */
if (vbuffer.field == V4L2_FIELD_INTERLACED_TB) {
GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_INTERLACED);
}
if (vbuffer.field == V4L2_FIELD_INTERLACED_BT) {
GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_FLAG_INTERLACED);
}
/* this can change at every frame, esp. with jpeg */

View file

@ -2217,7 +2217,7 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps)
fps_d = GST_VIDEO_INFO_FPS_D (&info);
stride = GST_VIDEO_INFO_PLANE_STRIDE (&info, 0);
if (info.flags & GST_VIDEO_FLAG_INTERLACED) {
if (GST_VIDEO_INFO_IS_INTERLACED (&info)) {
GST_DEBUG_OBJECT (v4l2object->element, "interlaced video");
/* ideally we would differentiate between types of interlaced video
* but there is not sufficient information in the caps..