FFMPEG Plugin: Some cleanups.
- Use name that correctly reflects the return value of avcodec_decode_video2(). - Make DO_PROFILING code path of AVCodecDecoder compile again. - No functional change intended.
This commit is contained in:
parent
37bea90971
commit
54b392b4cc
@ -771,9 +771,9 @@ AVCodecDecoder::_DecodeNextVideoFrame()
|
|||||||
// required to buffer the packets between different calls to
|
// required to buffer the packets between different calls to
|
||||||
// _DecodeNextVideoFrame().
|
// _DecodeNextVideoFrame().
|
||||||
int gotVideoFrame = 0;
|
int gotVideoFrame = 0;
|
||||||
int decodedDataSizeInBytes = avcodec_decode_video2(fContext,
|
int encodedDataSizeInBytes = avcodec_decode_video2(fContext,
|
||||||
fRawDecodedPicture, &gotVideoFrame, &fTempPacket);
|
fRawDecodedPicture, &gotVideoFrame, &fTempPacket);
|
||||||
if (decodedDataSizeInBytes < 0) {
|
if (encodedDataSizeInBytes < 0) {
|
||||||
TRACE("[v] AVCodecDecoder: ignoring error in decoding frame %lld:"
|
TRACE("[v] AVCodecDecoder: ignoring error in decoding frame %lld:"
|
||||||
" %d\n", fFrame, len);
|
" %d\n", fFrame, len);
|
||||||
// NOTE: An error from avcodec_decode_video2() is ignored by the
|
// NOTE: An error from avcodec_decode_video2() is ignored by the
|
||||||
@ -784,13 +784,13 @@ AVCodecDecoder::_DecodeNextVideoFrame()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fTempPacket.size -= decodedDataSizeInBytes;
|
fTempPacket.size -= encodedDataSizeInBytes;
|
||||||
fTempPacket.data += decodedDataSizeInBytes;
|
fTempPacket.data += encodedDataSizeInBytes;
|
||||||
|
|
||||||
bool gotNoVideoFrame = gotVideoFrame == 0;
|
bool gotNoVideoFrame = gotVideoFrame == 0;
|
||||||
if (gotNoVideoFrame) {
|
if (gotNoVideoFrame) {
|
||||||
TRACE("frame %lld - no picture yet, decodedDataSizeInBytes: %d, "
|
TRACE("frame %lld - no picture yet, encodedDataSizeInBytes: %d, "
|
||||||
"chunk size: %ld\n", fFrame, decodedDataSizeInBytes,
|
"chunk size: %ld\n", fFrame, encodedDataSizeInBytes,
|
||||||
fChunkBufferSize);
|
fChunkBufferSize);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -807,19 +807,9 @@ AVCodecDecoder::_DecodeNextVideoFrame()
|
|||||||
conversionTime += doneTime - formatConversionStart;
|
conversionTime += doneTime - formatConversionStart;
|
||||||
profileCounter++;
|
profileCounter++;
|
||||||
if (!(fFrame % 5)) {
|
if (!(fFrame % 5)) {
|
||||||
if (info) {
|
printf("[v] profile: d1 = %lld, d2 = %lld (%lld) required %Ld\n",
|
||||||
printf("[v] profile: d1 = %lld, d2 = %lld (%lld) required "
|
decodingTime / profileCounter, conversionTime / profileCounter,
|
||||||
"%Ld\n",
|
fFrame, bigtime_t(1000000LL / fOutputFrameRate));
|
||||||
decodingTime / profileCounter,
|
|
||||||
conversionTime / profileCounter,
|
|
||||||
fFrame, info->time_to_decode);
|
|
||||||
} else {
|
|
||||||
printf("[v] profile: d1 = %lld, d2 = %lld (%lld) required "
|
|
||||||
"%Ld\n",
|
|
||||||
decodingTime / profileCounter,
|
|
||||||
conversionTime / profileCounter,
|
|
||||||
fFrame, bigtime_t(1000000LL / fOutputFrameRate));
|
|
||||||
}
|
|
||||||
decodingTime = 0;
|
decodingTime = 0;
|
||||||
conversionTime = 0;
|
conversionTime = 0;
|
||||||
profileCounter = 0;
|
profileCounter = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user