Public Member Functions | Public Attributes | List of all members
movie_publisher::MoviePrivate Struct Reference

PIMPL structure for Movie. More...

#include <movie_private.h>

Inheritance diagram for movie_publisher::MoviePrivate:
Inheritance graph
[legend]

Public Member Functions

cras::expected< void, std::string > addRotationFilter ()
 Add an image rotation filter to the libav graph so that the outputs are upright. More...
 
cras::expected< void, std::string > configSwscale ()
 Add a scaling filter to the libav graph so that the outputs are properly scaled and color-transformed. More...
 
void detectTargetPixelFormat ()
 Detect the pixel format into which we should extract images. More...
 
void extractMetadata ()
 Run metadata extractors to parse as much as possible in the *Msg members. More...
 
StreamDuration getContainerDuration () const
 
StreamDuration getDuration () const
 
RationalNumber getFrameRate () const
 
size_t getNumFrames () const
 
StreamDuration getStreamDuration () const
 
StreamTime getStreamEnd () const
 
StreamTime getStreamStart () const
 
ros::Time getTimestamp (const StreamTime &ptsTime) const
 Compute ROS timestamp corresponding to the given stream timestamp taking into account the configured timestamp source. More...
 
bool isSeekable () const
 
bool isStillImage () const
 
 MoviePrivate (const cras::LogHelperPtr &log)
 Constructor. More...
 
cras::expected< void, std::string > openCodec (const AVCodec *codec)
 Open the given codec for decoding. More...
 
void prepareMetadataExtractors ()
 Prepare metadata extractors. More...
 
cras::expected< std::pair< AVCodec *, int >, std::string > selectStream ()
 Select the best quality stream and open it for decoding. More...
 
void updateMetadata (const StreamTime &ptsTime)
 Update the metadata for another frame (if some metadata are time-dependent). More...
 
 ~MoviePrivate ()
 
- Public Member Functions inherited from cras::HasLogger
::cras::LogHelperConstPtr getCrasLogger () const
 
 HasLogger (const ::cras::LogHelperPtr &log)
 
void setCrasLogger (const ::cras::LogHelperPtr &log)
 

Public Attributes

AVCodecContext * codecContext {}
 Codec context. More...
 
MovieOpenConfig::Ptr config
 
AVFilterContext * filterBuffersinkContext {}
 Context for filter outputs. More...
 
AVFilterContext * filterBuffersrcContext {}
 Context for filter inputs. More...
 
AVFilterGraph * filterGraph {}
 Filter graph for decoding effects. More...
 
AVFormatContext * formatContext {}
 Format context. More...
 
int imageBufferSize
 Size of the image buffer. More...
 
MovieInfo::Ptr info
 
StreamTime lastSeek
 The value of the last seek request (0 before first seek). More...
 
std::shared_ptr< MovieMetadataListenermetadataListener
 Listener to the extracted metadata. More...
 
std::shared_ptr< MetadataManagermetadataManager
 Manager of the extractable metadata. More...
 
MoviePlaybackState::Ptr playbackState
 Playback state of the movie. More...
 
cras::optional< int64_t > seekRequest
 When set, the next returned frame should be seeked to this position. More...
 
AVStream * stream {}
 The selected stream. More...
 
cras::optional< StreamDurationsubclipDuration
 If nonempty, specifies the duration of subclip to process. More...
 
cras::optional< StreamTimesubclipEnd
 If nonempty, specifies the end of subclip to process. More...
 
cras::optional< StreamTimesubclipStart
 If nonempty, specifies the start of subclip to process. More...
 
SwsContext * swscaleContext {}
 Scaling context. More...
 
AVPixelFormat targetPixelFormat
 The desired output pixel format. More...
 

Additional Inherited Members

- Protected Attributes inherited from cras::HasLogger
::cras::LogHelperPtr log
 

Detailed Description

PIMPL structure for Movie.

Definition at line 102 of file movie_private.h.

Constructor & Destructor Documentation

◆ MoviePrivate()

movie_publisher::MoviePrivate::MoviePrivate ( const cras::LogHelperPtr log)
explicit

Constructor.

Parameters
[in]logLogger.

◆ ~MoviePrivate()

movie_publisher::MoviePrivate::~MoviePrivate ( )

Member Function Documentation

◆ addRotationFilter()

cras::expected<void, std::string> movie_publisher::MoviePrivate::addRotationFilter ( )

Add an image rotation filter to the libav graph so that the outputs are upright.

Returns
Nothing on success, error message otherwise.

◆ configSwscale()

cras::expected<void, std::string> movie_publisher::MoviePrivate::configSwscale ( )

Add a scaling filter to the libav graph so that the outputs are properly scaled and color-transformed.

Returns
Nothing on success, error message otherwise.

◆ detectTargetPixelFormat()

void movie_publisher::MoviePrivate::detectTargetPixelFormat ( )

Detect the pixel format into which we should extract images.

◆ extractMetadata()

void movie_publisher::MoviePrivate::extractMetadata ( )

Run metadata extractors to parse as much as possible in the *Msg members.

◆ getContainerDuration()

StreamDuration movie_publisher::MoviePrivate::getContainerDuration ( ) const
Returns
Duration of the container of the movie.

◆ getDuration()

StreamDuration movie_publisher::MoviePrivate::getDuration ( ) const
Returns
Duration of the movie stream.

◆ getFrameRate()

RationalNumber movie_publisher::MoviePrivate::getFrameRate ( ) const
Returns
Framerate of the movie [Hz].

◆ getNumFrames()

size_t movie_publisher::MoviePrivate::getNumFrames ( ) const
Returns
Total number of frames in the movie (can be unavailable for some movies).

◆ getStreamDuration()

StreamDuration movie_publisher::MoviePrivate::getStreamDuration ( ) const
Returns
Duration of the selected movie stream. Zero if unknown.

◆ getStreamEnd()

StreamTime movie_publisher::MoviePrivate::getStreamEnd ( ) const
Returns
End time of the selected movie stream (relative to movie start). Zero if unknown.

◆ getStreamStart()

StreamTime movie_publisher::MoviePrivate::getStreamStart ( ) const
Returns
Start time of the selected movie stream (relative to movie start). Zero if unknown.

◆ getTimestamp()

ros::Time movie_publisher::MoviePrivate::getTimestamp ( const StreamTime ptsTime) const

Compute ROS timestamp corresponding to the given stream timestamp taking into account the configured timestamp source.

Parameters
[in]ptsTimeStream timestamp.
Returns
The corresponding ROS timestamp.

◆ isSeekable()

bool movie_publisher::MoviePrivate::isSeekable ( ) const
Returns
Whether the movie is seekable.

◆ isStillImage()

bool movie_publisher::MoviePrivate::isStillImage ( ) const
Returns
Whether the movie is a still image or a multi-frame movie.

◆ openCodec()

cras::expected<void, std::string> movie_publisher::MoviePrivate::openCodec ( const AVCodec *  codec)

Open the given codec for decoding.

Parameters
[in]codecThe codec to open.
Returns
Nothing on success, error message otherwise.

◆ prepareMetadataExtractors()

void movie_publisher::MoviePrivate::prepareMetadataExtractors ( )

Prepare metadata extractors.

◆ selectStream()

cras::expected<std::pair<AVCodec*, int>, std::string> movie_publisher::MoviePrivate::selectStream ( )

Select the best quality stream and open it for decoding.

Returns
Open stream with the best quality and its index in the list of streams.

◆ updateMetadata()

void movie_publisher::MoviePrivate::updateMetadata ( const StreamTime ptsTime)

Update the metadata for another frame (if some metadata are time-dependent).

Parameters
[in]ptsTimeStream time of the current frame.

Member Data Documentation

◆ codecContext

AVCodecContext* movie_publisher::MoviePrivate::codecContext {}

Codec context.

Definition at line 134 of file movie_private.h.

◆ config

MovieOpenConfig::Ptr movie_publisher::MoviePrivate::config

Definition at line 111 of file movie_private.h.

◆ filterBuffersinkContext

AVFilterContext* movie_publisher::MoviePrivate::filterBuffersinkContext {}

Context for filter outputs.

Definition at line 132 of file movie_private.h.

◆ filterBuffersrcContext

AVFilterContext* movie_publisher::MoviePrivate::filterBuffersrcContext {}

Context for filter inputs.

Definition at line 131 of file movie_private.h.

◆ filterGraph

AVFilterGraph* movie_publisher::MoviePrivate::filterGraph {}

Filter graph for decoding effects.

Definition at line 130 of file movie_private.h.

◆ formatContext

AVFormatContext* movie_publisher::MoviePrivate::formatContext {}

Format context.

Definition at line 136 of file movie_private.h.

◆ imageBufferSize

int movie_publisher::MoviePrivate::imageBufferSize

Size of the image buffer.

Definition at line 129 of file movie_private.h.

◆ info

MovieInfo::Ptr movie_publisher::MoviePrivate::info

Definition at line 112 of file movie_private.h.

◆ lastSeek

StreamTime movie_publisher::MoviePrivate::lastSeek

The value of the last seek request (0 before first seek).

Definition at line 121 of file movie_private.h.

◆ metadataListener

std::shared_ptr<MovieMetadataListener> movie_publisher::MoviePrivate::metadataListener

Listener to the extracted metadata.

Definition at line 125 of file movie_private.h.

◆ metadataManager

std::shared_ptr<MetadataManager> movie_publisher::MoviePrivate::metadataManager

Manager of the extractable metadata.

Definition at line 124 of file movie_private.h.

◆ playbackState

MoviePlaybackState::Ptr movie_publisher::MoviePrivate::playbackState

Playback state of the movie.

Definition at line 113 of file movie_private.h.

◆ seekRequest

cras::optional<int64_t> movie_publisher::MoviePrivate::seekRequest

When set, the next returned frame should be seeked to this position.

Definition at line 120 of file movie_private.h.

◆ stream

AVStream* movie_publisher::MoviePrivate::stream {}

The selected stream.

Definition at line 135 of file movie_private.h.

◆ subclipDuration

cras::optional<StreamDuration> movie_publisher::MoviePrivate::subclipDuration

If nonempty, specifies the duration of subclip to process.

Definition at line 117 of file movie_private.h.

◆ subclipEnd

cras::optional<StreamTime> movie_publisher::MoviePrivate::subclipEnd

If nonempty, specifies the end of subclip to process.

Definition at line 116 of file movie_private.h.

◆ subclipStart

cras::optional<StreamTime> movie_publisher::MoviePrivate::subclipStart

If nonempty, specifies the start of subclip to process.

Definition at line 115 of file movie_private.h.

◆ swscaleContext

SwsContext* movie_publisher::MoviePrivate::swscaleContext {}

Scaling context.

Definition at line 133 of file movie_private.h.

◆ targetPixelFormat

AVPixelFormat movie_publisher::MoviePrivate::targetPixelFormat

The desired output pixel format.

Definition at line 128 of file movie_private.h.


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


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