Classes | Typedefs | Enumerations | Functions
movie_publisher Namespace Reference

Classes

struct  AVFrameClose
 
struct  AVPacketClose
 
class  ExifBaseMetadataExtractor
 Common base for all metadata extractors that utilize EXIF data. More...
 
struct  ExifData
 
class  FileMetadataExtractor
 Extractor of metadata from filesystem properties of the movie file. More...
 
struct  FileMetadataExtractorPlugin
 Loader plugin for FileMetadataExtractor. More...
 
class  FilenameMetadataExtractor
 Extractor of metadata from filename. More...
 
struct  FilenameMetadataExtractorPlugin
 Loader plugin for FilenameMetadataExtractor. More...
 
struct  LatestMetadataCache
 Latest metadata of each type. More...
 
class  LibavStreamMetadataExtractor
 Extractor of metadata from an open LibAV stream. More...
 
struct  LibavStreamMetadataExtractorPlugin
 Loader plugin for LibabStreamMetadataExtractor. More...
 
struct  MetadataCache
 Metadata cache. More...
 
class  MetadataExtractor
 Extractor of metadata about a movie or image. More...
 
struct  MetadataExtractorParams
 Parameters passed to the extractor plugins when initializing them. More...
 
struct  MetadataExtractorPlugin
 Helper structure that handles instantiation of an extractor. More...
 
class  MetadataManager
 Manager of multiple image metadata providers which can cooperate in parsing. More...
 
class  Movie
 An open movie that can be read, seeked and closed. More...
 
struct  MovieInfo
 Basic information about an open movie. More...
 
class  MovieMetadataListener
 
class  MovieMetadataProcessor
 Base for consumers of movie metadata. More...
 
struct  MovieOpenConfig
 Configuration specifying what movie file to open and how. More...
 
struct  MoviePlaybackState
 State of movie playback. More...
 
struct  MoviePrivate
 PIMPL structure for Movie. More...
 
class  MovieReader
 Helper class for opening movie files. More...
 
class  MovieReaderRos
 MovieReader preconfigured from ROS parameters. More...
 
class  MovieToBag
 Convert movie files and their metadata to ROS bag file. More...
 
class  MovieToBagMetadataProcessor
 
struct  PriorityComparator
 
struct  RationalNumber
 A simple representation of rational numbers of the form numerator/denominator. More...
 
class  StackGuard
 RAII guard saving a function call to stack. Can be used to protect against infinite recursion. More...
 
class  StreamDuration
 Duration type denoting movie stream duration. More...
 
class  StreamTime
 Time type denoting movie stream time. More...
 
struct  TimedMetadata
 Timestamping wrapper for any kind of metadata. More...
 
struct  TimedMetadataCache
 Metadata cache. More...
 
class  TimedMetadataExtractor
 Extractor of timed metadata. More...
 
struct  TimedMetadataListener
 Listener of decoded timed metadata. More...
 

Typedefs

using AVFramePtr = std::unique_ptr< AVFrame, AVFrameClose >
 
using AVPacketPtr = std::unique_ptr< AVPacket, AVPacketClose >
 
using Distortion = sensor_msgs::CameraInfo::_D_type
 
using DistortionData = std::pair< DistortionType, Distortion >
 
using DistortionType = sensor_msgs::CameraInfo::_distortion_model_type
 
typedef std::string ExifAscii
 
typedef uint8_t ExifByte
 
typedef uint32_t ExifLong
 
typedef double ExifRational
 
typedef uint16_t ExifShort
 
typedef int32_t ExifSLong
 
typedef double ExifSRational
 
typedef int16_t ExifSShort
 
typedef std::vector< uint8_t > ExifUnknown
 
using GNSSFixAndDetail = std::pair< cras::optional< sensor_msgs::NavSatFix >, cras::optional< gps_common::GPSFix > >
 
using IntrinsicMatrix = sensor_msgs::CameraInfo::_K_type
 
using MovieConstPtr = std::shared_ptr< const Movie >
 
using MoviePtr = std::shared_ptr< Movie >
 
using RollPitch = std::pair< double, double >
 
using SensorSize = std::pair< double, double >
 

Enumerations

enum  MetadataType {
  MetadataType::CAMERA_GENERAL_NAME, MetadataType::CAMERA_UNIQUE_NAME, MetadataType::CAMERA_SERIAL_NUMBER, MetadataType::CAMERA_MAKE,
  MetadataType::CAMERA_MODEL, MetadataType::LENS_MAKE, MetadataType::LENS_MODEL, MetadataType::CREATION_TIME,
  MetadataType::ROTATION, MetadataType::CROP_FACTOR, MetadataType::SENSOR_SIZE_MM, MetadataType::FOCAL_LENGTH_35MM,
  MetadataType::FOCAL_LENGTH_MM, MetadataType::FOCAL_LENGTH_PX, MetadataType::INTRINSIC_MATRIX, MetadataType::DISTORTION,
  MetadataType::GNSS_POSITION, MetadataType::AZIMUTH, MetadataType::MAGNETIC_FIELD, MetadataType::ROLL_PITCH,
  MetadataType::ACCELERATION, MetadataType::ANGULAR_VELOCITY, MetadataType::FACES, MetadataType::CAMERA_INFO,
  MetadataType::IMU, MetadataType::OPTICAL_FRAME_TF, MetadataType::ZERO_ROLL_PITCH_TF
}
 Enum for supported metadata. More...
 
enum  TimestampSource {
  TimestampSource::AllZeros, TimestampSource::AbsoluteVideoTimecode, TimestampSource::RelativeVideoTimecode, TimestampSource::RosTime,
  TimestampSource::FromMetadata
}
 How to compute ROS timestamps from movie frame presentation timestamp (PTS). More...
 

Functions

cras::expected< std::string, std::string > avPixFmtToRosEncoding (const AVPixelFormat &libavPixelFormat)
 Map Libav pixel formats to ROS image encodings. More...
 
template<typename M >
static bool CompareStamp (const TimedMetadata< M > &a, const StreamTime &b)
 Compare TimedMetadata according to their stamps (in decreasing order). More...
 
template<typename M >
auto findLastUpToStamp (const std::vector< TimedMetadata< M >> &data, const StreamTime &stamp)
 Find index of the latest data from data that have their timestamp less than or equal to stamp. More...
 
template<typename M >
cras::optional< TimedMetadata< M > > findLastUpToStamp (const std::vector< TimedMetadata< M >> &data, const StreamTime &stamp, const cras::optional< M > &defaultVal)
 Find the latest data from data that have their timestamp less than or equal to stamp. More...
 
template<typename T >
parseTimeParam (const XmlRpc::XmlRpcValue &param)
 Parse time or duration in several formats. More...
 
bool parseTimestampOffset (const std::unordered_map< std::string, double > &extraVars, const XmlRpc::XmlRpcValue &param, double &value, bool skipNonConvertible, std::list< std::string > *errors)
 Parse the given timestamp offset. More...
 
TimestampSource parseTimestampSource (const std::string &param)
 Parse TimestampSource from text. More...
 
cras::expected< AVPixelFormat, std::string > rosEncodingToAvPixFmt (const std::string &rosEncoding)
 Map ROS image encodings to Libav pixel formats. More...
 
std::string timestampSourceToStr (const TimestampSource &source)
 Convert the given TimestampSource to text. More...
 
template<typename M >
updateHeader (const M &msg, const ros::Time &stamp, const std::string &frameId)
 

Typedef Documentation

◆ AVFramePtr

using movie_publisher::AVFramePtr = typedef std::unique_ptr<AVFrame, AVFrameClose>

Definition at line 64 of file movie_private.h.

◆ AVPacketPtr

using movie_publisher::AVPacketPtr = typedef std::unique_ptr<AVPacket, AVPacketClose>

Definition at line 58 of file movie_private.h.

◆ Distortion

using movie_publisher::Distortion = typedef sensor_msgs::CameraInfo::_D_type

Definition at line 59 of file metadata_type.h.

◆ DistortionData

Definition at line 60 of file metadata_type.h.

◆ DistortionType

using movie_publisher::DistortionType = typedef sensor_msgs::CameraInfo::_distortion_model_type

Definition at line 58 of file metadata_type.h.

◆ ExifAscii

typedef std::string movie_publisher::ExifAscii

Definition at line 30 of file ExifBaseMetadataExtractor.h.

◆ ExifByte

typedef uint8_t movie_publisher::ExifByte

Definition at line 31 of file ExifBaseMetadataExtractor.h.

◆ ExifLong

typedef uint32_t movie_publisher::ExifLong

Definition at line 34 of file ExifBaseMetadataExtractor.h.

◆ ExifRational

Definition at line 36 of file ExifBaseMetadataExtractor.h.

◆ ExifShort

typedef uint16_t movie_publisher::ExifShort

Definition at line 32 of file ExifBaseMetadataExtractor.h.

◆ ExifSLong

typedef int32_t movie_publisher::ExifSLong

Definition at line 35 of file ExifBaseMetadataExtractor.h.

◆ ExifSRational

Definition at line 37 of file ExifBaseMetadataExtractor.h.

◆ ExifSShort

typedef int16_t movie_publisher::ExifSShort

Definition at line 33 of file ExifBaseMetadataExtractor.h.

◆ ExifUnknown

typedef std::vector<uint8_t> movie_publisher::ExifUnknown

Definition at line 38 of file ExifBaseMetadataExtractor.h.

◆ GNSSFixAndDetail

using movie_publisher::GNSSFixAndDetail = typedef std::pair<cras::optional<sensor_msgs::NavSatFix>, cras::optional<gps_common::GPSFix> >

Definition at line 61 of file metadata_type.h.

◆ IntrinsicMatrix

using movie_publisher::IntrinsicMatrix = typedef sensor_msgs::CameraInfo::_K_type

Definition at line 57 of file metadata_type.h.

◆ MovieConstPtr

using movie_publisher::MovieConstPtr = typedef std::shared_ptr<const Movie>

Definition at line 186 of file movie.h.

◆ MoviePtr

using movie_publisher::MoviePtr = typedef std::shared_ptr<Movie>

Definition at line 185 of file movie.h.

◆ RollPitch

using movie_publisher::RollPitch = typedef std::pair<double, double>

Definition at line 63 of file metadata_type.h.

◆ SensorSize

using movie_publisher::SensorSize = typedef std::pair<double, double>

Definition at line 62 of file metadata_type.h.

Enumeration Type Documentation

◆ MetadataType

Enum for supported metadata.

Enumerator
CAMERA_GENERAL_NAME 
CAMERA_UNIQUE_NAME 
CAMERA_SERIAL_NUMBER 
CAMERA_MAKE 
CAMERA_MODEL 
LENS_MAKE 
LENS_MODEL 
CREATION_TIME 
ROTATION 
CROP_FACTOR 
SENSOR_SIZE_MM 
FOCAL_LENGTH_35MM 
FOCAL_LENGTH_MM 
FOCAL_LENGTH_PX 
INTRINSIC_MATRIX 
DISTORTION 
GNSS_POSITION 
AZIMUTH 
MAGNETIC_FIELD 
ROLL_PITCH 
ACCELERATION 
ANGULAR_VELOCITY 
FACES 
CAMERA_INFO 
IMU 
OPTICAL_FRAME_TF 
ZERO_ROLL_PITCH_TF 

Definition at line 26 of file metadata_type.h.

◆ TimestampSource

How to compute ROS timestamps from movie frame presentation timestamp (PTS).

Enumerator
AllZeros 

ROS timestamp is always 0.

AbsoluteVideoTimecode 

Just use the PTS as is.

RelativeVideoTimecode 

Use PTS, but make it relative to the time set by last seek() call.

RosTime 

Use current ROS time.

FromMetadata 

Use PTS and offset it by the start time recorded in movie metadata.

Definition at line 192 of file types.h.

Function Documentation

◆ avPixFmtToRosEncoding()

cras::expected<std::string, std::string> movie_publisher::avPixFmtToRosEncoding ( const AVPixelFormat &  libavPixelFormat)

Map Libav pixel formats to ROS image encodings.

Parameters
[in]libavPixelFormatLibav pixel format.
Returns
Corresponding ROS image encoding, or error if no conversion exists.

◆ CompareStamp()

template<typename M >
static bool movie_publisher::CompareStamp ( const TimedMetadata< M > &  a,
const StreamTime b 
)
static

Compare TimedMetadata according to their stamps (in decreasing order).

Template Parameters
MType of the metadata.
Parameters
[in]aThe timed metadata to compare.
[in]bThe timestamp to compare with.
Returns
Whether a stamp is greater than b.

Definition at line 214 of file metadata_cache.h.

◆ findLastUpToStamp() [1/2]

template<typename M >
auto movie_publisher::findLastUpToStamp ( const std::vector< TimedMetadata< M >> &  data,
const StreamTime stamp 
)

Find index of the latest data from data that have their timestamp less than or equal to stamp.

Template Parameters
MMetadata type.
Parameters
[in]dataA stamp-ordered list of metadata.
[in]stampThe maximum timestamp.
Returns
Index of the latest data up to stamp.

Definition at line 227 of file metadata_cache.h.

◆ findLastUpToStamp() [2/2]

template<typename M >
cras::optional<TimedMetadata<M> > movie_publisher::findLastUpToStamp ( const std::vector< TimedMetadata< M >> &  data,
const StreamTime stamp,
const cras::optional< M > &  defaultVal 
)

Find the latest data from data that have their timestamp less than or equal to stamp.

Template Parameters
MMetadata type.
Parameters
[in]dataA stamp-ordered list of metadata.
[in]stampThe maximum timestamp.
[in]defaultValThe default value to return in case no value was found in data.
Returns
The latest data up to stamp.

Definition at line 241 of file metadata_cache.h.

◆ parseTimeParam()

template<typename T >
T movie_publisher::parseTimeParam ( const XmlRpc::XmlRpcValue param)

Parse time or duration in several formats.

Template Parameters
Tros::Time or ros::Duration
Parameters
[in]paramThe parameter to parse. Can be float seconds (15.35), tuple (min, sec), tuple (hour, min, sec) or as a string:‘'01:03:05.35’`.
Returns
The parsed time value.

◆ parseTimestampOffset()

bool movie_publisher::parseTimestampOffset ( const std::unordered_map< std::string, double > &  extraVars,
const XmlRpc::XmlRpcValue param,
double &  value,
bool  skipNonConvertible,
std::list< std::string > *  errors 
)

Parse the given timestamp offset.

Parameters
[in]extraVarsExtra variables that should be resolved by the expression parser.
[in]paramThe ROS parameter. Can be either int, double or string. If string, it can contain a mathematical expression with several predefined values: ros_time (current ROS time), wall_time (current wall time) and other variables defined in extraVars.
[out]valueThe output value.
[in]skipNonConvertibleNo effect.
[in]errorsList of encountered errors. Can be nullptr.
Returns
Whether the conversion to value succeeded.

◆ parseTimestampSource()

TimestampSource movie_publisher::parseTimestampSource ( const std::string &  param)

Parse TimestampSource from text.

Parameters
[in]paramThe text to parse.
Returns
The timestamp source or error.

◆ rosEncodingToAvPixFmt()

cras::expected<AVPixelFormat, std::string> movie_publisher::rosEncodingToAvPixFmt ( const std::string &  rosEncoding)

Map ROS image encodings to Libav pixel formats.

Parameters
[in]rosEncodingROS image encoding.
Returns
Corresponding libav pixel format, or error if no conversion exists.

◆ timestampSourceToStr()

std::string movie_publisher::timestampSourceToStr ( const TimestampSource source)

Convert the given TimestampSource to text.

Parameters
[in]sourceThe timestamp source.
Returns
The text representing the timestamp source, or an error.

◆ updateHeader()

template<typename M >
M movie_publisher::updateHeader ( const M &  msg,
const ros::Time stamp,
const std::string &  frameId 
)

Definition at line 67 of file movie_private.h.



movie_publisher
Author(s): Martin Pecka
autogenerated on Wed May 28 2025 02:07:22