2011-12-07 15:05:38 +01:00
|
|
|
///
|
|
|
|
/// @file video.h @brief Video module header file
|
|
|
|
///
|
2013-01-01 14:48:51 +01:00
|
|
|
/// Copyright (c) 2009 - 2013 by Johns. All Rights Reserved.
|
2011-12-07 15:05:38 +01:00
|
|
|
///
|
|
|
|
/// Contributor(s):
|
|
|
|
///
|
|
|
|
/// License: AGPLv3
|
|
|
|
///
|
|
|
|
/// This program is free software: you can redistribute it and/or modify
|
|
|
|
/// it under the terms of the GNU Affero General Public License as
|
|
|
|
/// published by the Free Software Foundation, either version 3 of the
|
|
|
|
/// License.
|
|
|
|
///
|
|
|
|
/// This program is distributed in the hope that it will be useful,
|
|
|
|
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
/// GNU Affero General Public License for more details.
|
|
|
|
///
|
|
|
|
/// $Id$
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/// @addtogroup Video
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// Typedefs
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/// Video hardware decoder typedef
|
|
|
|
typedef struct _video_hw_decoder_ VideoHwDecoder;
|
|
|
|
|
2013-01-03 18:52:34 +01:00
|
|
|
/// Video output stream typedef
|
|
|
|
typedef struct __video_stream__ VideoStream;
|
|
|
|
|
2012-02-16 21:55:14 +01:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// Variables
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2012-07-03 15:48:44 +02:00
|
|
|
extern char VideoHardwareDecoder; ///< flag use hardware decoder
|
2012-02-16 21:55:14 +01:00
|
|
|
extern char VideoIgnoreRepeatPict; ///< disable repeat pict warning
|
2012-04-07 00:15:57 +02:00
|
|
|
extern int VideoAudioDelay; ///< audio/video delay
|
2013-03-06 17:07:30 +01:00
|
|
|
extern char ConfigStartX11Server; ///< flag start the x11 server
|
2012-02-16 21:55:14 +01:00
|
|
|
|
2011-12-07 15:05:38 +01:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// Prototypes
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/// Allocate new video hardware decoder.
|
2013-01-03 18:52:34 +01:00
|
|
|
extern VideoHwDecoder *VideoNewHwDecoder(VideoStream *);
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2012-01-19 00:16:15 +01:00
|
|
|
/// Deallocate video hardware decoder.
|
|
|
|
extern void VideoDelHwDecoder(VideoHwDecoder *);
|
|
|
|
|
2013-01-23 21:54:56 +01:00
|
|
|
#ifdef LIBAVCODEC_VERSION
|
2011-12-07 15:05:38 +01:00
|
|
|
/// Get and allocate a video hardware surface.
|
2013-01-23 21:54:56 +01:00
|
|
|
extern unsigned VideoGetSurface(VideoHwDecoder *, const AVCodecContext *);
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Release a video hardware surface
|
2011-12-07 15:05:38 +01:00
|
|
|
extern void VideoReleaseSurface(VideoHwDecoder *, unsigned);
|
|
|
|
|
2012-01-30 15:58:21 +01:00
|
|
|
/// Callback to negotiate the PixelFormat.
|
|
|
|
extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
|
|
|
|
const enum PixelFormat *);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Render a ffmpeg frame.
|
2012-01-30 15:58:21 +01:00
|
|
|
extern void VideoRenderFrame(VideoHwDecoder *, const AVCodecContext *,
|
|
|
|
const AVFrame *);
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Get ffmpeg vaapi context.
|
2011-12-07 15:05:38 +01:00
|
|
|
extern struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder *);
|
|
|
|
|
2011-12-23 19:33:30 +01:00
|
|
|
#ifdef AVCODEC_VDPAU_H
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Draw vdpau render state.
|
2011-12-23 19:33:30 +01:00
|
|
|
extern void VideoDrawRenderState(VideoHwDecoder *,
|
|
|
|
struct vdpau_render_state *);
|
|
|
|
#endif
|
2011-12-07 15:05:38 +01:00
|
|
|
#endif
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Poll video events.
|
2011-12-19 17:03:40 +01:00
|
|
|
extern void VideoPollEvent(void);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Wakeup display handler.
|
|
|
|
extern void VideoDisplayWakeup(void);
|
|
|
|
|
2012-03-07 15:31:43 +01:00
|
|
|
/// Set video device.
|
|
|
|
extern void VideoSetDevice(const char *);
|
|
|
|
|
2012-08-13 16:57:36 +02:00
|
|
|
/// Get video driver name.
|
|
|
|
extern const char *VideoGetDriverName(void);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set video geometry.
|
2011-12-07 15:05:38 +01:00
|
|
|
extern int VideoSetGeometry(const char *);
|
|
|
|
|
2012-02-22 15:06:05 +01:00
|
|
|
/// Set 60Hz display mode.
|
|
|
|
extern void VideoSet60HzMode(int);
|
|
|
|
|
2012-03-06 12:16:47 +01:00
|
|
|
/// Set soft start audio/video sync.
|
|
|
|
extern void VideoSetSoftStartSync(int);
|
|
|
|
|
2012-04-20 15:40:14 +02:00
|
|
|
/// Set show black picture during channel switch.
|
|
|
|
extern void VideoSetBlackPicture(int);
|
|
|
|
|
2012-09-03 16:39:33 +02:00
|
|
|
/// Set brightness adjustment.
|
|
|
|
extern void VideoSetBrightness(int);
|
|
|
|
|
|
|
|
/// Set contrast adjustment.
|
|
|
|
extern void VideoSetContrast(int);
|
|
|
|
|
|
|
|
/// Set saturation adjustment.
|
|
|
|
extern void VideoSetSaturation(int);
|
|
|
|
|
|
|
|
/// Set hue adjustment.
|
|
|
|
extern void VideoSetHue(int);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set video output position.
|
2013-01-01 15:21:28 +01:00
|
|
|
extern void VideoSetOutputPosition(VideoHwDecoder *, int, int, int, int);
|
2012-01-07 22:36:06 +01:00
|
|
|
|
2012-01-10 15:53:54 +01:00
|
|
|
/// Set video mode.
|
|
|
|
extern void VideoSetVideoMode(int, int, int, int);
|
|
|
|
|
2013-01-01 14:48:51 +01:00
|
|
|
/// Set 4:3 display format.
|
|
|
|
extern void VideoSet4to3DisplayFormat(int);
|
|
|
|
|
|
|
|
/// Set other display format.
|
|
|
|
extern void VideoSetOtherDisplayFormat(int);
|
2012-02-01 16:50:48 +01:00
|
|
|
|
2012-01-13 16:31:29 +01:00
|
|
|
/// Set video fullscreen mode.
|
|
|
|
extern void VideoSetFullscreen(int);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set deinterlace.
|
2012-01-09 17:03:04 +01:00
|
|
|
extern void VideoSetDeinterlace(int[]);
|
2011-12-12 17:06:05 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set skip chroma deinterlace.
|
2012-01-09 17:03:04 +01:00
|
|
|
extern void VideoSetSkipChromaDeinterlace(int[]);
|
2012-01-05 17:20:44 +01:00
|
|
|
|
2012-02-14 22:29:17 +01:00
|
|
|
/// Set inverse telecine.
|
|
|
|
extern void VideoSetInverseTelecine(int[]);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set scaling.
|
2012-01-09 17:03:04 +01:00
|
|
|
extern void VideoSetScaling(int[]);
|
2011-12-12 17:06:05 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set denoise.
|
2012-01-09 17:03:04 +01:00
|
|
|
extern void VideoSetDenoise(int[]);
|
2012-01-05 17:20:44 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set sharpen.
|
2012-01-09 17:03:04 +01:00
|
|
|
extern void VideoSetSharpen(int[]);
|
2012-01-05 17:20:44 +01:00
|
|
|
|
2012-04-05 22:51:20 +02:00
|
|
|
/// Set cut top and bottom.
|
|
|
|
extern void VideoSetCutTopBottom(int[]);
|
2012-01-28 01:44:50 +01:00
|
|
|
|
2012-04-05 22:51:20 +02:00
|
|
|
/// Set cut left and right.
|
|
|
|
extern void VideoSetCutLeftRight(int[]);
|
2012-03-26 20:49:18 +02:00
|
|
|
|
2012-02-13 14:13:24 +01:00
|
|
|
/// Set studio levels.
|
|
|
|
extern void VideoSetStudioLevels(int);
|
|
|
|
|
2012-02-24 15:15:50 +01:00
|
|
|
/// Set background.
|
|
|
|
extern void VideoSetBackground(uint32_t);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Set audio delay.
|
2011-12-19 17:03:40 +01:00
|
|
|
extern void VideoSetAudioDelay(int);
|
|
|
|
|
2012-01-20 15:33:37 +01:00
|
|
|
/// Set auto-crop parameters.
|
2012-01-27 23:49:05 +01:00
|
|
|
extern void VideoSetAutoCrop(int, int, int);
|
2012-01-20 15:33:37 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Clear OSD.
|
2011-12-07 15:05:38 +01:00
|
|
|
extern void VideoOsdClear(void);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
/// Draw an OSD ARGB image.
|
2011-12-07 15:05:38 +01:00
|
|
|
extern void VideoOsdDrawARGB(int, int, int, int, const uint8_t *);
|
|
|
|
|
2012-01-18 15:15:37 +01:00
|
|
|
/// Get OSD size.
|
|
|
|
extern void VideoGetOsdSize(int *, int *);
|
|
|
|
|
2012-05-21 15:34:33 +02:00
|
|
|
/// Set OSD size.
|
|
|
|
extern void VideoSetOsdSize(int, int);
|
|
|
|
|
2012-10-30 16:50:31 +01:00
|
|
|
/// Set Osd 3D Mode
|
|
|
|
extern void VideoSetOsd3DMode(int);
|
|
|
|
|
2012-03-31 21:27:54 +02:00
|
|
|
/// Set video clock.
|
|
|
|
extern void VideoSetClock(VideoHwDecoder *, int64_t);
|
|
|
|
|
|
|
|
/// Get video clock.
|
|
|
|
extern int64_t VideoGetClock(const VideoHwDecoder *);
|
|
|
|
|
2012-04-17 16:45:27 +02:00
|
|
|
/// Set closing flag.
|
|
|
|
extern void VideoSetClosing(VideoHwDecoder *);
|
|
|
|
|
2012-04-21 12:59:04 +02:00
|
|
|
/// Reset start of frame counter
|
|
|
|
extern void VideoResetStart(VideoHwDecoder *);
|
|
|
|
|
2012-03-31 21:27:54 +02:00
|
|
|
/// Set trick play speed.
|
|
|
|
extern void VideoSetTrickSpeed(VideoHwDecoder *, int);
|
2011-12-14 18:01:03 +01:00
|
|
|
|
2012-01-20 21:46:22 +01:00
|
|
|
/// Grab screen.
|
2012-01-24 22:40:06 +01:00
|
|
|
extern uint8_t *VideoGrab(int *, int *, int *, int);
|
2012-01-20 21:46:22 +01:00
|
|
|
|
2012-04-30 14:47:08 +02:00
|
|
|
/// Grab screen raw.
|
|
|
|
extern uint8_t *VideoGrabService(int *, int *, int *);
|
|
|
|
|
2012-07-02 17:05:36 +02:00
|
|
|
/// Get decoder statistics.
|
|
|
|
extern void VideoGetStats(VideoHwDecoder *, int *, int *, int *, int *);
|
|
|
|
|
2012-10-10 17:26:49 +02:00
|
|
|
/// Get video stream size
|
|
|
|
extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *);
|
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
extern void VideoOsdInit(void); ///< Setup osd.
|
|
|
|
extern void VideoOsdExit(void); ///< Cleanup osd.
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2012-01-07 22:36:06 +01:00
|
|
|
extern void VideoInit(const char *); ///< Setup video module.
|
|
|
|
extern void VideoExit(void); ///< Cleanup and exit video module.
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2013-01-03 18:52:34 +01:00
|
|
|
/// Poll video input buffers.
|
|
|
|
extern int VideoPollInput(VideoStream *);
|
|
|
|
|
|
|
|
/// Decode video input buffers.
|
|
|
|
extern int VideoDecodeInput(VideoStream *);
|
|
|
|
|
|
|
|
/// Get number of input buffers.
|
|
|
|
extern int VideoGetBuffers(const VideoStream *);
|
2011-12-07 15:05:38 +01:00
|
|
|
|
2013-03-06 17:07:30 +01:00
|
|
|
/// Raise the frontend window
|
|
|
|
extern int VideoRaiseWindow();
|
|
|
|
|
2011-12-07 15:05:38 +01:00
|
|
|
/// @}
|