From c2aad62208824875e10e28d536162bfb832c0dc8 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 17:36:28 +0200 Subject: [PATCH 1/5] VideoGenerator: fixed copy of data from a specified frame The specified frame could have other properties than the given frame when decoding (will be converted). --- src/AvTranscoder/decoder/VideoGenerator.cpp | 5 ++--- src/AvTranscoder/decoder/VideoGenerator.hpp | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AvTranscoder/decoder/VideoGenerator.cpp b/src/AvTranscoder/decoder/VideoGenerator.cpp index d55db6df..58ba9509 100644 --- a/src/AvTranscoder/decoder/VideoGenerator.cpp +++ b/src/AvTranscoder/decoder/VideoGenerator.cpp @@ -11,7 +11,6 @@ VideoGenerator::VideoGenerator(const VideoFrameDesc& frameDesc) : _inputFrame(NULL) , _blackImage(NULL) , _frameDesc(frameDesc) - , _videoTransform() { } @@ -57,8 +56,8 @@ bool VideoGenerator::decodeNextFrame(Frame& frameBuffer) // Take image from _inputFrame else { - LOG_DEBUG("Copy data of the image specified when decode next frame") - frameBuffer.copyData(*_inputFrame); + LOG_DEBUG("Convert data of the image specified when decode next frame") + _videoTransform.convert(*_inputFrame, frameBuffer); } return true; } diff --git a/src/AvTranscoder/decoder/VideoGenerator.hpp b/src/AvTranscoder/decoder/VideoGenerator.hpp index 47796daa..6f689e31 100644 --- a/src/AvTranscoder/decoder/VideoGenerator.hpp +++ b/src/AvTranscoder/decoder/VideoGenerator.hpp @@ -23,7 +23,8 @@ class AvExport VideoGenerator : public IDecoder /** * @brief Force to return this frame when calling the decoding methods. - * @param inputFrame: should have the same properties as the given frames when decoding. + * @param inputFrame: could have other properties than the given frame when decoding (will be converted). + * @see decodeNextFrame */ void setNextFrame(Frame& inputFrame) { _inputFrame = &inputFrame; } From 90986511d388bb105ab423cca4ed340268365281 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 17:37:33 +0200 Subject: [PATCH 2/5] AudioGenerator: fixed copy of data from a specified frame The specified frame could have other properties than the given frame when decoding (will be converted). --- src/AvTranscoder/decoder/AudioGenerator.cpp | 4 ++-- src/AvTranscoder/decoder/AudioGenerator.hpp | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/AvTranscoder/decoder/AudioGenerator.cpp b/src/AvTranscoder/decoder/AudioGenerator.cpp index 29ec5dd8..48a0b424 100644 --- a/src/AvTranscoder/decoder/AudioGenerator.cpp +++ b/src/AvTranscoder/decoder/AudioGenerator.cpp @@ -55,8 +55,8 @@ bool AudioGenerator::decodeNextFrame(Frame& frameBuffer) // Take audio frame from _inputFrame else { - LOG_DEBUG("Copy data of the audio specified when decode next frame") - frameBuffer.copyData(*_inputFrame); + LOG_DEBUG("Convert data of the audio specified when decode next frame") + _audioTransform.convert(*_inputFrame, frameBuffer); } return true; } diff --git a/src/AvTranscoder/decoder/AudioGenerator.hpp b/src/AvTranscoder/decoder/AudioGenerator.hpp index 0b1d51ec..de8eccd9 100644 --- a/src/AvTranscoder/decoder/AudioGenerator.hpp +++ b/src/AvTranscoder/decoder/AudioGenerator.hpp @@ -3,6 +3,7 @@ #include "IDecoder.hpp" #include +#include namespace avtranscoder { @@ -21,12 +22,18 @@ class AvExport AudioGenerator : public IDecoder bool decodeNextFrame(Frame& frameBuffer); bool decodeNextFrame(Frame& frameBuffer, const std::vector channelIndexArray); + /** + * @brief Force to return this frame when calling the decoding methods. + * @param inputFrame: could have other properties than the given frame when decoding (will be converted). + * @see decodeNextFrame + */ void setNextFrame(Frame& inputFrame) { _inputFrame = &inputFrame; } private: Frame* _inputFrame; ///< Has link (no ownership) AudioFrame* _silent; ///< The generated silent (has ownership) const AudioFrameDesc _frameDesc; ///< The description of the given frame buffer when decoding. + AudioTransform _audioTransform; ///< To transform the specified data when decoding. }; } From 4b87c8db4c33f261bcbbd8aa88f5ea05b2518de2 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 17:40:45 +0200 Subject: [PATCH 3/5] pyTest: updated tests to check how to use set frames with different properties * Than the properties defined in the given profile whe we create the generated stream. * Do that for both video and audio. --- test/pyTest/testSetFrame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/pyTest/testSetFrame.py b/test/pyTest/testSetFrame.py index 18d35df1..ec04f562 100644 --- a/test/pyTest/testSetFrame.py +++ b/test/pyTest/testSetFrame.py @@ -38,7 +38,7 @@ def testSetVideoFrame(): p.progress( i, nbFrames ) # set video frame - frame = av.VideoFrame( av.VideoFrameDesc(1920, 1080, "yuv422p") ) + frame = av.VideoFrame(av.VideoFrameDesc(1920, 1080, "rgb24")) frame.assign(i) videoDecoder.setNextFrame( frame ) @@ -84,7 +84,7 @@ def testSetAudioFrame(): p.progress( i, nbFrames ) # set video frame - frame = av.AudioFrame( av.AudioFrameDesc(48000, 1, "s32") ) + frame = av.AudioFrame(av.AudioFrameDesc(44100, 1, "s16")) frame.assign(i) audioDecoder.setNextFrame( frame ) From a6c5c7aebd3cf35181c69a02435219933f3f9825 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 17:41:39 +0200 Subject: [PATCH 4/5] decoders: skipped unnecessary set of "codec" option when setupDecoder --- src/AvTranscoder/decoder/AudioDecoder.cpp | 3 ++- src/AvTranscoder/decoder/VideoDecoder.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AvTranscoder/decoder/AudioDecoder.cpp b/src/AvTranscoder/decoder/AudioDecoder.cpp index 8d0490e7..6ea1afb6 100644 --- a/src/AvTranscoder/decoder/AudioDecoder.cpp +++ b/src/AvTranscoder/decoder/AudioDecoder.cpp @@ -56,7 +56,8 @@ void AudioDecoder::setupDecoder(const ProfileLoader::Profile& profile) for(ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it) { if((*it).first == constants::avProfileIdentificator || (*it).first == constants::avProfileIdentificatorHuman || - (*it).first == constants::avProfileType || (*it).first == constants::avProfileThreads) + (*it).first == constants::avProfileType || (*it).first == constants::avProfileCodec || + (*it).first == constants::avProfileThreads) continue; try diff --git a/src/AvTranscoder/decoder/VideoDecoder.cpp b/src/AvTranscoder/decoder/VideoDecoder.cpp index 125faf77..082d1dc2 100644 --- a/src/AvTranscoder/decoder/VideoDecoder.cpp +++ b/src/AvTranscoder/decoder/VideoDecoder.cpp @@ -54,7 +54,8 @@ void VideoDecoder::setupDecoder(const ProfileLoader::Profile& profile) for(ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it) { if((*it).first == constants::avProfileIdentificator || (*it).first == constants::avProfileIdentificatorHuman || - (*it).first == constants::avProfileType || (*it).first == constants::avProfileThreads) + (*it).first == constants::avProfileType || (*it).first == constants::avProfileCodec || + (*it).first == constants::avProfileThreads) continue; try From a52ccb72df7d654a6d7e9d35f3d30bf58b25ed81 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 17:42:43 +0200 Subject: [PATCH 5/5] InputFile: skipped unnecessary set of "format" option when setupUnwrapping --- src/AvTranscoder/file/InputFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvTranscoder/file/InputFile.cpp b/src/AvTranscoder/file/InputFile.cpp index 2dbaf379..30e9efd5 100644 --- a/src/AvTranscoder/file/InputFile.cpp +++ b/src/AvTranscoder/file/InputFile.cpp @@ -147,7 +147,7 @@ void InputFile::setupUnwrapping(const ProfileLoader::Profile& profile) for(ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it) { if((*it).first == constants::avProfileIdentificator || (*it).first == constants::avProfileIdentificatorHuman || - (*it).first == constants::avProfileType) + (*it).first == constants::avProfileType || (*it).first == constants::avProfileFormat) continue; try pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy