vdpaumpegdec: pass buffer size directly to gst_vdp_mpeg_decoder_decode

This commit is contained in:
Carl-Anton Ingmarsson 2009-06-05 21:42:30 +02:00 committed by Jan Schmidt
parent 7c0e5b5c22
commit 5956df5338
2 changed files with 4 additions and 5 deletions

View file

@ -329,7 +329,7 @@ gst_vdp_mpeg_decoder_push_video_buffer (GstVdpMpegDecoder * mpeg_dec,
static GstFlowReturn static GstFlowReturn
gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec,
GstClockTime timestamp) GstClockTime timestamp, gint64 size)
{ {
VdpPictureInfoMPEG1Or2 *info; VdpPictureInfoMPEG1Or2 *info;
GstBuffer *buffer; GstBuffer *buffer;
@ -367,7 +367,7 @@ gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec,
GST_BUFFER_TIMESTAMP (outbuf) = timestamp; GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
GST_BUFFER_DURATION (outbuf) = mpeg_dec->duration; GST_BUFFER_DURATION (outbuf) = mpeg_dec->duration;
GST_BUFFER_OFFSET (outbuf) = mpeg_dec->frame_nr; GST_BUFFER_OFFSET (outbuf) = mpeg_dec->frame_nr;
GST_BUFFER_SIZE (outbuf) = mpeg_dec->size; GST_BUFFER_SIZE (outbuf) = size;
if (info->top_field_first) if (info->top_field_first)
GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_TFF); GST_BUFFER_FLAG_SET (outbuf, GST_VIDEO_BUFFER_TFF);
@ -608,7 +608,6 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
gst_vdp_mpeg_decoder_flush (mpeg_dec); gst_vdp_mpeg_decoder_flush (mpeg_dec);
} }
mpeg_dec->size = GST_BUFFER_SIZE (buffer);
gst_vdp_mpeg_packetizer_init (&packetizer, buffer); gst_vdp_mpeg_packetizer_init (&packetizer, buffer);
while ((buf = gst_vdp_mpeg_packetizer_get_next_packet (&packetizer))) { while ((buf = gst_vdp_mpeg_packetizer_get_next_packet (&packetizer))) {
GstBitReader b_reader = GST_BIT_READER_INIT_FROM_BUFFER (buf); GstBitReader b_reader = GST_BIT_READER_INIT_FROM_BUFFER (buf);
@ -676,7 +675,8 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
} }
if (mpeg_dec->vdp_info.slice_count > 0) if (mpeg_dec->vdp_info.slice_count > 0)
ret = gst_vdp_mpeg_decoder_decode (mpeg_dec, GST_BUFFER_TIMESTAMP (buffer)); ret = gst_vdp_mpeg_decoder_decode (mpeg_dec, GST_BUFFER_TIMESTAMP (buffer),
GST_BUFFER_SIZE (buffer));
return ret; return ret;
} }

View file

@ -59,7 +59,6 @@ struct _GstVdpMpegDecoder
/* currently decoded frame info */ /* currently decoded frame info */
GstAdapter *adapter; GstAdapter *adapter;
VdpPictureInfoMPEG1Or2 vdp_info; VdpPictureInfoMPEG1Or2 vdp_info;
guint64 size;
guint64 frame_nr; guint64 frame_nr;
GstClockTime duration; GstClockTime duration;