SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
slip::AvReader< VideoContainer, T, Nb_components, Nb_block > Class Template Reference

AvReader, inherited from ContainerReader, is a reader for videos. More...

#include <AvReader.hpp>

Inheritance diagram for slip::AvReader< VideoContainer, T, Nb_components, Nb_block >:
Inheritance graph

Public Types

typedef VideoContainer container_type
 
typedef T value_type
 
typedef ContainerReader
< VideoContainer, T, Nb_block > 
base
 

Public Member Functions

void initialize ()
 initialized the reading process. More...
 
void release ()
 release the reading process. More...
 
int read (VideoContainer &in)
 virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1. More...
 
Constructors & Destructors
 AvReader ()
 
 AvReader (std::string data_filename)
 
virtual ~AvReader ()
 
Getters
AVCodec * get_codec () const
 get the codec pointer More...
 
CodecID get_codec_id () const
 get the codec id (see avcodec.h : enum AVCodecID) More...
 
int get_read_frames () const
 get the number of read frames More...
 
int get_nb_frames () const
 get the total number of frames More...
 
int get_bit_rate () const
 get the the average bit rate of the codec More...
 
std::size_t get_frame_width () const
 get the width of a decoded frame picture More...
 
std::size_t get_frame_height () const
 get the height of a decoded frame picture More...
 
AVRational get_time_base () const
 get the time base of the video stream (1/framerate) More...
 
int64_t get_duration () const
 get the duration of the video stream More...
 
Getters and setters
const std::string & get_data_filename () const
 return the name of the file containing the data to read More...
 
void set_data_filename (const std::string &data_filename)
 
std::size_t get_nb_block () const
 return the number of splitting blocks of the data More...
 

Protected Attributes

std::string data_filename_
 

Detailed Description

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
class slip::AvReader< VideoContainer, T, Nb_components, Nb_block >

AvReader, inherited from ContainerReader, is a reader for videos.

Version
Fluex 1.0
Date
2013/04/24
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
VideoContainershould be a 3d Container with a component number equal to Nb_components. The [][] operator and the slices(), the rows() and the cols() methods should have been defined.
Tthe type of the container data.
Nb_componentsthe number of frames components (3 for a color video or 1 for a gray scale video).
Nb_blockis the number of containers to create (>1 if one want to split the input data into different containers, default is 1). Notice that the video data is always cut according to the time dimension which must be the first dimension of the input container (or slices dimension). In other words each container will contain a set of frames which size depends on the Nb_block.
Precondition
VideoContainer should have Nb_components components.
Nb_components should be 1 or 3.
Axis conventions (dim1 = slices, dim2 = rows, dim3 = cols):
video_axis_conventions.jpg
axis and notation conventions
Examples:
av_file_io.cpp, and fits_file_io.cpp.

Definition at line 49 of file AvReader.hpp.

Member Typedef Documentation

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef ContainerReader<VideoContainer,T,Nb_block> slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::base

Definition at line 53 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef VideoContainer slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::container_type

Definition at line 51 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
typedef T slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::value_type

Definition at line 52 of file AvReader.hpp.

Constructor & Destructor Documentation

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::AvReader ( )
inline

Default constructor

Definition at line 63 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::AvReader ( std::string  data_filename)
inline

Constructor with parameters.

Parameters
data_filenameis the name of the file containing the data to read
Note
this constructor automatically call the initialize() method.

Definition at line 74 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
virtual slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::~AvReader ( )
inlinevirtual

Destructor

Note
the release() method is called.

Definition at line 84 of file AvReader.hpp.

Member Function Documentation

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
int slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_bit_rate ( ) const
inline

get the the average bit rate of the codec

Returns
0 if no codec has been read

Definition at line 160 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
AVCodec* slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_codec ( ) const
inline

get the codec pointer

Returns
the AVCodec * of the file

Definition at line 124 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
CodecID slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_codec_id ( ) const
inline

get the codec id (see avcodec.h : enum AVCodecID)

Returns
CODEC_ID_NONE if no codec has been defined.

Definition at line 135 of file AvReader.hpp.

const std::string& slip::ContainerReader< VideoContainer , T, Nb_block >::get_data_filename ( ) const
inherited

return the name of the file containing the data to read

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
int64_t slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_duration ( ) const
inline

get the duration of the video stream

Returns
0 if not defined

Definition at line 204 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
std::size_t slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_frame_height ( ) const
inline

get the height of a decoded frame picture

Returns
0 if no codec has been read

Definition at line 182 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
std::size_t slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_frame_width ( ) const
inline

get the width of a decoded frame picture

Returns
0 if no codec has been read

Definition at line 171 of file AvReader.hpp.

std::size_t slip::ContainerReader< VideoContainer , T, Nb_block >::get_nb_block ( ) const
inherited

return the number of splitting blocks of the data

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
int slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_nb_frames ( ) const
inline

get the total number of frames

Definition at line 152 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
int slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_read_frames ( ) const
inline

get the number of read frames

Definition at line 145 of file AvReader.hpp.

template<class VideoContainer, typename T, std::size_t Nb_components, std::size_t Nb_block>
AVRational slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::get_time_base ( ) const
inline

get the time base of the video stream (1/framerate)

Returns
1/0 if no codec has been read

Definition at line 193 of file AvReader.hpp.

template<class VideoContainer , typename T , std::size_t Nb_components, std::size_t Nb_block>
void slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::initialize ( )
inline

initialized the reading process.

Note
an initialization is called by the AvReader(std::string) constructor.

Definition at line 253 of file AvReader.hpp.

template<class VideoContainer , typename T , std::size_t Nb_components, std::size_t Nb_block>
int slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::read ( VideoContainer &  in)
inlinevirtual

virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1.

Parameters
inis the container to fill. Warning, the container should be a video container with [] operator, resize(), slices(), width(), height() methods defined.
Returns
true if there is still data to read, false if the file has been completely read.

Implements slip::ContainerReader< VideoContainer, T, Nb_block >.

Definition at line 379 of file AvReader.hpp.

template<class VideoContainer , typename T , std::size_t Nb_components, std::size_t Nb_block>
void slip::AvReader< VideoContainer, T, Nb_components, Nb_block >::release ( )
inline

release the reading process.

Note
this method is called by the destructor.

Definition at line 474 of file AvReader.hpp.

void slip::ContainerReader< VideoContainer , T, Nb_block >::set_data_filename ( const std::string &  data_filename)
inherited
Parameters
data_filenameis the name of the file containing the data to read

Member Data Documentation

std::string slip::ContainerReader< VideoContainer , T, Nb_block >::data_filename_
protectedinherited

Definition at line 100 of file ContainerReader.hpp.


The documentation for this class was generated from the following file: