Add function SetClosing to the video output module.

This commit is contained in:
Johns 2013-08-04 17:43:11 +02:00
parent d8e96c7871
commit 11121b5bdd
2 changed files with 30 additions and 14 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Add function SetClosing to the video output module.
Generalize GetVaapiContext to GetHwAccelContext. Generalize GetVaapiContext to GetHwAccelContext.
Add compile time configurable trickspeed packets dump. Add compile time configurable trickspeed packets dump.
Fix bug #1410: wrong spelled AC-3 and E-AC-3. Fix bug #1410: wrong spelled AC-3 and E-AC-3.

39
video.c
View File

@ -263,6 +263,7 @@ typedef struct _video_module_
void *(*const GetHwAccelContext)(VideoHwDecoder *); void *(*const GetHwAccelContext)(VideoHwDecoder *);
void (*const SetClock) (VideoHwDecoder *, int64_t); void (*const SetClock) (VideoHwDecoder *, int64_t);
int64_t(*const GetClock) (const VideoHwDecoder *); int64_t(*const GetClock) (const VideoHwDecoder *);
void (*const SetClosing) (const VideoHwDecoder *);
void (*const SetTrickSpeed) (const VideoHwDecoder *, int); void (*const SetTrickSpeed) (const VideoHwDecoder *, int);
uint8_t *(*const GrabOutput)(int *, int *, int *); uint8_t *(*const GrabOutput)(int *, int *, int *);
void (*const SetBackground) (uint32_t); void (*const SetBackground) (uint32_t);
@ -4583,7 +4584,7 @@ static void VaapiRenderFrame(VaapiDecoder * decoder,
/// ///
static void *VaapiGetHwAccelContext(VaapiDecoder * decoder) static void *VaapiGetHwAccelContext(VaapiDecoder * decoder)
{ {
return decoder->Vaapi.VaapiContext; return decoder->VaapiContext;
} }
/// ///
@ -4806,6 +4807,16 @@ static int64_t VaapiGetClock(const VaapiDecoder * decoder)
2); 2);
} }
///
/// Set VA-API decoder closing stream flag.
///
/// @param decoder VA-API decoder
///
static void VaapiSetClosing(VaapiDecoder * decoder)
{
decoder->Closing = 1;
}
/// ///
/// Set trick play speed. /// Set trick play speed.
/// ///
@ -5378,6 +5389,7 @@ static const VideoModule VaapiModule = {
VaapiGetHwAccelContext, VaapiGetHwAccelContext,
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VaapiSetClosing,
.SetTrickSpeed = .SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed, (void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed,
.GrabOutput = NULL, .GrabOutput = NULL,
@ -5416,6 +5428,7 @@ static const VideoModule VaapiGlxModule = {
VaapiGetHwAccelContext, VaapiGetHwAccelContext,
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VaapiSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VaapiGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VaapiSetClosing,
.SetTrickSpeed = .SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed, (void (*const) (const VideoHwDecoder *, int))VaapiSetTrickSpeed,
.GrabOutput = NULL, .GrabOutput = NULL,
@ -8380,6 +8393,16 @@ static int64_t VdpauGetClock(const VdpauDecoder * decoder)
2); 2);
} }
///
/// Set VDPAU decoder closing stream flag.
///
/// @param decoder VDPAU decoder
///
static void VdpauSetClosing(VdpauDecoder * decoder)
{
decoder->Closing = 1;
}
/// ///
/// Set trick play speed. /// Set trick play speed.
/// ///
@ -9097,6 +9120,7 @@ static const VideoModule VdpauModule = {
VdpauGetHwAccelContext, VdpauGetHwAccelContext,
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))VdpauSetClock, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))VdpauSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))VdpauGetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))VdpauGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))VdpauSetClosing,
.SetTrickSpeed = .SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))VdpauSetTrickSpeed, (void (*const) (const VideoHwDecoder *, int))VdpauSetTrickSpeed,
.GrabOutput = VdpauGrabOutputSurface, .GrabOutput = VdpauGrabOutputSurface,
@ -9254,6 +9278,7 @@ static const VideoModule NoopModule = {
DummyGetHwAccelContext, DummyGetHwAccelContext,
.SetClock = (void (*const) (VideoHwDecoder *, int64_t))NoopSetClock, .SetClock = (void (*const) (VideoHwDecoder *, int64_t))NoopSetClock,
.GetClock = (int64_t(*const) (const VideoHwDecoder *))NoopGetClock, .GetClock = (int64_t(*const) (const VideoHwDecoder *))NoopGetClock,
.SetClosing = (void (*const) (const VideoHwDecoder *))NoopSetClosing,
.SetTrickSpeed = .SetTrickSpeed =
(void (*const) (const VideoHwDecoder *, int))NoopSetTrickSpeed, (void (*const) (const VideoHwDecoder *, int))NoopSetTrickSpeed,
.GrabOutput = NoopGrabOutputSurface, .GrabOutput = NoopGrabOutputSurface,
@ -9961,17 +9986,7 @@ int64_t VideoGetClock(const VideoHwDecoder * hw_decoder)
void VideoSetClosing(VideoHwDecoder * hw_decoder) void VideoSetClosing(VideoHwDecoder * hw_decoder)
{ {
Debug(3, "video: set closing\n"); Debug(3, "video: set closing\n");
// FIXME: test to check if working, than make module function VideoUsedModule->SetClosing(hw_decoder);
#ifdef USE_VDPAU
if (VideoUsedModule == &VdpauModule) {
hw_decoder->Vdpau.Closing = 1;
}
#endif
#ifdef USE_VAAPI
if (VideoUsedModule == &VaapiModule) {
hw_decoder->Vaapi.Closing = 1;
}
#endif
// clear clock to avoid further sync // clear clock to avoid further sync
VideoSetClock(hw_decoder, AV_NOPTS_VALUE); VideoSetClock(hw_decoder, AV_NOPTS_VALUE);
} }