19#define MAX_AUDIO_FRAME_SIZE 192000
103 for(
int i=0;
i<(
int)(pFormatCtx->nb_streams);
i++) {
104 if(pFormatCtx->streams[
i]->codecpar->codec_type==code) {
169 "channels %d, sample_rate %d, frame_size %d",
270 nullptr,
nullptr,
nullptr);
315#define HELPER(x) (*((FfmpegHelper*)x))
357 if (config.
check(
"time_base_num") && config.
check(
"time_base_den")) {
365 if (config.
check(
"channel")) {
371 if (config.
check(
"standard")) {
395 bool ok = (result==0);
402 if (config.
check(
"audio",
403 "optional audio device")) {
555 " video size %dx%d, audio %dHz with %d channels, %s sync",
const char * xstrdup(const char *str)
#define MAX_AUDIO_FRAME_SIZE
bool getCodec(AVFormatContext *pFormatCtx)
bool getVideo(AVPacket &packet)
bool getAudio(AVPacket &packet, Sound &sound)
bool getVideo(ImageOf< PixelRgb > &image)
int getStream(AVFormatContext *pFormatCtx, AVMediaType code, const char *name)
AVCodecContext * pCodecCtx
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool openV4L(yarp::os::Searchable &config, AVFormatContext **ppFormatCtx, AVFormatContext **ppFormatCtx2)
int m_w
Width of the images a grabber produces.
bool openFile(AVFormatContext **ppFormatCtx, const char *fname)
int m_h
Height of the images a grabber produces.
bool openFirewire(yarp::os::Searchable &config, AVFormatContext **ppFormatCtx)
AVFormatContext * pAudioFormatCtx
bool getSound(yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override
Get a sound from a device.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get an image from the frame grabber.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
AVDictionary * formatParamsAudio
AVFormatContext * pFormatCtx2
std::string m_uri
Uri of the images a grabber produces.
virtual bool getAudioVisual(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound) override
Get an image and sound.
AVFormatContext * pFormatCtx
AVDictionary * formatParamsVideo
bool close() override
Close the DeviceDriver.
DecoderState videoDecoder
DecoderState audioDecoder
A mini-server for performing network communication in the background.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
static double nowSystem()
static void delaySystem(double seconds)
Image class with user control of representation details.
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
void setFrequency(int freq)
Set the frequency of the sound (i.e.
void resize(size_t samples, size_t channels=1)
Set the sound size.
void set(audio_sample value, size_t sample, size_t channel=0)
#define yCInfo(component,...)
#define yCError(component,...)
#define yCAssert(component, x)
#define yCTrace(component,...)
#define YARP_LOG_COMPONENT(name,...)
#define yCFatal(component,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.