~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to noatun/noatun/avideoframe.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
    /*
2
 
 
3
 
    Copyright (C) 2000 Stefan Westerfeld
4
 
                       stefan@space.twc.de
5
 
 
6
 
    This library is free software; you can redistribute it and/or
7
 
    modify it under the terms of the GNU Library General Public
8
 
    License as published by the Free Software Foundation; either
9
 
    version 2 of the License, or (at your option) any later version.
10
 
  
11
 
    This library is distributed in the hope that it will be useful,
12
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
    Library General Public License for more details.
15
 
   
16
 
    You should have received a copy of the GNU Library General Public License
17
 
    along with this library; see the file COPYING.LIB.  If not, write to
18
 
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
    Boston, MA 02111-1307, USA.
20
 
 
21
 
    */
22
 
 
23
 
/*===========================================================================*
24
 
 
25
 
  Experimental aRts video support stuff:
26
 
 
27
 
  This video support stuff will eventually go to kdelibs/arts if it works.
28
 
  There are a two things that are important for that reason
29
 
 
30
 
    - keep LGPL licensing
31
 
    - do *not* use Qt in Videocodecs, VideoFrame class, ...
32
 
 
33
 
  Besides this, here the current state of the art. mcopidl supports now, with
34
 
  a hack, to define custom packet types. So you can define streams of
35
 
  AVideoFrames with some flags (-P AVideoFrame defines a new custom packet
36
 
  type for asynchronous streaming and -C "avideoframe.h" tells mcopidl to
37
 
  include this header file, so that the classes are defined).
38
 
 
39
 
  So what games can we play with this:
40
 
   - implement more of the AVideoFrame class
41
 
   - implement some of the interfaces specified in the artsvideo.idl file
42
 
   - connect stuff together, and use it using connect() and start()
43
 
   - try to find an optimal rendering strategy
44
 
   - write the marshalling functions and laugh how slooow it is over network ;)
45
 
 
46
 
  Issues that need work (but are not even touched yet):
47
 
   - threading (people at least told me that they want threads for video)
48
 
   - trading (how to find a codec that supports mimetype xyz)
49
 
   - tighter communication between native classes and mcop typed stuff
50
 
     (i.e. how do I tell my renderer a QWidget to render to)
51
 
   - stream format (should the format be more than just "VideoFrame"?
52
 
     should it be possible to "see" before connecting which resolution
53
 
         and which colorspace a stream is using)
54
 
   - using shared memory for efficient IPC when running locally
55
 
   - audio, audio/video synchronization
56
 
  
57
 
 *===========================================================================*/
58
 
 
59
 
#include "asyncstream.h"
60
 
#include "datapacket.h"
61
 
 
62
 
class AVideoFrame
63
 
{
64
 
public:
65
 
        /* put video data, format, colorspace and similar for one frame in here */
66
 
        unsigned int width;
67
 
        unsigned int height;
68
 
        
69
 
        unsigned long length;
70
 
        char *data;
71
 
};
72
 
 
73
 
class AVideoFrameAsyncStream : public Arts::AsyncStream<AVideoFrame>
74
 
{
75
 
public:
76
 
        Arts::DataPacket<AVideoFrame> *allocPacket(int capacity);
77
 
        Arts::GenericAsyncStream *createNewStream();
78
 
};                                                                              
79
 
 
80
 
 
81
 
class AVideoFrameDataPacket : public Arts::DataPacket<AVideoFrame> {
82
 
public:
83
 
    AVideoFrameDataPacket(int capacity, Arts::GenericDataChannel *channel)
84
 
            : Arts::DataPacket<AVideoFrame>(capacity, channel)
85
 
    {
86
 
        //
87
 
    }
88
 
    void read(Arts::Buffer& stream);
89
 
    void write(Arts::Buffer& stream);
90
 
};