Skip to content

Dummy Video #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/AvTranscoder/EssenceStream/DummyVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace avtranscoder

DummyVideo::DummyVideo( )
: InputEssence( )
, _inputFrame( NULL )
, _numberOfView( 1 )
{
}
Expand All @@ -27,13 +28,25 @@ VideoDesc DummyVideo::getVideoDesc() const
return _videoDesc;
}

void DummyVideo::setFrame( Frame& inputFrame )
{
_inputFrame = &inputFrame;
}

bool DummyVideo::readNextFrame( Frame& frameBuffer )
{
frameBuffer.getBuffer().resize( _imageDesc.getDataSize() );

int fillChar = 0; // fill images with black
memset( frameBuffer.getPtr(), fillChar, frameBuffer.getSize() );

if( ! _inputFrame )
{
int fillChar = 0; // fill images with black
memset( frameBuffer.getPtr(), fillChar, frameBuffer.getSize() );
return true;
}

if( frameBuffer.getSize() != _inputFrame->getSize() )
frameBuffer.getBuffer().resize( _inputFrame->getSize() );
std::memcpy( frameBuffer.getPtr(), _inputFrame->getPtr(), _inputFrame->getSize() );
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/AvTranscoder/EssenceStream/DummyVideo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ class AvExport DummyVideo : public InputEssence

void setup() {}

void setFrame( Frame& inputFrame );

bool readNextFrame( Frame& frameBuffer );
bool readNextFrame( Frame& frameBuffer, const size_t subStreamIndex );

private:
Frame* _inputFrame;
VideoDesc _videoDesc;
ImageDesc _imageDesc;

Expand Down
4 changes: 2 additions & 2 deletions src/AvTranscoder/Transcoder/StreamTranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ StreamTranscoder::StreamTranscoder(
OutputVideo* outputVideo = new OutputVideo();

_outputEssence = outputVideo;
ImageDesc srcImageDesc; // @todo better solution ?
outputVideo->setProfile( profile, srcImageDesc );
ImageDesc inputImageDesc = static_cast<DummyVideo*>( _inputEssence )->getVideoDesc().getImageDesc();
outputVideo->setProfile( profile, inputImageDesc );

_outputStream = &outputFile.addVideoStream( outputVideo->getVideoDesc() );
_sourceBuffer = new Image( outputVideo->getVideoDesc().getImageDesc() );
Expand Down
5 changes: 5 additions & 0 deletions src/AvTranscoder/Transcoder/Transcoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
addTranscodeStream( filename, streamIndex, subStreamIndex, profileDesc );
}

void Transcoder::add( StreamTranscoder& stream )
{
_streamTranscoders.push_back( &stream );
}

bool Transcoder::processFrame()
{
if( _streamTranscoders.size() == 0 )
Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/Transcoder/Transcoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class Transcoder
*/
void add( const std::string& filename, const size_t streamIndex, const int subStreamIndex, Profile::ProfileDesc& profileDesc );

void add( StreamTranscoder& stream );

bool processFrame();

void process( ProgressListener& progress );
Expand Down
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