summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-08-06 12:16:30 +0200
committerJohns <johns98@gmx.net>2013-08-06 12:16:30 +0200
commit5265e68aa9a6b6550146c1e601dc715efdd74bb0 (patch)
treec38a46d47455a3f7c29fb7c364b770baa8a501f2 /video.c
parent11121b5bdde322fae4e2f73c477ff7095b1fa8a2 (diff)
downloadvdr-plugin-softhddevice-5265e68aa9a6b6550146c1e601dc715efdd74bb0.tar.gz
vdr-plugin-softhddevice-5265e68aa9a6b6550146c1e601dc715efdd74bb0.tar.bz2
Add function ResetStart to the video output module.
Diffstat (limited to 'video.c')
-rw-r--r--video.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/video.c b/video.c
index 930d8e8..3ad888d 100644
--- a/video.c
+++ b/video.c
@@ -264,6 +264,7 @@ typedef struct _video_module_
void (*const SetClock) (VideoHwDecoder *, int64_t);
int64_t(*const GetClock) (const VideoHwDecoder *);
void (*const SetClosing) (const VideoHwDecoder *);
+ void (*const ResetStart) (const VideoHwDecoder *);
void (*const SetTrickSpeed) (const VideoHwDecoder *, int);
uint8_t *(*const GrabOutput)(int *, int *, int *);
void (*const SetBackground) (uint32_t);
@@ -4810,7 +4811,7 @@ static int64_t VaapiGetClock(const VaapiDecoder * decoder)
///
/// Set VA-API decoder closing stream flag.
///
-/// @param decoder VA-API decoder
+/// @param decoder VA-API decoder
///
static void VaapiSetClosing(VaapiDecoder * decoder)
{
@@ -4818,6 +4819,16 @@ static void VaapiSetClosing(VaapiDecoder * decoder)
}
///
+/// Reset start of frame counter.
+///
+/// @param decoder VA-API decoder
+///
+static void VaapiResetStart(VaapiDecoder * decoder)
+{
+ decoder->StartCounter = 0;
+}
+
+///
/// Set trick play speed.
///
/// @param decoder VA-API decoder
@@ -5390,6 +5401,7 @@ static const VideoModule VaapiModule = {
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VaapiSetClosing,
+ .ResetStart = (void (*const) (const VideoHwDecoder *))VaapiResetStart,
.SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed,
.GrabOutput = NULL,
@@ -5429,6 +5441,7 @@ static const VideoModule VaapiGlxModule = {
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VaapiSetClosing,
+ .ResetStart = (void (*const) (const VideoHwDecoder *))VaapiResetStart,
.SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed,
.GrabOutput = NULL,
@@ -8396,7 +8409,7 @@ static int64_t VdpauGetClock(const VdpauDecoder * decoder)
///
/// Set VDPAU decoder closing stream flag.
///
-/// @param decoder VDPAU decoder
+/// @param decoder VDPAU decoder
///
static void VdpauSetClosing(VdpauDecoder * decoder)
{
@@ -8404,6 +8417,16 @@ static void VdpauSetClosing(VdpauDecoder * decoder)
}
///
+/// Reset start of frame counter.
+///
+/// @param decoder VDPAU decoder
+///
+static void VdpauResetStart(VdpauDecoder * decoder)
+{
+ decoder->StartCounter = 0;
+}
+
+///
/// Set trick play speed.
///
/// @param decoder VDPAU decoder
@@ -9121,6 +9144,7 @@ static const VideoModule VdpauModule = {
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VdpauSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VdpauGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VdpauSetClosing,
+ .ResetStart = (void (*const) (const VideoHwDecoder *))VdpauResetStart,
.SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VdpauSetTrickSpeed,
.GrabOutput = VdpauGrabOutputSurface,
@@ -9279,6 +9303,7 @@ static const VideoModule NoopModule = {
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))NoopSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))NoopGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))NoopSetClosing,
+ .ResetStart = (void (*const) (const VideoHwDecoder *))NoopResetStart,
.SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))NoopSetTrickSpeed,
.GrabOutput = NoopGrabOutputSurface,
@@ -9999,17 +10024,7 @@ void VideoSetClosing(VideoHwDecoder * hw_decoder)
void VideoResetStart(VideoHwDecoder * hw_decoder)
{
Debug(3, "video: reset start\n");
- // FIXME: test to check if working, than make module function
-#ifdef USE_VDPAU
- if (VideoUsedModule == &VdpauModule) {
- hw_decoder->Vdpau.StartCounter = 0;
- }
-#endif
-#ifdef USE_VAAPI
- if (VideoUsedModule == &VaapiModule) {
- hw_decoder->Vaapi.StartCounter = 0;
- }
-#endif
+ VideoUsedModule->ResetStart(hw_decoder);
// clear clock to trigger new video stream
VideoSetClock(hw_decoder, AV_NOPTS_VALUE);
}
@@ -10022,7 +10037,8 @@ void VideoResetStart(VideoHwDecoder * hw_decoder)
///
void VideoSetTrickSpeed(VideoHwDecoder * hw_decoder, int speed)
{
- return VideoUsedModule->SetTrickSpeed(hw_decoder, speed);
+ Debug(3, "video: set trick-speed %d\n", speed);
+ VideoUsedModule->SetTrickSpeed(hw_decoder, speed);
}
///