summaryrefslogtreecommitdiff
path: root/sys/vdpau
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2010-07-15 13:23:52 +0200
committerCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2010-07-15 13:23:52 +0200
commit2d870ee7fd80f290821dc5457b773ecfdab93774 (patch)
treeddbeb897361945137938303b2ca5ee51e7cf269b /sys/vdpau
parentecbf5a4e301935fb0baad4328772c35c99b286d1 (diff)
vdpauh264dec: calculate width and height from bitstream info
Diffstat (limited to 'sys/vdpau')
-rw-r--r--sys/vdpau/h264/gstvdph264dec.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/vdpau/h264/gstvdph264dec.c b/sys/vdpau/h264/gstvdph264dec.c
index ba25dfad3..3e99f8812 100644
--- a/sys/vdpau/h264/gstvdph264dec.c
+++ b/sys/vdpau/h264/gstvdph264dec.c
@@ -260,15 +260,31 @@ gst_vdp_h264_dec_idr (GstVdpH264Dec * h264_dec, GstH264Frame * h264_frame)
seq = slice->picture->sequence;
if (seq != h264_dec->sequence) {
+ GstVideoState state;
GstFlowReturn ret;
GstVdpDevice *device;
- gst_base_video_decoder_set_src_caps (GST_BASE_VIDEO_DECODER (h264_dec));
+ state =
+ gst_base_video_decoder_get_state (GST_BASE_VIDEO_DECODER (h264_dec));
+
+ state.width = (seq->pic_width_in_mbs_minus1 + 1) * 16 -
+ 2 * seq->frame_crop_right_offset;
+
+ state.height = (2 - seq->frame_mbs_only_flag) *
+ (seq->pic_height_in_map_units_minus1 + 1) * 16;
+ if (seq->frame_mbs_only_flag)
+ state.height -= 2 * seq->frame_crop_bottom_offset;
+ else
+ state.height -= 4 * seq->frame_crop_bottom_offset;
+
+ /* FIXME: try to calculate framerate */
+
+ gst_base_video_decoder_set_state (GST_BASE_VIDEO_DECODER (h264_dec), state);
+
ret = gst_vdp_decoder_get_device (GST_VDP_DECODER (h264_dec), &device,
NULL);
if (ret == GST_FLOW_OK) {
- GstVideoState state;
VdpDecoderProfile profile;
VdpStatus status;
@@ -277,8 +293,6 @@ gst_vdp_h264_dec_idr (GstVdpH264Dec * h264_dec, GstH264Frame * h264_frame)
h264_dec->decoder = VDP_INVALID_HANDLE;
}
- state =
- gst_base_video_decoder_get_state (GST_BASE_VIDEO_DECODER (h264_dec));
switch (seq->profile_idc) {
case 66: