|
|
@ -97,10 +97,29 @@ public: |
|
|
|
LOGV("buffer size: %zu", bufferSize); |
|
|
|
LOGV("buffer size: %zu", bufferSize); |
|
|
|
LOGV("width (frame): %d", frameWidth); |
|
|
|
LOGV("width (frame): %d", frameWidth); |
|
|
|
LOGV("height (frame): %d", frameHeight); |
|
|
|
LOGV("height (frame): %d", frameHeight); |
|
|
|
if (info.flags & AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) { |
|
|
|
if (info.flags & AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) |
|
|
|
|
|
|
|
{ |
|
|
|
LOGV("output EOS"); |
|
|
|
LOGV("output EOS"); |
|
|
|
sawOutputEOS = true; |
|
|
|
sawOutputEOS = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ((size_t)frameWidth * frameHeight * 3 / 2 > bufferSize) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (bufferSize == 3110400 && frameWidth == 1920 && frameHeight == 1088) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
frameHeight = 1080; |
|
|
|
|
|
|
|
LOGV("Buffer size is too small, force using height = %d", frameHeight); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if(bufferSize == 3110400 && frameWidth == 1088 && frameHeight == 1920) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
frameWidth = 1080; |
|
|
|
|
|
|
|
LOGV("Buffer size is too small, force using width = %d", frameWidth); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LOGE("Buffer size is too small. Frame is ignored. Enable verbose logging to see actual values of parameters"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
AMediaCodec_releaseOutputBuffer(mediaCodec.get(), bufferIndex, info.size != 0); |
|
|
|
AMediaCodec_releaseOutputBuffer(mediaCodec.get(), bufferIndex, info.size != 0); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} else if (bufferIndex == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) { |
|
|
|
} else if (bufferIndex == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) { |
|
|
|