Skip to content
Snippets Groups Projects
Commit e75fb153 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

videogenerator: use AVPixelFormat

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