Lumiera  0.pre.03
»edit your freedom«
media-access-facade.hpp
Go to the documentation of this file.
1 /*
2  MEDIA-ACCESS-FACADE.hpp - functions for querying media file and channels.
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
35 #ifndef VAULT_INTERFACE_MEDIA_ACCESS_FACADE_H
36 #define VAULT_INTERFACE_MEDIA_ACCESS_FACADE_H
37 
38 
39 #include "lib/error.hpp"
40 #include "lib/depend.hpp"
41 #include "lib/time/timevalue.hpp"
42 
43 #include <string>
44 
45 
46 
47 namespace vault {
48 
49  using lib::time::Duration;
50  using std::string;
51 
52  struct MediaDesc;
53  struct ChanDesc;
54 
55 
56  /**************************************************************/
67  {
68  public:
69  typedef void* ChanHandle;
70 
72 
82  virtual MediaDesc& queryFile (string const& name) const;
83 
90  virtual ChanDesc queryChannel (MediaDesc&, uint chanNo) const;
91 
92  virtual ~MediaAccessFacade () {}
93  };
94 
95 
100  struct MediaDesc
101  {
108 
109  MediaDesc() : length(Duration::NIL) { }
110  };
111 
112 
113 
114 
119  struct ChanDesc
120  {
125  const char* chanID;
126 
133  const char* codecID;
134 
138  MediaAccessFacade::ChanHandle handle;
139 
140  ChanDesc (const char* chanName=0, const char* codec=0,
141  MediaAccessFacade::ChanHandle h=0)
142  : chanID(chanName),
143  codecID(codec),
144  handle(h)
145  { }
146  };
147 
148 } // namespace vault
149 
150 
151 namespace backend_interface {
152 
154  using vault::MediaDesc;
155  using vault::ChanDesc;
156 
157 } // namespace backend_interface
158 #endif
virtual MediaDesc & queryFile(string const &name) const
request for testing the denoted files accessibility
MediaAccessFacade::ChanHandle handle
opaque handle, which will be used later to open this channel and retrieve some frames from it ...
virtual ChanDesc queryChannel(MediaDesc &, uint chanNo) const
request for information about the n-th channel of the file referred by FileHandle.
Descriptor holding the global information record required for further handling this kind of media wit...
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
Duration length
effectively usable duration.
Interface to the vault layer: provides functions for querying (opening) a media file, detecting the channels or streams found within this file etc.
const char * codecID
identifier characterising the access method (or codec) needed to get at the media data...
Singleton services and Dependency Injection.
Lumiera error handling (C++ interface).
static lib::Depend< MediaAccessFacade > instance
storage for the SingletonFactory (actually a lumiera::test::MockInjector)
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:477
abstract entry, not yet allocated
a family of time value like entities and their relationships.
Vault-Layer implementation namespace root.
Description of one channel found in a media file; result of querying the channel. ...
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption
const char * chanID
identifier which can be used to create a name for the media asset corresponding to this channel...