Loading media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -238,7 +238,12 @@ media_status_t VideoTrackTranscoder::configureDestinationFormat( int32_t operatingRate = getDefaultOperatingRate(encoderFormat); if (operatingRate != -1) { SetDefaultFormatValueInt32(AMEDIAFORMAT_KEY_OPERATING_RATE, encoderFormat, operatingRate); float tmpf; int32_t tmpi; if (!AMediaFormat_getFloat(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, &tmpf) && !AMediaFormat_getInt32(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, &tmpi)) { AMediaFormat_setInt32(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, operatingRate); } } SetDefaultFormatValueInt32(AMEDIAFORMAT_KEY_PRIORITY, encoderFormat, kDefaultCodecPriority); Loading media/libmediatranscoding/transcoder/benchmark/MediaTranscoderBenchmark.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <binder/ProcessState.h> #include <fcntl.h> #include <media/MediaTranscoder.h> #include <media/NdkCommon.h> #include <iostream> Loading Loading @@ -87,6 +88,7 @@ static AMediaFormat* CreateDefaultVideoFormat() { AMediaFormat* videoFormat = AMediaFormat_new(); AMediaFormat_setInt32(videoFormat, AMEDIAFORMAT_KEY_BIT_RATE, kVideoBitRate); AMediaFormat_setString(videoFormat, AMEDIAFORMAT_KEY_MIME, AMEDIA_MIMETYPE_VIDEO_AVC); return videoFormat; } Loading Loading @@ -222,7 +224,7 @@ static void TranscodeMediaFile(benchmark::State& state, const std::string& srcFi } static void SetMaxOperatingRate(AMediaFormat* format) { AMediaFormat_setFloat(format, AMEDIAFORMAT_KEY_OPERATING_RATE, INT32_MAX); AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_OPERATING_RATE, INT32_MAX); AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_PRIORITY, 1); } Loading Loading
media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -238,7 +238,12 @@ media_status_t VideoTrackTranscoder::configureDestinationFormat( int32_t operatingRate = getDefaultOperatingRate(encoderFormat); if (operatingRate != -1) { SetDefaultFormatValueInt32(AMEDIAFORMAT_KEY_OPERATING_RATE, encoderFormat, operatingRate); float tmpf; int32_t tmpi; if (!AMediaFormat_getFloat(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, &tmpf) && !AMediaFormat_getInt32(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, &tmpi)) { AMediaFormat_setInt32(encoderFormat, AMEDIAFORMAT_KEY_OPERATING_RATE, operatingRate); } } SetDefaultFormatValueInt32(AMEDIAFORMAT_KEY_PRIORITY, encoderFormat, kDefaultCodecPriority); Loading
media/libmediatranscoding/transcoder/benchmark/MediaTranscoderBenchmark.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <binder/ProcessState.h> #include <fcntl.h> #include <media/MediaTranscoder.h> #include <media/NdkCommon.h> #include <iostream> Loading Loading @@ -87,6 +88,7 @@ static AMediaFormat* CreateDefaultVideoFormat() { AMediaFormat* videoFormat = AMediaFormat_new(); AMediaFormat_setInt32(videoFormat, AMEDIAFORMAT_KEY_BIT_RATE, kVideoBitRate); AMediaFormat_setString(videoFormat, AMEDIAFORMAT_KEY_MIME, AMEDIA_MIMETYPE_VIDEO_AVC); return videoFormat; } Loading Loading @@ -222,7 +224,7 @@ static void TranscodeMediaFile(benchmark::State& state, const std::string& srcFi } static void SetMaxOperatingRate(AMediaFormat* format) { AMediaFormat_setFloat(format, AMEDIAFORMAT_KEY_OPERATING_RATE, INT32_MAX); AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_OPERATING_RATE, INT32_MAX); AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_PRIORITY, 1); } Loading