From 2298b6225612f1ba19997319da27b78605e1c9e4 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 11:46:00 +0100 Subject: [PATCH 01/11] InputStream: move doc to based class --- src/AvTranscoder/stream/IInputStream.hpp | 2 +- src/AvTranscoder/stream/InputStream.hpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index 4e8ea4b8..de286ef6 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -22,7 +22,7 @@ class AvExport IInputStream virtual bool readNextPacket( CodedData& data ) = 0; virtual size_t getStreamIndex() const = 0; - virtual float getDuration() const = 0; + virtual float getDuration() const = 0; ///< Get duration of the stream, in seconds virtual AVMediaType getStreamType() const = 0; //@{ diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index 2bb218f7..7b0608da 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -25,7 +25,6 @@ class AvExport InputStream : public IInputStream bool readNextPacket( CodedData& data ); size_t getStreamIndex() const { return _streamIndex; } - /// Get duration of the stream, in seconds float getDuration() const; AVMediaType getStreamType() const; From 87c29ab359f39e39461372d4d2634e86adafc800 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 11:47:20 +0100 Subject: [PATCH 02/11] IOuputFile: clean doc setup function does not exist any more. --- src/AvTranscoder/file/IOutputFile.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/AvTranscoder/file/IOutputFile.hpp b/src/AvTranscoder/file/IOutputFile.hpp index bce7b919..7bb6c9de 100644 --- a/src/AvTranscoder/file/IOutputFile.hpp +++ b/src/AvTranscoder/file/IOutputFile.hpp @@ -26,7 +26,6 @@ class AvExport IOutputFile /** * @brief Add a video output stream - * @note call setup() before adding any stream * @param videoCodec description of output stream **/ virtual IOutputStream& addVideoStream( const VideoCodec& videoCodec ) @@ -36,7 +35,6 @@ class AvExport IOutputFile /** * @brief Add an audio output stream - * @note call setup() before adding any stream * @param audioCodec description of output stream **/ virtual IOutputStream& addAudioStream( const AudioCodec& audioCodec ) @@ -46,7 +44,6 @@ class AvExport IOutputFile /** * @brief Add a data output stream - * @note call setup() before adding any stream * @param dataCodec description of output stream **/ virtual IOutputStream& addDataStream( const DataCodec& dataCodec ) From 88af4f68382e58354ec994ab33659d5448dcff84 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 11:53:02 +0100 Subject: [PATCH 03/11] InputStream: add getProperties method --- src/AvTranscoder/stream/IInputStream.hpp | 9 +++++++++ src/AvTranscoder/stream/InputStream.cpp | 5 +++++ src/AvTranscoder/stream/InputStream.hpp | 1 + 3 files changed, 15 insertions(+) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index de286ef6..0bc368b5 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -1,9 +1,12 @@ #ifndef _AV_TRANSCODER_CODED_STREAM_I_INPUT_STREAM_HPP_ #define _AV_TRANSCODER_CODED_STREAM_I_INPUT_STREAM_HPP_ +#include + #include #include #include + #include namespace avtranscoder @@ -21,6 +24,12 @@ class AvExport IInputStream **/ virtual bool readNextPacket( CodedData& data ) = 0; + /** + * @note The returned object could be cast depending on the type of the stream (video, audio...) + * @see VideoProperties, AudioProperties... + * @return the properties of the stream + */ + virtual const StreamProperties& getProperties() const = 0; virtual size_t getStreamIndex() const = 0; virtual float getDuration() const = 0; ///< Get duration of the stream, in seconds virtual AVMediaType getStreamType() const = 0; diff --git a/src/AvTranscoder/stream/InputStream.cpp b/src/AvTranscoder/stream/InputStream.cpp index 851bd0f5..752040d4 100644 --- a/src/AvTranscoder/stream/InputStream.cpp +++ b/src/AvTranscoder/stream/InputStream.cpp @@ -108,6 +108,11 @@ DataCodec& InputStream::getDataCodec() return *static_cast( _codec ); } +const StreamProperties& InputStream::getProperties() const +{ + return _inputFile->getProperties().getStreamPropertiesWithIndex( _streamIndex ); +} + AVMediaType InputStream::getStreamType() const { return _inputFile->getFormatContext().getAVStream( _streamIndex ).codec->codec_type; diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index 7b0608da..c5f1b1ef 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -24,6 +24,7 @@ class AvExport InputStream : public IInputStream bool readNextPacket( CodedData& data ); + const StreamProperties& getProperties() const; size_t getStreamIndex() const { return _streamIndex; } float getDuration() const; AVMediaType getStreamType() const; From 7341a7a2f62f725e0f75ded565d44b40b8ac751a Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 11:56:40 +0100 Subject: [PATCH 04/11] StreamProperties: add getStreamType method --- src/AvTranscoder/mediaProperty/StreamProperties.cpp | 7 +++++++ src/AvTranscoder/mediaProperty/StreamProperties.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/AvTranscoder/mediaProperty/StreamProperties.cpp b/src/AvTranscoder/mediaProperty/StreamProperties.cpp index b16ee25d..196e425d 100644 --- a/src/AvTranscoder/mediaProperty/StreamProperties.cpp +++ b/src/AvTranscoder/mediaProperty/StreamProperties.cpp @@ -43,6 +43,13 @@ float StreamProperties::getDuration() const return ( timeBase.num / (float) timeBase.den ) * _formatContext->streams[_streamIndex]->duration; } +AVMediaType StreamProperties::getStreamType() const +{ + if( ! _formatContext ) + throw std::runtime_error( "unknown format context" ); + return _formatContext->streams[_streamIndex]->codec->codec_type; +} + PropertyVector StreamProperties::getPropertiesAsVector() const { PropertyVector data; diff --git a/src/AvTranscoder/mediaProperty/StreamProperties.hpp b/src/AvTranscoder/mediaProperty/StreamProperties.hpp index 86c798ac..ee9edf75 100644 --- a/src/AvTranscoder/mediaProperty/StreamProperties.hpp +++ b/src/AvTranscoder/mediaProperty/StreamProperties.hpp @@ -19,6 +19,7 @@ class AvExport StreamProperties size_t getStreamId() const; Rational getTimeBase() const; float getDuration() const; ///< in seconds + AVMediaType getStreamType() const; const PropertyVector& getMetadatas() const { return _metadatas; } #ifndef SWIG From 10b5a09ca4c63156dbe4e4a7276d14539fe2934c Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 12:01:39 +0100 Subject: [PATCH 05/11] IInputStream: remove getStreamType --- src/AvTranscoder/stream/IInputStream.hpp | 1 - src/AvTranscoder/stream/InputStream.cpp | 11 +++-------- src/AvTranscoder/stream/InputStream.hpp | 1 - src/AvTranscoder/transcoder/StreamTranscoder.cpp | 4 ++-- src/AvTranscoder/transcoder/Transcoder.cpp | 6 +++--- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index 0bc368b5..825eec84 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -32,7 +32,6 @@ class AvExport IInputStream virtual const StreamProperties& getProperties() const = 0; virtual size_t getStreamIndex() const = 0; virtual float getDuration() const = 0; ///< Get duration of the stream, in seconds - virtual AVMediaType getStreamType() const = 0; //@{ /** diff --git a/src/AvTranscoder/stream/InputStream.cpp b/src/AvTranscoder/stream/InputStream.cpp index 752040d4..7830c14e 100644 --- a/src/AvTranscoder/stream/InputStream.cpp +++ b/src/AvTranscoder/stream/InputStream.cpp @@ -76,7 +76,7 @@ VideoCodec& InputStream::getVideoCodec() { assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() ); - if( getStreamType() != AVMEDIA_TYPE_VIDEO ) + if( getProperties().getStreamType() != AVMEDIA_TYPE_VIDEO ) { throw std::runtime_error( "unable to get video descriptor on non-video stream" ); } @@ -88,7 +88,7 @@ AudioCodec& InputStream::getAudioCodec() { assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() ); - if( getStreamType() != AVMEDIA_TYPE_AUDIO ) + if( getProperties().getStreamType() != AVMEDIA_TYPE_AUDIO ) { throw std::runtime_error( "unable to get audio descriptor on non-audio stream" ); } @@ -100,7 +100,7 @@ DataCodec& InputStream::getDataCodec() { assert( _streamIndex <= _inputFile->getFormatContext().getNbStreams() ); - if( getStreamType() != AVMEDIA_TYPE_DATA ) + if( getProperties().getStreamType() != AVMEDIA_TYPE_DATA ) { throw std::runtime_error( "unable to get data descriptor on non-data stream" ); } @@ -113,11 +113,6 @@ const StreamProperties& InputStream::getProperties() const return _inputFile->getProperties().getStreamPropertiesWithIndex( _streamIndex ); } -AVMediaType InputStream::getStreamType() const -{ - return _inputFile->getFormatContext().getAVStream( _streamIndex ).codec->codec_type; -} - float InputStream::getDuration() const { return _inputFile->getProperties().getStreamPropertiesWithIndex( _streamIndex ).getDuration(); diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index c5f1b1ef..90982a63 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -27,7 +27,6 @@ class AvExport InputStream : public IInputStream const StreamProperties& getProperties() const; size_t getStreamIndex() const { return _streamIndex; } float getDuration() const; - AVMediaType getStreamType() const; VideoCodec& getVideoCodec(); AudioCodec& getAudioCodec(); diff --git a/src/AvTranscoder/transcoder/StreamTranscoder.cpp b/src/AvTranscoder/transcoder/StreamTranscoder.cpp index fae22792..90d15476 100644 --- a/src/AvTranscoder/transcoder/StreamTranscoder.cpp +++ b/src/AvTranscoder/transcoder/StreamTranscoder.cpp @@ -39,7 +39,7 @@ StreamTranscoder::StreamTranscoder( , _needToSwitchToGenerator( false ) { // create a re-wrapping case - switch( _inputStream->getStreamType() ) + switch( _inputStream->getProperties().getStreamType() ) { case AVMEDIA_TYPE_VIDEO : { @@ -141,7 +141,7 @@ StreamTranscoder::StreamTranscoder( , _needToSwitchToGenerator( false ) { // create a transcode case - switch( _inputStream->getStreamType() ) + switch( _inputStream->getProperties().getStreamType() ) { case AVMEDIA_TYPE_VIDEO : { diff --git a/src/AvTranscoder/transcoder/Transcoder.cpp b/src/AvTranscoder/transcoder/Transcoder.cpp index 6458fa93..723faebc 100644 --- a/src/AvTranscoder/transcoder/Transcoder.cpp +++ b/src/AvTranscoder/transcoder/Transcoder.cpp @@ -317,7 +317,7 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s // Add input file InputFile* referenceFile = addInputFile( filename, streamIndex, offset ); - switch( referenceFile->getStream( streamIndex ).getStreamType() ) + switch( referenceFile->getStream( streamIndex ).getProperties().getStreamType() ) { case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_AUDIO: @@ -385,7 +385,7 @@ ProfileLoader::Profile Transcoder::getProfileFromFile( InputFile& inputFile, con const StreamProperties* streamProperties = &inputFile.getProperties().getStreamPropertiesWithIndex( streamIndex ); const VideoProperties* videoProperties = NULL; const AudioProperties* audioProperties = NULL; - switch( inputFile.getStream( streamIndex ).getStreamType() ) + switch( inputFile.getStream( streamIndex ).getProperties().getStreamType() ) { case AVMEDIA_TYPE_VIDEO: { @@ -522,7 +522,7 @@ void Transcoder::fillProcessStat( ProcessStat& processStat ) for( size_t streamIndex = 0; streamIndex < _streamTranscoders.size(); ++streamIndex ) { IOutputStream& stream = _streamTranscoders.at( streamIndex )->getOutputStream(); - const AVMediaType mediaType = _streamTranscoders.at( streamIndex )->getInputStream().getStreamType(); + const AVMediaType mediaType = _streamTranscoders.at( streamIndex )->getInputStream().getProperties().getStreamType(); switch( mediaType ) { case AVMEDIA_TYPE_VIDEO: From 447392a9e68e8bb84796b9b26decf049152707b0 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 12:12:19 +0100 Subject: [PATCH 06/11] IInputStream: remove getDuration --- src/AvTranscoder/stream/IInputStream.hpp | 1 - src/AvTranscoder/stream/InputStream.cpp | 5 ----- src/AvTranscoder/stream/InputStream.hpp | 1 - src/AvTranscoder/transcoder/StreamTranscoder.cpp | 7 ++++--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index 825eec84..403d89e5 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -31,7 +31,6 @@ class AvExport IInputStream */ virtual const StreamProperties& getProperties() const = 0; virtual size_t getStreamIndex() const = 0; - virtual float getDuration() const = 0; ///< Get duration of the stream, in seconds //@{ /** diff --git a/src/AvTranscoder/stream/InputStream.cpp b/src/AvTranscoder/stream/InputStream.cpp index 7830c14e..ef9bc6d0 100644 --- a/src/AvTranscoder/stream/InputStream.cpp +++ b/src/AvTranscoder/stream/InputStream.cpp @@ -113,11 +113,6 @@ const StreamProperties& InputStream::getProperties() const return _inputFile->getProperties().getStreamPropertiesWithIndex( _streamIndex ); } -float InputStream::getDuration() const -{ - return _inputFile->getProperties().getStreamPropertiesWithIndex( _streamIndex ).getDuration(); -} - void InputStream::addPacket( const AVPacket& packet ) { // Do not cache data if the stream is declared as unused in process diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index 90982a63..a7ad47d0 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -26,7 +26,6 @@ class AvExport InputStream : public IInputStream const StreamProperties& getProperties() const; size_t getStreamIndex() const { return _streamIndex; } - float getDuration() const; VideoCodec& getVideoCodec(); AudioCodec& getAudioCodec(); diff --git a/src/AvTranscoder/transcoder/StreamTranscoder.cpp b/src/AvTranscoder/transcoder/StreamTranscoder.cpp index 90d15476..ef7a0157 100644 --- a/src/AvTranscoder/transcoder/StreamTranscoder.cpp +++ b/src/AvTranscoder/transcoder/StreamTranscoder.cpp @@ -383,7 +383,7 @@ bool StreamTranscoder::processFrame() } else if( _offset < 0 ) { - const bool endOfStream = _outputStream->getStreamDuration() >= ( _inputStream->getDuration() + _offset ); + const bool endOfStream = _outputStream->getStreamDuration() >= ( _inputStream->getProperties().getDuration() + _offset ); if( endOfStream ) { LOG_INFO( "End of negative offset" ) @@ -516,10 +516,11 @@ float StreamTranscoder::getDuration() const { if( _inputStream ) { - const float totalDuration = _inputStream->getDuration() + _offset; + const StreamProperties& streamProperties = _inputStream->getProperties(); + const float totalDuration = streamProperties.getDuration() + _offset; if( totalDuration < 0 ) { - LOG_WARN( "Offset of " << _offset << "s applied to a stream with a duration of " << _inputStream->getDuration() << "s. Set its duration to 0s." ) + LOG_WARN( "Offset of " << _offset << "s applied to a stream with a duration of " << streamProperties.getDuration() << "s. Set its duration to 0s." ) return 0.; } return totalDuration; From e41021aaa928b63968c6e43fc7eb51fe3c866efd Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 12:15:26 +0100 Subject: [PATCH 07/11] IInputStream: add doc --- src/AvTranscoder/stream/IInputStream.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index 403d89e5..0b733c60 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -30,6 +30,10 @@ class AvExport IInputStream * @return the properties of the stream */ virtual const StreamProperties& getProperties() const = 0; + + /** + * @return the index of the stream + */ virtual size_t getStreamIndex() const = 0; //@{ From cf8619f1dcd02fe5920dd3374a866b2f484c3c77 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 14:20:55 +0100 Subject: [PATCH 08/11] OuputFile: rename streamId argument to streamIndex --- src/AvTranscoder/file/IOutputFile.hpp | 6 ++++-- src/AvTranscoder/file/OutputFile.cpp | 16 ++++++++-------- src/AvTranscoder/file/OutputFile.hpp | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/AvTranscoder/file/IOutputFile.hpp b/src/AvTranscoder/file/IOutputFile.hpp index 7bb6c9de..a8a4f9ad 100644 --- a/src/AvTranscoder/file/IOutputFile.hpp +++ b/src/AvTranscoder/file/IOutputFile.hpp @@ -59,7 +59,9 @@ class AvExport IOutputFile /** * @brief Wrap a packet of data in the output ressource * @param data coded packet information for the current stream - * @param streamId refers to the stream in output ressource + * @param streamIndex refers to the stream in output ressource + * @return the wrapping status after wrapping + * @see EWrappingStatus **/ virtual IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamIndex ) = 0; @@ -70,7 +72,7 @@ class AvExport IOutputFile /** * @brief Get the output stream - * @param streamId select the output stream + * @param streamIndex select the output stream * @return the output stream reference **/ virtual IOutputStream& getStream( const size_t streamIndex ) = 0; diff --git a/src/AvTranscoder/file/OutputFile.cpp b/src/AvTranscoder/file/OutputFile.cpp index 075889ab..156507b3 100644 --- a/src/AvTranscoder/file/OutputFile.cpp +++ b/src/AvTranscoder/file/OutputFile.cpp @@ -101,11 +101,11 @@ IOutputStream& OutputFile::addDataStream( const DataCodec& dataDesc ) return *outputStream; } -IOutputStream& OutputFile::getStream( const size_t streamId ) +IOutputStream& OutputFile::getStream( const size_t streamIndex ) { - if( streamId >= _outputStreams.size() ) + if( streamIndex >= _outputStreams.size() ) throw std::runtime_error( "unable to get output stream (out of range)" ); - return *_outputStreams.at( streamId ); + return *_outputStreams.at( streamIndex ); } std::string OutputFile::getFilename() const @@ -159,16 +159,16 @@ bool OutputFile::beginWrap( ) return true; } -IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const size_t streamId ) +IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const size_t streamIndex ) { if( ! data.getSize() ) return IOutputStream::eWrappingSuccess; - LOG_DEBUG( "Wrap on stream " << streamId << " (" << data.getSize() << " bytes for frame " << _frameCount.at( streamId ) << ")" ) + LOG_DEBUG( "Wrap on stream " << streamIndex << " (" << data.getSize() << " bytes for frame " << _frameCount.at( streamIndex ) << ")" ) AVPacket packet; av_init_packet( &packet ); - packet.stream_index = streamId; + packet.stream_index = streamIndex; packet.data = (uint8_t*)data.getData(); packet.size = data.getSize(); @@ -177,7 +177,7 @@ IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const si // free packet.side_data, set packet.data to NULL and packet.size to 0 av_free_packet( &packet ); - const double currentStreamDuration = _outputStreams.at( streamId )->getStreamDuration(); + const double currentStreamDuration = _outputStreams.at( streamIndex )->getStreamDuration(); if( currentStreamDuration < _previousProcessedStreamDuration ) { // if the current stream is strictly shorter than the previous, wait for more data @@ -185,7 +185,7 @@ IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const si } _previousProcessedStreamDuration = currentStreamDuration; - _frameCount.at( streamId )++; + _frameCount.at( streamIndex )++; return IOutputStream::eWrappingSuccess; } diff --git a/src/AvTranscoder/file/OutputFile.hpp b/src/AvTranscoder/file/OutputFile.hpp index 53819a9f..bf71f30d 100644 --- a/src/AvTranscoder/file/OutputFile.hpp +++ b/src/AvTranscoder/file/OutputFile.hpp @@ -37,10 +37,10 @@ class AvExport OutputFile : public IOutputFile * @brief Open ressource, write header, and setup specific wrapping options given when call setupWrapping. * @note Need to add the streams to mux before calling this method. * @note After this call, a new list of AVOption, relative to the format choosen, will be available for the OutputFile. - */ + */ bool beginWrap(); - IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamId ); + IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamIndex ); /** * @brief Close ressource and write trailer. @@ -54,7 +54,7 @@ class AvExport OutputFile : public IOutputFile void addMetadata( const PropertyVector& data ); void addMetadata( const std::string& key, const std::string& value ); - IOutputStream& getStream( const size_t streamId ); + IOutputStream& getStream( const size_t streamIndex ); std::string getFilename() const; From 38b5d8bca350a0b0e7b91d41ed85c0f40d493709 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 15:02:25 +0100 Subject: [PATCH 09/11] IOutputStream: add doc to wrap method --- src/AvTranscoder/stream/IOutputStream.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AvTranscoder/stream/IOutputStream.hpp b/src/AvTranscoder/stream/IOutputStream.hpp index a45d16d7..83a00415 100644 --- a/src/AvTranscoder/stream/IOutputStream.hpp +++ b/src/AvTranscoder/stream/IOutputStream.hpp @@ -36,6 +36,11 @@ class AvExport IOutputStream */ virtual size_t getNbFrames() const = 0; + /** + * @brief Wrap a packet of data + * @return the wrapping status after wrapping + * @see EWrappingStatus + **/ virtual EWrappingStatus wrap( const CodedData& data ) = 0; }; From 5adc732aedc41a66f67c38abf67b4c49df5a6827 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 15:42:41 +0100 Subject: [PATCH 10/11] IInputStream: move doc of buffering methods to based class --- src/AvTranscoder/stream/IInputStream.hpp | 10 +++++++--- src/AvTranscoder/stream/InputStream.hpp | 6 ------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index 0b733c60..b0d258ba 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -46,12 +46,16 @@ class AvExport IInputStream virtual DataCodec& getDataCodec() = 0; //@} - /** - * @brief Activate the stream will buffered its data when read packets. - **/ + //@{ + /** + * @brief Functions about buffering + * Activate the stream will buffered its data when read packets. + * @see IInputStream methods + */ virtual void activate( const bool activate = true ) = 0; virtual bool isActivated() const = 0; virtual void clearBuffering() = 0; + //@} }; } diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index a7ad47d0..b0ea4a15 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -31,16 +31,10 @@ class AvExport InputStream : public IInputStream AudioCodec& getAudioCodec(); DataCodec& getDataCodec(); - //@{ - /** - * @brief Functions about buffering - * @see IInputStream methods - */ void activate( const bool activate = true ){ _isActivated = activate; }; bool isActivated() const { return _isActivated; }; void addPacket( const AVPacket& packet ); void clearBuffering(); - //@} private: InputFile* _inputFile; ///< Has link (no ownership) From 5c7573e2f5737731aebd5cb4d8ba39965395e845 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Thu, 29 Oct 2015 16:15:06 +0100 Subject: [PATCH 11/11] StreamProperties: getAVFormatContext is a const method --- src/AvTranscoder/mediaProperty/StreamProperties.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvTranscoder/mediaProperty/StreamProperties.hpp b/src/AvTranscoder/mediaProperty/StreamProperties.hpp index ee9edf75..a70a9dbe 100644 --- a/src/AvTranscoder/mediaProperty/StreamProperties.hpp +++ b/src/AvTranscoder/mediaProperty/StreamProperties.hpp @@ -23,7 +23,7 @@ class AvExport StreamProperties const PropertyVector& getMetadatas() const { return _metadatas; } #ifndef SWIG - const AVFormatContext& getAVFormatContext() { return *_formatContext; } + const AVFormatContext& getAVFormatContext() const { return *_formatContext; } #endif PropertyMap getPropertiesAsMap() const; ///< Return all properties as a map (name of property, value)