~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/util/render/x11/imageXVDesk.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  xfree 4.0 XV extension desk mode
 
3
  Copyright (C) 2000  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#ifndef __IMAGEXVDESK_H
 
15
#define __IMAGEXVDESK_H
 
16
 
 
17
#include "xinit.h"
 
18
 
 
19
#include "../imageBase.h"
 
20
#include "../dither2YUV/dither2YUV.h"
 
21
 
 
22
#include <iostream.h>
 
23
#include <stdio.h>
 
24
#include <semaphore.h>
 
25
 
 
26
//#undef X11_XV
 
27
 
 
28
#define GUID_YUV12_PLANAR 0x32315659
 
29
#define GUID_I420_PLANAR  0x30323449
 
30
#define GUID_YUY2_PACKED  0x32595559
 
31
#define GUID_UYVY_PACKED  0x59565955
 
32
 
 
33
/**
 
34
   The XV extension dither yuv images in hardware and allows 
 
35
   scaling of images.
 
36
   But its currently not supported by many drivers.
 
37
 
 
38
*/
 
39
 
 
40
 
 
41
class ImageXVDesk : public ImageBase {
 
42
 
 
43
#ifdef X11_XV
 
44
  XvAdaptorInfo           *ai;
 
45
  XvEncodingInfo          *ei;
 
46
  XvAttribute             *at;
 
47
  XvImageFormatValues *fo;
 
48
 
 
49
  XvImage                *yuv_image;
 
50
  bool            keepRatio;
 
51
 
 
52
  int                 xv_port;
 
53
  int             imageID;
 
54
  
 
55
  int                     shmem_flag;
 
56
  XShmSegmentInfo yuv_shminfo;
 
57
#endif
 
58
  Dither2YUV*    ditherWrapper;
 
59
 
 
60
  int lSupport;
 
61
  XWindow* xWindow;
 
62
 
 
63
 public:
 
64
  ImageXVDesk();
 
65
  ~ImageXVDesk();
 
66
 
 
67
  void init(XWindow* xWindow, YUVPicture* pic = NULL);
 
68
 
 
69
  int support();
 
70
 
 
71
  int openImage(int imageMode);
 
72
  int closeImage();
 
73
 
 
74
  void ditherImage(YUVPicture* pic);
 
75
  void putImage();
 
76
 
 
77
  void setKeepRatio(bool enable);
 
78
  
 
79
 private:
 
80
  int haveXVSupport(XWindow* xWindow);
 
81
  void freeImage();
 
82
  void createImage(int id);
 
83
 
 
84
};
 
85
 
 
86
#endif