Skip to content

Commit cc6d03f

Browse files
author
Clement Champetier
committed
Merge branch 'develop' of https://github.com/avTranscoder/avTranscoder into dev_transcoderUseComplexFilterToMapAudio
Conflicts: test/pyTest/testSetFrame.py
2 parents 24f820f + d09cc28 commit cc6d03f

16 files changed

+180
-47
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ CMakeFiles
2121
Makefile
2222
cmake_install.cmake
2323
install_manifest.txt
24+
25+
# Python
26+
*.pyc
27+

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ env:
3131
- FDKAAC_VERSION=0.1.3
3232
- OGG_VERSION=1.3.2
3333
- VORBIS_VERSION=1.3.4
34+
- THEORA_VERSION=1.1.1
3435
- VPX_VERSION=1.4.0
3536
matrix:
3637
- DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=true

app/avProcessor/avProcessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void parseConfigFile(const std::string& configFilename, avtranscoder::Transcoder
4141

4242
// generated stream
4343
if(!filename.length())
44-
transcoder.addGeneratedStream(transcodeProfile);
44+
transcoder.addGenerateStream(transcodeProfile);
4545
else
4646
{
4747
avtranscoder::InputStreamDesc inputDesc(filename, streamIndex, channelIndexArray);

src/AvTranscoder/Library.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _AV_TRANSCODER_DESCRIPTION_HPP_
22
#define _AV_TRANSCODER_DESCRIPTION_HPP_
33

4-
#include "common.hpp"
4+
#include <AvTranscoder/common.hpp>
55

66
#include <vector>
77
#include <string>

src/AvTranscoder/Option.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class AvExport Option
5050

5151
// flags
5252
int getFlags() const { return _avOption->flags; }
53-
bool isEncodingOpt() const { return (_avOption->flags & AV_OPT_FLAG_ENCODING_PARAM) == AV_OPT_FLAG_ENCODING_PARAM; }
54-
bool isDecodingOpt() const { return (_avOption->flags & AV_OPT_FLAG_DECODING_PARAM) == AV_OPT_FLAG_DECODING_PARAM; }
55-
bool isAudioOpt() const { return (_avOption->flags & AV_OPT_FLAG_AUDIO_PARAM) == AV_OPT_FLAG_AUDIO_PARAM; }
56-
bool isVideoOpt() const { return (_avOption->flags & AV_OPT_FLAG_VIDEO_PARAM) == AV_OPT_FLAG_VIDEO_PARAM; }
57-
bool isSubtitleOpt() const { return (_avOption->flags & AV_OPT_FLAG_SUBTITLE_PARAM) == AV_OPT_FLAG_SUBTITLE_PARAM; }
53+
bool isEncodingOpt() const { return (getFlags() & AV_OPT_FLAG_ENCODING_PARAM) == AV_OPT_FLAG_ENCODING_PARAM; }
54+
bool isDecodingOpt() const { return (getFlags() & AV_OPT_FLAG_DECODING_PARAM) == AV_OPT_FLAG_DECODING_PARAM; }
55+
bool isAudioOpt() const { return (getFlags() & AV_OPT_FLAG_AUDIO_PARAM) == AV_OPT_FLAG_AUDIO_PARAM; }
56+
bool isVideoOpt() const { return (getFlags() & AV_OPT_FLAG_VIDEO_PARAM) == AV_OPT_FLAG_VIDEO_PARAM; }
57+
bool isSubtitleOpt() const { return (getFlags() & AV_OPT_FLAG_SUBTITLE_PARAM) == AV_OPT_FLAG_SUBTITLE_PARAM; }
5858

5959
// get default value
6060
bool getDefaultBool() const;

src/AvTranscoder/avTranscoder.i

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,14 @@
1616
%include "AvTranscoder/swig/avSeek.i"
1717
%include "AvTranscoder/swig/avOperator.i"
1818

19-
%{
20-
#include <AvTranscoder/log.hpp>
21-
%}
22-
19+
%include "AvTranscoder/log.i"
20+
%include "AvTranscoder/library.i"
21+
%include "AvTranscoder/option.i"
22+
%include "AvTranscoder/util.i"
2323
%include "AvTranscoder/progress/progress.i"
2424
%include "AvTranscoder/properties/properties.i"
2525
%include "AvTranscoder/profile/profile.i"
2626
%include "AvTranscoder/data/data.i"
27-
28-
%include <AvTranscoder/log.hpp>
29-
30-
%include "AvTranscoder/library.i"
31-
%include "AvTranscoder/option.i"
32-
%include "AvTranscoder/util.i"
3327
%include "AvTranscoder/codec/codec.i"
3428
%include "AvTranscoder/stream/stream.i"
3529
%include "AvTranscoder/decoder/decoder.i"

src/AvTranscoder/log.i

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
%{
2+
#include <AvTranscoder/common.hpp>
3+
#include <AvTranscoder/log.hpp>
4+
%}
5+
6+
%include <AvTranscoder/common.hpp>
7+
%include <AvTranscoder/log.hpp>

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ void Transcoder::addStream(const std::vector<InputStreamDesc>& inputStreamDescAr
8383
addTranscodeStream(inputStreamDescArray, profile, offset);
8484
}
8585

86-
void Transcoder::addGeneratedStream(const std::string& encodingProfileName)
86+
void Transcoder::addGenerateStream(const std::string& encodingProfileName)
8787
{
8888
const ProfileLoader::Profile& encodingProfile = _profileLoader.getProfile(encodingProfileName);
89-
addGeneratedStream(encodingProfile);
89+
addGenerateStream(encodingProfile);
9090
}
9191

92-
void Transcoder::addGeneratedStream(const ProfileLoader::Profile& encodingProfile)
92+
void Transcoder::addGenerateStream(const ProfileLoader::Profile& encodingProfile)
9393
{
9494
// Add profile
9595
if(!_profileLoader.hasProfile(encodingProfile))

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class AvExport Transcoder
7474

7575
//@{
7676
// @brief Add a new generated stream to the output file, created from the given encoding profile.
77-
void addGeneratedStream(const std::string& encodingProfileName);
78-
void addGeneratedStream(const ProfileLoader::Profile& encodingProfile);
77+
void addGenerateStream(const std::string& encodingProfileName);
78+
void addGenerateStream(const ProfileLoader::Profile& encodingProfile);
7979
//@}
8080

8181
/**

test/pyTest/testLog.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import os
2+
from nose.tools import *
3+
4+
from pyAvTranscoder import avtranscoder as av
5+
6+
7+
def _logMessages(logger):
8+
"""
9+
Local function to log several messages.
10+
"""
11+
logger.log(av.AV_LOG_DEBUG, 'This is a debug message!')
12+
logger.log(av.AV_LOG_INFO, 'This is an info message!')
13+
logger.log(av.AV_LOG_WARNING, 'This is a warning message!')
14+
logger.log(av.AV_LOG_ERROR, 'This is an error message!')
15+
16+
17+
def testLogInFile():
18+
"""
19+
Check the behavior of the logger file.
20+
"""
21+
logger = av.Logger()
22+
# log several messages in the standard output
23+
_logMessages(logger)
24+
25+
# redirect the output of the logging messages
26+
logger.logInFile()
27+
# the logger message should exist and be empty
28+
assert_equals(os.stat(av.LOG_FILE).st_size, 0)
29+
30+
# log several messages in the logger file
31+
_logMessages(logger)
32+
# the logger message should exist and be filled
33+
assert_greater(os.stat(av.LOG_FILE).st_size, 0)

0 commit comments

Comments
 (0)