Commit e75fb153 authored by Adrien Béraud's avatar Adrien Béraud

videogenerator: use AVPixelFormat

Change-Id: I6989c6708ccfab2a2bcdc274c353e3efdc1ffc8c
parent 9af60e1d
......@@ -449,7 +449,7 @@ MediaDecoder::getTimeBase() const
(unsigned)avStream_->time_base.den};
}
int MediaDecoder::getPixelFormat() const
AVPixelFormat MediaDecoder::getPixelFormat() const
{ return decoderCtx_->pix_fmt; }
int
......
......@@ -96,7 +96,7 @@ class MediaDecoder {
std::string getDecoderName() const;
rational<double> getFps() const;
int getPixelFormat() const;
AVPixelFormat getPixelFormat() const;
void setOptions(const std::map<std::string, std::string>& options);
#ifdef RING_ACCEL
......
......@@ -72,7 +72,7 @@ public:
virtual int getWidth() const = 0;
virtual int getHeight() const = 0;
virtual int getPixelFormat() const = 0;
virtual AVPixelFormat getPixelFormat() const = 0;
std::shared_ptr<VideoFrame> obtainLastFrame();
......
......@@ -114,7 +114,7 @@ void VideoInput::process()
for (auto& buffer : buffers_) {
if (buffer.status == BUFFER_FULL && buffer.index == publish_index_) {
auto& frame = getNewFrame();
int format = getPixelFormat();
AVPixelFormat format = getPixelFormat();
buffer.status = BUFFER_PUBLISHED;
frame.setFromMemory((uint8_t*)buffer.data, format, decOpts_.width, decOpts_.height,
......@@ -593,14 +593,14 @@ int VideoInput::getWidth() const
int VideoInput::getHeight() const
{ return decOpts_.height; }
int VideoInput::getPixelFormat() const
AVPixelFormat VideoInput::getPixelFormat() const
{
int format;
std::stringstream ss;
ss << decOpts_.format;
ss >> format;
return format;
return (AVPixelFormat)format;
}
#else
int VideoInput::getWidth() const
......@@ -609,7 +609,7 @@ int VideoInput::getWidth() const
int VideoInput::getHeight() const
{ return decoder_->getHeight(); }
int VideoInput::getPixelFormat() const
AVPixelFormat VideoInput::getPixelFormat() const
{ return decoder_->getPixelFormat(); }
#endif
......
......@@ -76,7 +76,7 @@ public:
// as VideoGenerator
int getWidth() const;
int getHeight() const;
int getPixelFormat() const;
AVPixelFormat getPixelFormat() const;
DeviceParams getParams() const;
MediaStream getInfo() const;
......
......@@ -229,7 +229,7 @@ int
VideoMixer::getHeight() const
{ return height_; }
int
AVPixelFormat
VideoMixer::getPixelFormat() const
{ return AV_PIX_FMT_YUYV422; }
......
......@@ -46,7 +46,7 @@ public:
int getWidth() const override;
int getHeight() const override;
int getPixelFormat() const override;
AVPixelFormat getPixelFormat() const override;
// as VideoFramePassiveReader
void update(Observable<std::shared_ptr<MediaFrame>>* ob, const std::shared_ptr<MediaFrame>& v) override;
......
......@@ -243,7 +243,7 @@ int VideoReceiveThread::getWidth() const
int VideoReceiveThread::getHeight() const
{ return dstHeight_; }
int VideoReceiveThread::getPixelFormat() const
AVPixelFormat VideoReceiveThread::getPixelFormat() const
{ return videoDecoder_->getPixelFormat(); }
MediaStream
......
......@@ -59,7 +59,7 @@ public:
// as VideoGenerator
int getWidth() const;
int getHeight() const;
int getPixelFormat() const;
AVPixelFormat getPixelFormat() const;
MediaStream getInfo() const;
void triggerKeyFrameRequest();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment