videogenerator: use AVPixelFormat

Change-Id: I6989c6708ccfab2a2bcdc274c353e3efdc1ffc8c
This commit is contained in:
Adrien Béraud
2019-02-04 10:13:06 -05:00
parent 9af60e1dee
commit e75fb15393
9 changed files with 12 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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;

View File

@ -229,7 +229,7 @@ int
VideoMixer::getHeight() const
{ return height_; }
int
AVPixelFormat
VideoMixer::getPixelFormat() const
{ return AV_PIX_FMT_YUYV422; }

View File

@ -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;

View File

@ -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

View File

@ -59,7 +59,7 @@ public:
// as VideoGenerator
int getWidth() const;
int getHeight() const;
int getPixelFormat() const;
AVPixelFormat getPixelFormat() const;
MediaStream getInfo() const;
void triggerKeyFrameRequest();