summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libvdpau/nal_parser.c4
-rw-r--r--src/libvdpau/nal_parser.h1
-rw-r--r--src/libvdpau/vdpau_h264.c22
-rw-r--r--src/video_out/video_out_vdpau.c2
4 files changed, 25 insertions, 4 deletions
diff --git a/src/libvdpau/nal_parser.c b/src/libvdpau/nal_parser.c
index f69a6df7a..9bedae71d 100644
--- a/src/libvdpau/nal_parser.c
+++ b/src/libvdpau/nal_parser.c
@@ -800,6 +800,7 @@ struct nal_parser* init_parser()
parser->last_nal = parser->nal1;
parser->last_nal_res = 0;
+ parser->is_idr = 0;
parser->slice = 0;
parser->slice_cnt = 0;
parser->field = -1;
@@ -885,6 +886,9 @@ int parse_nal(uint8_t *buf, int buf_len, struct nal_parser *parser)
struct nal_unit *last_nal = parser->last_nal;
int res = parse_nal_header(&bufr, nal);
+ printf("type: %d\n", res);
+ if(res == NAL_SLICE_IDR)
+ parser->is_idr = 1;
if(res >= NAL_SLICE && res <= NAL_SLICE_IDR) {
// now detect if it's a new frame!
diff --git a/src/libvdpau/nal_parser.h b/src/libvdpau/nal_parser.h
index d8195c987..31d55d3ca 100644
--- a/src/libvdpau/nal_parser.h
+++ b/src/libvdpau/nal_parser.h
@@ -343,6 +343,7 @@ struct nal_parser {
int found_pps;
int last_nal_res;
+ int is_idr;
int field; /* 0=top, 1=bottom, -1=both */
int slice;
int slice_cnt;
diff --git a/src/libvdpau/vdpau_h264.c b/src/libvdpau/vdpau_h264.c
index ca27cd4f8..56f4d992d 100644
--- a/src/libvdpau/vdpau_h264.c
+++ b/src/libvdpau/vdpau_h264.c
@@ -221,6 +221,7 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
memcpy(pic.referenceFrames, this->reference_frames, sizeof(this->reference_frames));
if(this->decoder_started || pic.is_reference) {
+ this->nal_parser->is_idr = 0;
if(!this->decoder_started)
this->decoder_started = 1;
@@ -238,8 +239,23 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
if(status != VDP_STATUS_OK)
xprintf(this->xine, XINE_VERBOSITY_LOG, "vdpau_h264: Decoder failure: %d\n", status);
- else
+ else {
printf("DECODING SUCCESS\n");
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio,
+ XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS);
+
+ this->vdpau_accel = (vdpau_accel_t*)img->accel_data;
+ this->vdpau_accel->surface = surface;
+
+ img->duration = this->video_step;
+ img->pts = buf->pts;
+ img->bad_frame = 0;
+
+ img->draw(img, this->stream);
+ img->free(img);
+ }
this->vdpau_accel->vdp_video_surface_destroy(surface);
}
@@ -322,7 +338,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
this->nal_parser = init_parser();
this->buf = NULL;
- memset(this->reference_frames, 0x00, sizeof(this->reference_frames));
+ memset(this->reference_frames, VDP_INVALID_HANDLE, sizeof(this->reference_frames));
this->reference_frames_used = 0;
return &this->video_decoder;
@@ -391,7 +407,7 @@ static const uint32_t video_types[] = {
*/
static const decoder_info_t dec_info_video = {
video_types, /* supported types */
- 5 /* priority */
+ 7 /* priority */
};
/*
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
index 7d5da96c1..210c804f3 100644
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -478,7 +478,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
/*printf( "out_dest = %d %d %d %d - vid_dest = %d %d %d %d\n", out_dest.x0, out_dest.y0, out_dest.x1, out_dest.y1, vid_dest.x0, vid_dest.y0, vid_dest.x1, vid_dest.y1 );*/
st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME,
- 0, 0, surface, 0, 0, &vid_source, this->output_surface, &out_dest, &vid_dest, 0, 0 );
+ 0, VDP_INVALID_HANDLE, surface, 0, VDP_INVALID_HANDLE, &vid_source, this->output_surface, &out_dest, &vid_dest, 0, 0 );
if ( st != VDP_STATUS_OK )
printf( "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) );