diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-27 18:34:53 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:32 +0100 |
commit | 2eb479f825c3d1f02f9b91cc3f1964945be5d647 (patch) | |
tree | 499763bf6369075e98ef2c7e7e8f09ba492411c7 /sys/vdpau/gstvdpmpegdecoder.c | |
parent | 2d996a3ff49757e299ec6218604f19e499ac0782 (diff) | |
download | gst-plugins-bad-2eb479f825c3d1f02f9b91cc3f1964945be5d647.tar.gz gst-plugins-bad-2eb479f825c3d1f02f9b91cc3f1964945be5d647.tar.bz2 gst-plugins-bad-2eb479f825c3d1f02f9b91cc3f1964945be5d647.zip |
vdpaumpegdec: if available use incoming buffer timestamp as output timestamp
Diffstat (limited to 'sys/vdpau/gstvdpmpegdecoder.c')
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index 5cc913b0..5b461268 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -139,7 +139,8 @@ typedef struct } GstVdpBFrame; static GstFlowReturn -gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) +gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec, + GstClockTime timestamp) { GstVdpDecoder *dec; GstBuffer *buffer; @@ -167,6 +168,7 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) b_frame = g_slice_new (GstVdpBFrame); + GST_BUFFER_TIMESTAMP (buffer) = timestamp; b_frame->buffer = buffer; memcpy (&b_frame->vdp_info, &mpeg_dec->vdp_info, sizeof (VdpPictureInfoMPEG1Or2)); @@ -180,6 +182,7 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) outbuf = gst_vdp_video_buffer_new (dec->device, VDP_CHROMA_TYPE_420, dec->width, dec->height); + GST_BUFFER_TIMESTAMP (outbuf) = timestamp; surface = outbuf->surface; device = dec->device; @@ -216,6 +219,7 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec) b_outbuf = gst_vdp_video_buffer_new (dec->device, VDP_CHROMA_TYPE_420, dec->width, dec->height); + GST_BUFFER_TIMESTAMP (b_outbuf) = GST_BUFFER_TIMESTAMP (b_frame->buffer); b_frame->vdp_info.backward_reference = surface; vbit[0].struct_version = VDP_BITSTREAM_BUFFER_VERSION; @@ -428,8 +432,6 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) switch (data[0]) { case MPEG_PACKET_PICTURE: GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_PICTURE"); - if (mpeg_dec->vdp_info.slice_count > 0) - ret = gst_vdp_mpeg_decoder_decode (mpeg_dec); gst_vdp_mpeg_decoder_parse_picture (mpeg_dec, packet_start, packet_end); break; @@ -464,6 +466,9 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) } } + if (mpeg_dec->vdp_info.slice_count > 0) + ret = gst_vdp_mpeg_decoder_decode (mpeg_dec, GST_BUFFER_TIMESTAMP (buffer)); + return ret; } |