summaryrefslogtreecommitdiff
path: root/src/libvdpau
diff options
context:
space:
mode:
Diffstat (limited to 'src/libvdpau')
-rw-r--r--src/libvdpau/nal_parser.c4
-rw-r--r--src/libvdpau/nal_parser.h1
-rw-r--r--src/libvdpau/vdpau_h264.c22
3 files changed, 24 insertions, 3 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 */
};
/*