/usr/include/avifile-0.7/renderer.h is in libavifile-0.7-dev 1:0.7.48~20090503.ds-18.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | #ifndef AVIFILE_RENDERER_H
#define AVIFILE_RENDERER_H
#include "avm_stl.h"
#include "image.h"
#include "subtitle.h"
AVM_BEGIN_NAMESPACE;
class IPlayerWidget;
/** Structure for describtion of video mode */
struct VideoMode
{
/// width of the screen
int width;
/// height of the screen
int height;
/// vertical refresh frequency
float freq;
/// textual representation for this mode
avm::string name;
VideoMode(int w = 0, int h = 0, float f = 0.);
};
/**
* Abstract interface for video rendering
*
* One day we may support more renderers
* We do not want to have any XFree specific stuff here
*/
class IVideoRenderer : public IImageAllocator
{
public:
enum Property {
SYNC,
REFRESH,
FULLSCREEN, // true - maximize with FULLSCREEN toggle
DRAW_CIMAGE, // CImage*
DRAW_SUBTITLES,
WINDOW_SIZE = 100, // int* width, int* height
WINDOW_POSITION, // get*/set int* x, int* y
WINDOW_CAPTION, // char*
SUBTITLE_FONT, // char*
SUBTITLE_POSITION, // get*/set int* y
SUBTITLE_VISIBLE,
VIDEO_MODES, // avm::vector<VideoMode> - list of video modes
VIDEO_OVERLAYS, // avm::vector<fcctype_t> - list of overlay
LAST
};
enum Cursor {
NORMAL,
ZOOMLU,
ZOOMRB
};
/**
* Allow YUV renderer to use software YUV->RGB conversion
* ( slow, only for testing purposes )
* SDL has very fast implementation - used now
*/
static bool allow_sw_yuv;
virtual ~IVideoRenderer() {}
// possible new interface???
virtual int Set(...) = 0;
virtual int Get(...) const = 0;
#if 1
/**
* Issues the request to draw the image in the window memory
* might be empty when direct rendering is being used
*/
virtual int Draw(const CImage* data) = 0;
/**
* Draws a line of subtitles below the picture.
*/
virtual int DrawSubtitles(const subtitle_line_t* sl) { return -1; }
/**
* Returns actual size of the rendered image
*/
virtual int GetSize(int& width, int& height) const { return -1; }
/**
* Returns actual x, y coordinates of the window.
*/
virtual int GetPosition(int& x, int& y) const { return -1; }
/**
* Returns available video modes
*/
virtual const avm::vector<VideoMode>& GetVideoModes() const = 0;
/**
* Returns runtime configurable parameters
*/
virtual IRtConfig* GetRtConfig() const { return 0; }
/**
* Called to blit image on the screen
*/
virtual int Sync() = 0;
/**
* Redraws image (resize, move with pause)
*/
virtual int Refresh() = 0;
/**
* Resizes renderer window and stretch the image in it.
*/
virtual int Resize(int& new_w, int& new_h) { return -1; }
/**
* Set window titlebar
* \param title window title name
* \param icon pathname to icon of the window
*/
virtual int SetCaption(const char* title, const char* icon) { return -1; }
/**
* Set font for subtitle
*/
virtual int SetFont(const char* font) { return -1; }
/**
* Set window position
* \param x coordinate
* \param y coordinate
*/
virtual int SetPosition(int x, int y) { return -1; }
/**
* Toggle on/off fullscreen mode. maximize=true means that
* renderer should stretch the picture to dimensions of
* screen when going fullscreen without changing screen mode.
*/
virtual int ToggleFullscreen(bool maximize = false) { return -1; }
/**
* Pick area in the image which is displayed in the given window
* \param x coordinate for the begining of zoomed area
* \param y coordinate for the begining of zoomed area
* \param width width of zoomed area (0 disables zooming)
* \param height height of zoomed area (0 disables zooming)
*/
virtual int Zoom(int x, int y, int width, int height) { return -1; }
virtual int SetCursor(Cursor cursor) { return -1; }
#endif
virtual int Lock() const = 0;
virtual int TryLock() const = 0;
virtual int Unlock() const = 0;
};
#ifndef X_DISPLAY_MISSING
/**
* Creates SDL video renderer for RGB data in current depth of
* display from 2nd argument. Last argument specifies whether
* this renderer should reserve place for subtitles or not.
*/
AVMEXPORT IVideoRenderer* CreateFullscreenRenderer(IPlayerWidget*, void* dpy,
int width, int height, bool sub = false);
/**
* Creates SDL video renderer for YUV data in format yuv_fmt.
* If it fails ( e.g. because yuv_fmt is not supported by X server
* and VideoRenderer::allow_sw_yuv==false ), returns pointer to
* 'ordinary' fullscreen renderer and puts 0 into yuv_fmt.
*/
AVMEXPORT IVideoRenderer* CreateYUVRenderer(IPlayerWidget*, void* dpy,
int width, int height,
fourcc_t yuv_fmt, bool sub = false);
/*
VideoRenderer* CreateXvYUVRenderer(PlayerWidget*, void* dpy,
int width, int height,
fourcc_t yuv_fmt, bool sub = false);
*/
/**
* Function that returns actual bit depth of specified X display.
* Should be used instead of any other functions with similar
* purpose ( DefaultDepth(), x11Depth() in Qt ) when determining
* bit depth of data to pass to renderer.
*/
AVMEXPORT int GetPhysicalDepth(void* dpy);
#else
static inline int GetPhysicalDepth(void* dpy) { return 0; }
#endif // X_DISPLAY_MISSING
AVM_END_NAMESPACE;
#ifdef AVM_COMPATIBLE
typedef avm::VideoMode VideoMode;
typedef avm::IVideoRenderer VideoRenderer;
#ifndef X_DISPLAY_MISSING
static inline VideoRenderer* CreateFullscreenRenderer(avm::IPlayerWidget* pw, void* dpy,
int width, int height, bool sub = false)
{
return avm::CreateFullscreenRenderer(pw, dpy, width, height, sub);
}
static inline VideoRenderer* CreateYUVRenderer(avm::IPlayerWidget* pw, void* dpy,
int width, int height,
fourcc_t yuv_fmt, bool sub = false)
{
return avm::CreateYUVRenderer(pw, dpy, width, height, yuv_fmt, sub);
}
#endif // X_DISPLAY_MISSING
static inline int GetPhysicalDepth(void* dpy) { return avm::GetPhysicalDepth(dpy); }
#endif // AVM_COMPATIBLE
#endif // AVIFILE_RENDERER_H
|