GIFT-Grab  1708
Copyright (c) 2015-7, University College London (UCL)
videosourcefactory.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ivideosource.h"
4 #include "device.h"
5 #include "codec.h"
6 
7 namespace gg
8 {
9 
26 {
27 protected:
36 
43 
44 protected:
51 
52 public:
57  virtual ~VideoSourceFactory();
58 
59 public:
66 
97  IVideoSource * get_device(enum Device device,
98  enum ColourSpace colour);
99 
110  void free_device(enum Device device);
111 
128  IVideoSource * connect_network_source(std::string address,
129  enum ColourSpace colour);
130 
152  IVideoSource * create_file_reader(const std::string filepath,
153  enum ColourSpace colour_space);
154 
155 protected:
157 };
158 
164 static VideoSourceFactory& _video_source_factory = VideoSourceFactory::get_instance();
165 
166 }
ColourSpace
Supported colour spaces.
Definition: videoframe.h:29
IVideoSource * create_file_reader(const std::string filepath, enum ColourSpace colour_space)
Create a reader to read colour_space frames format from filepath.
Definition: videosourcefactory.cpp:335
This abstract class defines the interface that every video source must implement. ...
Definition: ivideosource.h:15
IVideoSource * connect_network_source(std::string address, enum ColourSpace colour)
Open connection to network connection specified by given address.
Definition: videosourcefactory.cpp:291
IVideoSource * get_device(enum Device device, enum ColourSpace colour)
Try to connect to specified device for capturing video with specified colour space.
Definition: videosourcefactory.cpp:41
Definition: broadcastdaemon.cpp:7
Definition: device.h:16
IVideoSource * _devices[Device::COUNT]
So that can keep track of everything opened and in use.
Definition: videosourcefactory.h:35
ColourSpace _device_colours[Device::COUNT]
At a single point in time, only one connection using only one colour space may exist.
Definition: videosourcefactory.h:42
Device
Lists supported framegrabber hardware.
Definition: device.h:9
virtual ~VideoSourceFactory()
Free all connected devices.
Definition: videosourcefactory.cpp:28
This class implements the factory design pattern for creating connections to supported video sources...
Definition: videosourcefactory.h:25
DISALLOW_COPY_AND_ASSIGNMENT(VideoSourceFactory)
VideoSourceFactory()
The constructor should never be publicly called.
Definition: videosourcefactory.cpp:22
static VideoSourceFactory & get_instance()
Get reference to singleton instance of this class.
Definition: videosourcefactory.cpp:35
void free_device(enum Device device)
Close connection to specified device, if existing.
Definition: videosourcefactory.cpp:268