Skip to content

Commit 45922a3

Browse files
committed
Merge pull request #230 from cchampet/dev_mediaProperty
mediaProperty: add getStreamProperties
2 parents 3fde640 + 2a02339 commit 45922a3

10 files changed

+81
-15
lines changed

.travis.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,22 @@ env:
1515
- DEPENDENCY_INSTALL=${TRAVIS_BUILD_DIR}/install-dependency
1616
- CI_NODE_TOTAL=2
1717
matrix:
18-
- DEPENDENCY_MODE=libav ENABLE_COVERAGE=true
19-
- DEPENDENCY_MODE=libav ENABLE_COVERAGE=false
18+
- DEPENDENCY_MODE=libav ENABLE_COVERAGE=true
19+
- DEPENDENCY_MODE=libav ENABLE_COVERAGE=false
2020
- DEPENDENCY_MODE=ffmpeg ENABLE_COVERAGE=true
2121
- DEPENDENCY_MODE=ffmpeg ENABLE_COVERAGE=false
2222

23+
matrix:
24+
# generate coverage only with gcc
25+
exclude:
26+
- compiler: clang
27+
env: DEPENDENCY_MODE=ffmpeg ENABLE_COVERAGE=true
28+
- compiler: clang
29+
env: DEPENDENCY_MODE=libav ENABLE_COVERAGE=true
30+
allow_failures:
31+
- os: osx
32+
fast_finish: true
33+
2334
# This results in a 2×2×2x2 build matrix.
2435
# Where the variables are: os / compiler / DEPENDENCY_MODE / ENABLE_COVERAGE
2536

@@ -39,18 +50,12 @@ before_script:
3950

4051
script:
4152
# build
42-
- mkdir -p ${AVTRANSCODER_BUILD}
43-
- cd ${AVTRANSCODER_BUILD}
44-
- cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 -DAVTRANSCODER_COVERAGE=${ENABLE_COVERAGE}
45-
- make -j${CI_NODE_TOTAL}
46-
- make install
53+
- ./tools/travis.build.sh
4754

4855
# launch tests
49-
- if [ ${DEPENDENCY_MODE} = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi
56+
- if [ ${DEPENDENCY_MODE} = "ffmpeg" ]; then ./tools/travis.python.nosetests.sh; fi
5057

5158
after_success:
52-
- cd ${TRAVIS_BUILD_DIR}
53-
5459
# generate coverage for coveralls
5560
- if [ ${ENABLE_COVERAGE} ]; then ./tools/travis.gcc.generate.coverage.sh; fi
5661

src/AvTranscoder/mediaProperty/FileProperties.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ const avtranscoder::StreamProperties& FileProperties::getStreamPropertiesWithInd
189189
throw std::runtime_error( os.str() );
190190
}
191191

192+
const std::vector< avtranscoder::StreamProperties* > FileProperties::getStreamProperties() const
193+
{
194+
std::vector< avtranscoder::StreamProperties* > streams;
195+
for( std::map< size_t, StreamProperties* >::const_iterator it = _streams.begin(); it != _streams.end(); ++it )
196+
{
197+
streams.push_back( it->second );
198+
}
199+
return streams;
200+
}
201+
192202
size_t FileProperties::getNbStreams() const
193203
{
194204
if( ! _avFormatContext )

src/AvTranscoder/mediaProperty/FileProperties.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ class AvExport FileProperties
6868

6969
//@{
7070
// @brief Get the list of properties for a given type (video, audio...)
71+
const std::vector< avtranscoder::StreamProperties* > getStreamProperties() const;
7172
const std::vector< avtranscoder::VideoProperties >& getVideoProperties() const { return _videoStreams; }
7273
const std::vector< avtranscoder::AudioProperties >& getAudioProperties() const { return _audioStreams; }
7374
const std::vector< avtranscoder::DataProperties >& getDataProperties() const { return _dataStreams; }
7475
const std::vector< avtranscoder::SubtitleProperties >& getSubtitleProperties() const { return _subtitleStreams; }
7576
const std::vector< avtranscoder::AttachementProperties >& getAttachementProperties() const { return _attachementStreams; }
76-
const std::vector< avtranscoder::UnknownProperties >& getUnknownPropertiesProperties() const { return _unknownStreams; }
77+
const std::vector< avtranscoder::UnknownProperties >& getUnknownProperties() const { return _unknownStreams; }
7778
//@}
7879

7980
#ifndef SWIG

src/AvTranscoder/mediaProperty/print.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ std::ostream& operator<<( std::ostream& flux, const InputFile& input )
146146
// unknown streams
147147
for( size_t unknownStreamIndex = 0; unknownStreamIndex < input.getProperties().getNbUnknownStreams(); ++unknownStreamIndex )
148148
{
149-
flux << input.getProperties().getUnknownPropertiesProperties().at( unknownStreamIndex );
149+
flux << input.getProperties().getUnknownProperties().at( unknownStreamIndex );
150150
}
151151

152152
return flux;

tools/travis.build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
6+
# Create directory of build
7+
mkdir -p ${AVTRANSCODER_BUILD}
8+
cd ${AVTRANSCODER_BUILD}
9+
10+
# Customize environment
11+
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
12+
# Ask cmake to search in all dependencies we've installed manually
13+
export CMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL}
14+
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
15+
# Ask cmake to search in all homebrew packages
16+
export CMAKE_PREFIX_PATH=$(echo /usr/local/Cellar/*/* | sed 's/ /;/g')
17+
fi
18+
19+
# Build avTranscoder
20+
cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 -DAVTRANSCODER_COVERAGE=${ENABLE_COVERAGE}
21+
make -j${CI_NODE_TOTAL}
22+
make install

tools/travis.gcc.generate.coverage.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#!/bin/bash
2+
3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
16
# capture coverage info
27
lcov --capture --directory ${AVTRANSCODER_BUILD} --output-file coverage.info
38

tools/travis.gcc.install.coverage.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#!/bin/bash
2+
3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
16
# install latest LCOV (1.9 was failing for me)
27
wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
38
tar xf lcov_1.11.orig.tar.gz

tools/travis.linux.install.deps.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/bash
2+
3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
26
lsb_release -a
37

48
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse"

tools/travis.osx.install.deps.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
#!/bin/bash
22

3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
36
brew update
47

5-
brew install gcc cmake swig
6-
brew install freeglut doxygen
8+
# To build
9+
brew install gcc cmake swig doxygen
10+
11+
# To launch nosetests
12+
brew install python
13+
pip install nose
714

15+
# To build avplay application
16+
brew install freeglut
17+
18+
# Main dependency
819
if [[ ${DEPENDENCY_MODE} == "ffmpeg" ]]; then
920
brew install ffmpeg
10-
1121
elif [[ ${DEPENDENCY_MODE} == "libav" ]]; then
1222
brew install libav
23+
fi

tools/travis.python.nosetests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Print commands and their arguments as they are executed.
4+
set -x
5+
36
# Get avtranscoder library
47
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${DEPENDENCY_INSTALL}/lib
58
export PYTHONPATH=${AVTRANSCODER_INSTALL}/lib/python2.7/site-packages/:$PYTHONPATH

0 commit comments

Comments
 (0)