diff options
author | Johns <johns98@gmx.net> | 2013-08-03 17:27:52 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-08-03 17:27:52 +0200 |
commit | d8e96c7871078d376de02210d2c350998f5a1fba (patch) | |
tree | c938e0c8881f39e3d17af39c6e08fa99b928a9fc | |
parent | 8ff65a011a6e6a76167734b21c3eb7dac9a905b1 (diff) | |
download | vdr-plugin-softhddevice-d8e96c7871078d376de02210d2c350998f5a1fba.tar.gz vdr-plugin-softhddevice-d8e96c7871078d376de02210d2c350998f5a1fba.tar.bz2 |
Generalize GetVaapiContext to GetHwAccelContext.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | codec.c | 2 | ||||
-rw-r--r-- | po/de_DE.po | 8 | ||||
-rw-r--r-- | softhddev.c | 5 | ||||
-rw-r--r-- | video.c | 51 | ||||
-rw-r--r-- | video.h | 4 |
6 files changed, 47 insertions, 24 deletions
@@ -1,6 +1,7 @@ User johns Date: + Generalize GetVaapiContext to GetHwAccelContext. Add compile time configurable trickspeed packets dump. Fix bug #1410: wrong spelled AC-3 and E-AC-3. Add compile time selectable h264 trickspeed workaround. @@ -483,7 +483,7 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id) } else { decoder->VideoCtx->get_format = Codec_get_format; decoder->VideoCtx->hwaccel_context = - VideoGetVaapiContext(decoder->HwDecoder); + VideoGetHwAccelContext(decoder->HwDecoder); } // our pixel format video hardware decoder hook diff --git a/po/de_DE.po b/po/de_DE.po index 5e4d6ac..91867ef 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR \n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-07-25 13:22+0200\n" +"POT-Creation-Date: 2013-08-03 17:21+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -1272,6 +1272,9 @@ msgstr "" msgid "video/vdpau: can't put video surface bits: %s\n" msgstr "" +msgid "video: get hwaccel context, not supported\n" +msgstr "" + #, c-format msgid "video/vdpau: can't render bitmap surface: %s\n" msgstr "" @@ -1338,9 +1341,6 @@ msgstr "" msgid "video: repeated pict %d found, but not handled\n" msgstr "" -msgid "video/vaapi: get vaapi context, without vaapi enabled\n" -msgstr "" - #, c-format msgid "video/vdpau: decoder rendering failed: %s\n" msgstr "" diff --git a/softhddev.c b/softhddev.c index e3787bd..b11e43a 100644 --- a/softhddev.c +++ b/softhddev.c @@ -22,7 +22,7 @@ #define noUSE_SOFTLIMIT ///< add soft buffer limits to Play.. #define noUSE_PIP ///< include PIP support + new API -#define DUMP_TRICKSPEED ///< dump raw trickspeed packets +#define noDUMP_TRICKSPEED ///< dump raw trickspeed packets #include <sys/types.h> #include <sys/stat.h> @@ -2448,7 +2448,8 @@ uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height) int SetPlayMode(int play_mode) { VideoDisplayWakeup(); - if (MyVideoStream->Decoder) { // tell video parser we have new stream + // tell video parser we have new stream + if (MyVideoStream->Decoder && !MyVideoStream->SkipStream) { if (MyVideoStream->ClearClose) { // replay clear buffers on close Clear(); // flush all buffers MyVideoStream->ClearClose = 0; @@ -260,6 +260,7 @@ typedef struct _video_module_ const enum PixelFormat *); void (*const RenderFrame) (VideoHwDecoder *, const AVCodecContext *, const AVFrame *); + void *(*const GetHwAccelContext)(VideoHwDecoder *); void (*const SetClock) (VideoHwDecoder *, int64_t); int64_t(*const GetClock) (const VideoHwDecoder *); void (*const SetTrickSpeed) (const VideoHwDecoder *, int); @@ -4576,6 +4577,16 @@ static void VaapiRenderFrame(VaapiDecoder * decoder, } /// +/// Get hwaccel context for ffmpeg. +/// +/// @param decoder VA-API hw decoder +/// +static void *VaapiGetHwAccelContext(VaapiDecoder * decoder) +{ + return decoder->Vaapi.VaapiContext; +} + +/// /// Advance displayed frame of decoder. /// /// @param decoder VA-API hw decoder @@ -5363,6 +5374,8 @@ static const VideoModule VaapiModule = { AVCodecContext *, const enum PixelFormat *))Vaapi_get_format, .RenderFrame = (void (*const) (VideoHwDecoder *, const AVCodecContext *, const AVFrame *))VaapiSyncRenderFrame, + .GetHwAccelContext = (void *(*const)(VideoHwDecoder *)) + VaapiGetHwAccelContext, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock, .SetTrickSpeed = @@ -5399,6 +5412,8 @@ static const VideoModule VaapiGlxModule = { AVCodecContext *, const enum PixelFormat *))Vaapi_get_format, .RenderFrame = (void (*const) (VideoHwDecoder *, const AVCodecContext *, const AVFrame *))VaapiSyncRenderFrame, + .GetHwAccelContext = (void *(*const)(VideoHwDecoder *)) + VaapiGetHwAccelContext, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock, .SetTrickSpeed = @@ -7843,6 +7858,20 @@ static void VdpauRenderFrame(VdpauDecoder * decoder, } /// +/// Get hwaccel context for ffmpeg. +/// +/// @param decoder VDPAU hw decoder +/// +static void *VdpauGetHwAccelContext(VdpauDecoder * decoder) +{ + (void)decoder; + + // FIXME: new ffmpeg versions supports struct AVVDPAUContext + Error(_("video: get hwaccel context, not supported\n")); + return NULL; +} + +/// /// Render osd surface to output surface. /// static void VdpauMixOsd(void) @@ -9064,6 +9093,8 @@ static const VideoModule VdpauModule = { AVCodecContext *, const enum PixelFormat *))Vdpau_get_format, .RenderFrame = (void (*const) (VideoHwDecoder *, const AVCodecContext *, const AVFrame *))VdpauSyncRenderFrame, + .GetHwAccelContext = (void *(*const)(VideoHwDecoder *)) + VdpauGetHwAccelContext, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VdpauSetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VdpauGetClock, .SetTrickSpeed = @@ -9219,6 +9250,8 @@ static const VideoModule NoopModule = { AVCodecContext *, const enum PixelFormat *))Noop_get_format, .RenderFrame = (void (*const) (VideoHwDecoder *, const AVCodecContext *, const AVFrame *))NoopSyncRenderFrame, + .GetHwAccelContext = (void *(*const)(VideoHwDecoder *)) + DummyGetHwAccelContext, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))NoopSetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))NoopGetClock, .SetTrickSpeed = @@ -9817,27 +9850,15 @@ void VideoRenderFrame(VideoHwDecoder * hw_decoder, } /// -/// Get VA-API ffmpeg context +/// Get hwaccel context for ffmpeg. /// /// FIXME: new ffmpeg supports vdpau hw context /// /// @param hw_decoder video hardware decoder (must be VA-API) /// -struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder * hw_decoder) +void *VideoGetHwAccelContext(VideoHwDecoder * hw_decoder) { -#ifdef USE_VAAPI - if (VideoUsedModule == &VaapiModule) { - return hw_decoder->Vaapi.VaapiContext; - } -#ifdef USE_GLX - if (VideoUsedModule == &VaapiGlxModule) { - return hw_decoder->Vaapi.VaapiContext; - } -#endif -#endif - (void)hw_decoder; - Error(_("video/vaapi: get vaapi context, without vaapi enabled\n")); - return NULL; + return VideoUsedModule->GetHwAccelContext(hw_decoder); } #ifdef USE_VDPAU @@ -67,8 +67,8 @@ extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *, extern void VideoRenderFrame(VideoHwDecoder *, const AVCodecContext *, const AVFrame *); - /// Get ffmpeg vaapi context. -extern struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder *); + /// Get hwaccel context for ffmpeg. +extern void *VideoGetHwAccelContext(VideoHwDecoder *); #ifdef AVCODEC_VDPAU_H /// Draw vdpau render state. |