summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 18:05:23 +0100
committerwm4 <wm4@nowhere>2013-12-21 20:50:11 +0100
commit9e0b84c32173573cf5e5a09804d399a24a44c7ca (patch)
tree75b435b42afbc9e9d64d8b5e219f50054698a755 /video/decode
parent64278128d8d5315a19da6d319517c48fa97da3f4 (diff)
downloadmpv-9e0b84c32173573cf5e5a09804d399a24a44c7ca.tar.bz2
mpv-9e0b84c32173573cf5e5a09804d399a24a44c7ca.tar.xz
vdpau: mp_msg conversions
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vdpau.c13
-rw-r--r--video/decode/vdpau_old.c12
2 files changed, 14 insertions, 11 deletions
diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c
index c7a5361c15..4b207f05fc 100644
--- a/video/decode/vdpau.c
+++ b/video/decode/vdpau.c
@@ -30,6 +30,7 @@
#include "video/hwdec.h"
struct priv {
+ struct mp_log *log;
struct mp_vdpau_ctx *mpvdp;
struct vdp_functions *vdp;
VdpDevice vdp_device;
@@ -110,7 +111,7 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx)
const struct hwdec_profile_entry *pe = hwdec_find_profile(ctx, profiles);
if (!pe) {
- mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unsupported codec or profile.\n");
+ MP_ERR(p, "Unsupported codec or profile.\n");
goto fail;
}
@@ -119,14 +120,13 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx)
vdp_st = vdp->decoder_query_capabilities(p->vdp_device, pe->hw_profile,
&supported, &maxl, &maxm,
&maxw, &maxh);
- CHECK_ST_WARNING("Querying VDPAU decoder capabilities");
+ CHECK_VDP_WARNING(p, "Querying VDPAU decoder capabilities");
if (!supported) {
- mp_msg(MSGT_VO, MSGL_ERR,
- "[vdpau] Codec or profile not supported by hardware.\n");
+ MP_ERR(p, "Codec or profile not supported by hardware.\n");
goto fail;
}
if (p->vid_width > maxw || p->vid_height > maxh) {
- mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Video too large.\n");
+ MP_ERR(p, "Video too large.\n");
goto fail;
}
@@ -135,7 +135,7 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx)
vdp_st = vdp->decoder_create(p->vdp_device, pe->hw_profile,
p->vid_width, p->vid_height, maxrefs,
&p->context.decoder);
- CHECK_ST_WARNING("Failed creating VDPAU decoder");
+ CHECK_VDP_WARNING(p, "Failed creating VDPAU decoder");
if (vdp_st != VDP_STATUS_OK)
goto fail;
return true;
@@ -189,6 +189,7 @@ static int init(struct lavc_ctx *ctx)
{
struct priv *p = talloc_ptrtype(NULL, p);
*p = (struct priv) {
+ .log = mp_log_new(p, ctx->log, "vdpau"),
.mpvdp = ctx->hwdec_info->vdpau_ctx,
};
ctx->hwdec_priv = p;
diff --git a/video/decode/vdpau_old.c b/video/decode/vdpau_old.c
index 8b7950c876..9e03026221 100644
--- a/video/decode/vdpau_old.c
+++ b/video/decode/vdpau_old.c
@@ -34,6 +34,7 @@
#include "video/decode/dec_video.h"
struct priv {
+ struct mp_log *log;
struct mp_vdpau_ctx *mpvdp;
struct vdp_functions *vdp;
VdpDevice vdp_device;
@@ -96,8 +97,8 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx, int max_refs)
break;
case IMGFMT_VDPAU_H264:
vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH;
- mp_msg(MSGT_VO, MSGL_V, "[vdpau] Creating H264 hardware decoder "
- "for %d reference frames.\n", max_refs);
+ MP_VERBOSE(p, "Creating H264 hardware decoder "
+ "for %d reference frames.\n", max_refs);
break;
case IMGFMT_VDPAU_WMV3:
vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN;
@@ -109,13 +110,13 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx, int max_refs)
vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
break;
default:
- mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unknown image format!\n");
+ MP_ERR(p, "Unknown image format!\n");
goto fail;
}
vdp_st = vdp->decoder_create(p->vdp_device, vdp_decoder_profile,
p->vid_width, p->vid_height, max_refs,
&p->decoder);
- CHECK_ST_WARNING("Failed creating VDPAU decoder");
+ CHECK_VDP_WARNING(p, "Failed creating VDPAU decoder");
if (vdp_st != VDP_STATUS_OK)
goto fail;
p->decoder_max_refs = max_refs;
@@ -152,7 +153,7 @@ static void draw_slice_hwdec(struct AVCodecContext *s,
(void *)&rndr->info,
rndr->bitstream_buffers_used,
rndr->bitstream_buffers);
- CHECK_ST_WARNING("Failed VDPAU decoder rendering");
+ CHECK_VDP_WARNING(p, "Failed VDPAU decoder rendering");
}
static void release_surface(void *ptr)
@@ -222,6 +223,7 @@ static int init(struct lavc_ctx *ctx)
{
struct priv *p = talloc_ptrtype(NULL, p);
*p = (struct priv) {
+ .log = mp_log_new(p, ctx->log, "vdpau"),
.mpvdp = ctx->hwdec_info->vdpau_ctx,
};
ctx->hwdec_priv = p;